org.subethamail.smtp.server
Class AbstractMessageHandler

java.lang.Object
  extended by org.subethamail.smtp.server.AbstractMessageHandler
All Implemented Interfaces:
AuthenticationHandler, MessageHandler

public abstract class AbstractMessageHandler
extends java.lang.Object
implements MessageHandler

A simple base class to make implementing message handlers easier. It also makes modification of the interface class easier on users.

Author:
Jeff Schnitzer

Constructor Summary
AbstractMessageHandler()
           
 
Method Summary
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.subethamail.smtp.MessageHandler
data
 
Methods inherited from interface org.subethamail.smtp.AuthenticationHandler
auth, getAuthenticationMechanisms, resetState
 

Constructor Detail

AbstractMessageHandler

public AbstractMessageHandler()
Method Detail

from

public void from(java.lang.String from)
          throws RejectException
Description copied from interface: MessageHandler
Called first, after the MAIL FROM during a SMTP exchange.

Specified by:
from in interface MessageHandler
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

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

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

resetMessageState

public void resetMessageState()
Description copied from interface: MessageHandler
This method is called whenever a RSET command is sent. It should be used to clean up any pending deliveries.

Specified by:
resetMessageState in interface MessageHandler