org.subethamail.smtp
Interface MessageHandler

All Superinterfaces:
AuthenticationHandler
All Known Implementing Classes:
AbstractMessageHandler, DefaultMessageHandler

public interface MessageHandler
extends AuthenticationHandler

The interface that defines the conversational exchange of a single message on an SMTP connection.

Author:
Jeff Schnitzer

Method Summary
 void data(java.io.InputStream data)
          Called when the DATA part of the SMTP exchange begins.
 void from(java.lang.String from)
          Called first, after the MAIL FROM during a SMTP exchange.
 void recipient(java.lang.String recipient)
          Called once for every RCPT TO during a SMTP exchange.
 void resetMessageState()
          This method is called whenever a RSET command is sent.
 
Methods inherited from interface org.subethamail.smtp.AuthenticationHandler
auth, getAuthenticationMechanisms, resetState
 

Method Detail

from

void from(java.lang.String from)
          throws RejectException
Called first, after the MAIL FROM during a SMTP exchange.

Parameters:
from - is the sender as specified by the client. It will be a rfc822-compliant email address, already validated by the server.
Throws:
RejectException - if the sender should be denied.

recipient

void recipient(java.lang.String recipient)
               throws RejectException
Called once for every RCPT TO during a SMTP exchange. This will occur after a from() call.

Parameters:
recipient - is a rfc822-compliant email address, validated by the server.
Throws:
RejectException - if the recipient should be denied.

data

void data(java.io.InputStream data)
          throws RejectException,
                 TooMuchDataException,
                 java.io.IOException
Called when the DATA part of the SMTP exchange begins. Will only be called if at least one recipient was accepted.

Parameters:
data - will be the smtp data stream, stripped of any extra '.' chars
Throws:
RejectException - if at any point the data should be rejected.
TooMuchDataException - if the listener can't handle that much data. An error will be reported to the client.
java.io.IOException - if there is an IO error reading the input data.

resetMessageState

void resetMessageState()
This method is called whenever a RSET command is sent. It should be used to clean up any pending deliveries.



Copyright © 2011 SubEthaSMTP. All Rights Reserved. Build version: UNVERSIONED