public static class BasicMessageHandlerFactory.BasicMessageHandler extends Object implements MessageHandler
| Constructor and Description |
|---|
BasicMessageHandler(MessageContext context,
BasicMessageListener listener,
int maxMessageSize) |
| Modifier and Type | Method and Description |
|---|---|
String |
data(InputStream is)
Called when the DATA part of the SMTP exchange begins.
|
void |
done()
Called after all other methods are completed.
|
void |
from(String from)
Called first, after the MAIL FROM during a SMTP exchange.
|
void |
recipient(String recipient)
Called once for every RCPT TO during a SMTP exchange.
|
public BasicMessageHandler(MessageContext context, BasicMessageListener listener, int maxMessageSize)
public void from(String from) throws RejectException
MessageHandlerfrom in interface MessageHandlerfrom - is the sender as specified by the client. It will
be a mostly rfc822-compliant email address, already validated by
the server. The validation is performed by the
JavaMail InternetAddress.parse function, according to the strict rules,
which means that "many (but not all) of the RFC822 syntax rules are enforced".RejectException - if the sender should be denied.DropConnectionException - if the connection should be droppedpublic void recipient(String recipient) throws RejectException
MessageHandlerrecipient in interface MessageHandlerrecipient - is a rfc822-compliant email address,
validated by the server.RejectException - if the recipient should be denied.DropConnectionException - if the connection should be droppedpublic String data(InputStream is) throws RejectException, TooMuchDataException, IOException
MessageHandlerdata in interface MessageHandleris - will be the smtp data stream, stripped of any extra '.' chars. The
data stream will be valid only for the duration of the call.null if return
message shouldn't be customized.RejectException - if at any point the data should be rejected.DropConnectionException - if the connection should be droppedTooMuchDataException - if the listener can't handle that much data.
An error will be reported to the client.IOException - if there is an IO error reading the input data.public void done()
MessageHandlerdone in interface MessageHandlerCopyright © 2006–2024. All rights reserved.