Author: norman
Date: Fri Sep 23 11:36:28 2011
New Revision: 1174671
URL: http://svn.apache.org/viewvc?rev=1174671&view=rev
Log:
Allow to overwrite MailEnvelope creation
Modified:
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataCmdHandler.java
Modified:
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataCmdHandler.java
URL:
http://svn.apache.org/viewvc/james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataCmdHandler.java?rev=1174671&r1=1174670&r2=1174671&view=diff
==============================================================================
---
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataCmdHandler.java
(original)
+++
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataCmdHandler.java
Fri Sep 23 11:36:28 2011
@@ -29,6 +29,7 @@ import org.apache.james.protocols.api.ha
import org.apache.james.protocols.api.handler.ExtensibleHandler;
import org.apache.james.protocols.api.handler.LineHandler;
import org.apache.james.protocols.api.handler.WiringException;
+import org.apache.james.protocols.smtp.MailEnvelope;
import org.apache.james.protocols.smtp.MailEnvelopeImpl;
import org.apache.james.protocols.smtp.SMTPResponse;
import org.apache.james.protocols.smtp.SMTPRetCode;
@@ -107,15 +108,21 @@ public class DataCmdHandler implements C
*/
@SuppressWarnings("unchecked")
protected SMTPResponse doDATA(SMTPSession session, String argument) {
- MailEnvelopeImpl env = new MailEnvelopeImpl();
- env.setRecipients(new
ArrayList<MailAddress>((Collection)session.getState().get(SMTPSession.RCPT_LIST)));
- env.setSender((MailAddress)
session.getState().get(SMTPSession.SENDER));
+ MailEnvelope env = createEnvelope(session, (MailAddress)
session.getState().get(SMTPSession.SENDER), new
ArrayList<MailAddress>((Collection)session.getState().get(SMTPSession.RCPT_LIST)));
session.getState().put(MAILENV, env);
session.pushLineHandler(lineHandler);
return new SMTPResponse(SMTPRetCode.DATA_READY, "Ok Send data ending
with <CRLF>.<CRLF>");
}
+ protected MailEnvelope createEnvelope(SMTPSession session, MailAddress
sender, List<MailAddress> recipients) {
+ MailEnvelopeImpl env = new MailEnvelopeImpl();
+ env.setRecipients(recipients);
+ env.setSender(sender);
+ return env;
+ }
+
+
/**
* @see
org.apache.james.smtpserver.protocol.CommandHandler#getImplCommands()
*/
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]