|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MessageHandler
The interface that defines the conversational exchange of a single message on an SMTP connection. Using the term "mail transaction", as defined by RFC 5321, implementing classes of this interface track a single mail transaction. The methods will be called in the following order:
from()recipient() (possibly more than once)data()done()
| Method Summary | |
|---|---|
void |
data(InputStream data)
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. |
| Method Detail |
|---|
void from(String from)
throws RejectException
from - is the sender as specified by the client. It will
be a rfc822-compliant email address, already validated by
the server.
RejectException - if the sender should be denied.
DropConnectionException - if the connection should be dropped
void recipient(String recipient)
throws RejectException
recipient - is a rfc822-compliant email address,
validated by the server.
RejectException - if the recipient should be denied.
DropConnectionException - if the connection should be dropped
void data(InputStream data)
throws RejectException,
TooMuchDataException,
IOException
data - will be the smtp data stream, stripped of any extra '.' chars. The
data stream will be valid only for the duration of the call.
RejectException - if at any point the data should be rejected.
DropConnectionException - if the connection should be dropped
TooMuchDataException - 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.void done()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||