@Override public ProtocolSession newSession(ProtocolTransport transport) { return new SMTPSessionImpl(transport, (SMTPConfiguration) getConfiguration()); }
@Override @SuppressWarnings("unchecked") public List<String> getImplementedEsmtpFeatures(SMTPSession session) { if (session.isAuthSupported()) { return ESMTP_FEATURES; } else { return Collections.EMPTY_LIST; } }
@Override public List<CharSequence> getLines() { return SMTPStartTlsResponse.this.getLines(); } };
@Override public Response onConnect(SMTPSession session) { return new SMTPResponse("451", "Bye Bye"); } };
@Override protected Response doFilterChecks(SMTPSession session, String command, String parameters) { session.resetState(); if (parameters == null) { return DOMAIN_ADDRESS_REQUIRED; } else { // store provided name session.setAttachment(SMTPSession.CURRENT_HELO_NAME, parameters, State.Connection); return null; } }
@Override public HookResult doRcpt(SMTPSession session, MaybeSender sender, MailAddress rcpt) { if (session.isRelayingAllowed()) { return HookResult.OK; } return HookResult.DECLINED; }
/** * @see org.apache.james.protocols.smtp.SMTPSession#getHelloName() */ public String getHelloName() { return theConfigData.getHelloName(); }
public SMTPProtocolHandlerChain(MetricFactory metricFactory, boolean addDefault) { this.metricFactory = metricFactory; if (addDefault) { addAll(initDefaultHandlers()); } }
protected MailEnvelope createEnvelope(SMTPSession session, MaybeSender sender, List<MailAddress> recipients) { MailEnvelopeImpl env = new MailEnvelopeImpl(); env.setRecipients(recipients); env.setSender(sender); return env; }
@Override @SuppressWarnings("unchecked") public List<String> getImplementedEsmtpFeatures(SMTPSession session) { // Extension defined in RFC 1870 long maxMessageSize = session.getConfiguration().getMaxMessageSize(); if (maxMessageSize > 0) { return Arrays.asList("SIZE " + maxMessageSize); } else { return Collections.EMPTY_LIST; } }
/** * Construct a new SMTPResponse. The given rawLine need to be in format [SMTPResponseReturnCode SMTResponseDescription]. * If this is not the case an IllegalArgumentException get thrown. * * @param rawLine the raw SMTPResponse */ public SMTPResponse(String rawLine) { this(extractCode(rawLine), extractResponse(rawLine)); }
@Override protected Response doFilterChecks(SMTPSession session, String command, String parameters) { session.setAttachment("CURR_COMMAND", command, State.Transaction); return null; }
/** * @see org.apache.james.protocols.smtp.SMTPSession#getMaxMessageSize() */ public long getMaxMessageSize() { return theConfigData.getMaxMessageSize(); }
/** * @see org.apache.james.protocols.smtp.SMTPSession#useHeloEhloEnforcement() */ public boolean useHeloEhloEnforcement() { return theConfigData.useHeloEhloEnforcement(); }
@Override public ChannelHandler create(ChannelPipeline pipeline) { return new AllButStartTlsLineBasedChannelHandler(pipeline, maxFrameLength, false); } }
/** * @see org.apache.james.protocols.smtp.SMTPSession#getSMTPGreeting() */ public String getSMTPGreeting() { return theConfigData.getSMTPGreeting(); }
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(); message.To.Add("receiveremailaddress@xxx.com"); message.Subject = "This is the Subject line"; message.From = new MailAddress("youremailaddress@xxx.it", "Name to Display"); message.Body = "This is the message body"; System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("yoursmtphost"); smtp.Credentials = new NetworkCredential("youremailaddress@xxx.it", "yourpassword"); smtp.Send(message);
@Override public Response onConnect(SMTPSession session) { return new SMTPResponse("554", "Bye Bye"); } };
@Override public Response onConnect(SMTPSession session) { return new SMTPResponse("451", "Bye Bye"); } };
@Override public Response onConnect(SMTPSession session) { return new SMTPResponse("554", "Bye Bye"); } };