Interface MessageStartState

All Known Implementing Classes:
SMTPProtocolHandler

public interface MessageStartState
Operations for responding to DATA/BDAT initiation.

This interface is provided to RecipientHandler.startMessage(org.bluezoo.gumdrop.smtp.handler.MessageStartState) and allows the handler to accept or reject message transfer.

The handler does not need to distinguish between DATA and BDAT transports - this is handled transparently by the connection. Message bytes are written to the pipeline's channel if one was provided.

Methods map to reply codes: acceptMessage → 354, rejectMessageStorageFull → 452, rejectMessageProcessingError → 451, rejectMessage → 550.

Author:
Chris Burdess
See Also:
  • Method Details

    • acceptMessage

      void acceptMessage(MessageDataHandler handler)
      Ready to receive message content.

      For DATA, sends 354 response. For BDAT, processing begins immediately. Message bytes are written to the pipeline's channel if one was provided via MailFromHandler.getPipeline().

      The handler receives completion notification via MessageDataHandler.messageComplete(org.bluezoo.gumdrop.smtp.handler.MessageEndState).

      Parameters:
      handler - receives message completion notification
    • rejectMessageStorageFull

      void rejectMessageStorageFull(RecipientHandler handler)
      Temporarily rejects - storage full (452 response).
      Parameters:
      handler - receives next command
    • rejectMessageProcessingError

      void rejectMessageProcessingError(RecipientHandler handler)
      Temporarily rejects - processing error (451 response).
      Parameters:
      handler - receives next command
    • rejectMessage

      void rejectMessage(String message, MailFromHandler handler)
      Permanently rejects message (550 response).
      Parameters:
      message - the rejection message
      handler - receives next transaction
    • serverShuttingDown

      void serverShuttingDown()
      Server is shutting down (421 response).

      Closes the connection after sending the response.