Class SMTPReply


  • public final class SMTPReply
    extends java.lang.Object
    SMTPReply stores a set of constants for SMTP reply codes. To interpret the meaning of the codes, familiarity with RFC 821 is assumed. The mnemonic constant names are transcriptions from the code descriptions of RFC 821.
    • Field Detail

      • SYSTEM_STATUS

        public static final int SYSTEM_STATUS
        SMTP reply code 211.
        See Also:
        Constant Field Values
      • HELP_MESSAGE

        public static final int HELP_MESSAGE
        SMTP reply code 214.
        See Also:
        Constant Field Values
      • SERVICE_READY

        public static final int SERVICE_READY
        SMTP reply code 220.
        See Also:
        Constant Field Values
      • SERVICE_CLOSING_TRANSMISSION_CHANNEL

        public static final int SERVICE_CLOSING_TRANSMISSION_CHANNEL
        SMTP reply code 221.
        See Also:
        Constant Field Values
      • USER_NOT_LOCAL_WILL_FORWARD

        public static final int USER_NOT_LOCAL_WILL_FORWARD
        SMTP reply code 251.
        See Also:
        Constant Field Values
      • START_MAIL_INPUT

        public static final int START_MAIL_INPUT
        SMTP reply code 354.
        See Also:
        Constant Field Values
      • SERVICE_NOT_AVAILABLE

        public static final int SERVICE_NOT_AVAILABLE
        SMTP reply code 421.
        See Also:
        Constant Field Values
      • ACTION_NOT_TAKEN

        public static final int ACTION_NOT_TAKEN
        SMTP reply code 450.
        See Also:
        Constant Field Values
      • ACTION_ABORTED

        public static final int ACTION_ABORTED
        SMTP reply code 451.
        See Also:
        Constant Field Values
      • INSUFFICIENT_STORAGE

        public static final int INSUFFICIENT_STORAGE
        SMTP reply code 452.
        See Also:
        Constant Field Values
      • UNRECOGNIZED_COMMAND

        public static final int UNRECOGNIZED_COMMAND
        SMTP reply code 500.
        See Also:
        Constant Field Values
      • SYNTAX_ERROR_IN_ARGUMENTS

        public static final int SYNTAX_ERROR_IN_ARGUMENTS
        SMTP reply code 501.
        See Also:
        Constant Field Values
      • COMMAND_NOT_IMPLEMENTED

        public static final int COMMAND_NOT_IMPLEMENTED
        SMTP reply code 502.
        See Also:
        Constant Field Values
      • BAD_COMMAND_SEQUENCE

        public static final int BAD_COMMAND_SEQUENCE
        SMTP reply code 503.
        See Also:
        Constant Field Values
      • COMMAND_NOT_IMPLEMENTED_FOR_PARAMETER

        public static final int COMMAND_NOT_IMPLEMENTED_FOR_PARAMETER
        SMTP reply code 504.
        See Also:
        Constant Field Values
      • MAILBOX_UNAVAILABLE

        public static final int MAILBOX_UNAVAILABLE
        SMTP reply code 550.
        See Also:
        Constant Field Values
      • USER_NOT_LOCAL

        public static final int USER_NOT_LOCAL
        SMTP reply code 551.
        See Also:
        Constant Field Values
      • STORAGE_ALLOCATION_EXCEEDED

        public static final int STORAGE_ALLOCATION_EXCEEDED
        SMTP reply code 552.
        See Also:
        Constant Field Values
      • MAILBOX_NAME_NOT_ALLOWED

        public static final int MAILBOX_NAME_NOT_ALLOWED
        SMTP reply code 553.
        See Also:
        Constant Field Values
      • TRANSACTION_FAILED

        public static final int TRANSACTION_FAILED
        SMTP reply code 554.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SMTPReply

        private SMTPReply()
        Cannot be instantiated.
    • Method Detail

      • isNegativePermanent

        public static boolean isNegativePermanent​(int reply)
        Tests if a reply code is a negative permanent response. All codes beginning with a 5 are negative permanent responses. The SMTP server will send a negative permanent response on the failure of a command that cannot be reattempted with success.
        Parameters:
        reply - The reply code to test.
        Returns:
        True if a reply code is a negative permanent response, false if not.
      • isNegativeTransient

        public static boolean isNegativeTransient​(int reply)
        Tests if a reply code is a negative transient response. All codes beginning with a 4 are negative transient responses. The SMTP server will send a negative transient response on the failure of a command that can be reattempted with success.
        Parameters:
        reply - The reply code to test.
        Returns:
        True if a reply code is a negative transient response, false if not.
      • isPositiveCompletion

        public static boolean isPositiveCompletion​(int reply)
        Tests if a reply code is a positive completion response. All codes beginning with a 2 are positive completion responses. The SMTP server will send a positive completion response on the final successful completion of a command.
        Parameters:
        reply - The reply code to test.
        Returns:
        True if a reply code is a positive completion response, false if not.
      • isPositiveIntermediate

        public static boolean isPositiveIntermediate​(int reply)
        Tests if a reply code is a positive intermediate response. All codes beginning with a 3 are positive intermediate responses. The SMTP server will send a positive intermediate response on the successful completion of one part of a multipart sequence of commands. For example, after a successful DATA command, a positive intermediate response will be sent to indicate that the server is ready to receive the message data.
        Parameters:
        reply - The reply code to test.
        Returns:
        True if a reply code is a positive intermediate response, false if not.
      • isPositivePreliminary

        public static boolean isPositivePreliminary​(int reply)
        Tests if a reply code is a positive preliminary response. All codes beginning with a 1 are positive preliminary responses. Positive preliminary responses are used to indicate tentative success. No further commands can be issued to the SMTP server after a positive preliminary response until a follow-up response is received from the server.

        Note: No SMTP commands defined in RFC 822 provide this type of reply.

        Parameters:
        reply - The reply code to test.
        Returns:
        True if a reply code is a positive preliminary response, false if not.