Class SmtpResponseDecoder

All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler

@UnstableApi public final class SmtpResponseDecoder extends LineBasedFrameDecoder
Decoder for SMTP responses.
  • Constructor Details

    • SmtpResponseDecoder

      public SmtpResponseDecoder(int maxLineLength)
      Creates a new instance that enforces the given maxLineLength and a default limit of 64 KiB on the accumulated size of a multi-line response.
      Parameters:
      maxLineLength - the maximum length of a single response line, in bytes.
    • SmtpResponseDecoder

      public SmtpResponseDecoder(int maxLineLength, int maxResponseSize)
      Creates a new instance that enforces the given maxLineLength and maxResponseSize.

      The lines of a multi-line response are buffered until its terminating line arrives. maxResponseSize bounds that buffering. Once it is exceeded, decoding fails with a TooLongFrameException. The limit is approximate and tracks retained memory rather than bytes received, as it charges each buffered line a fixed object overhead in addition to its detail bytes, and ignores the response code, the separator and the terminating line.

      Parameters:
      maxLineLength - the maximum length of a single response line, in bytes.
      maxResponseSize - the maximum accumulated size of a multi-line response, in bytes.
  • Method Details