Class ServerRcpt


public class ServerRcpt extends ServerMail
RCPT extension processor.
  • Field Details

    • recipientsLimit

      private int recipientsLimit
      Recipients limit.
  • Constructor Details

    • ServerRcpt

      public ServerRcpt()
  • Method Details

    • process

      public boolean process(Connection connection, Verb verb) throws IOException
      RCPT processor.
      Overrides:
      process in class ServerMail
      Parameters:
      connection - Connection instance.
      verb - Verb instance.
      Returns:
      Boolean.
      Throws:
      IOException - Unable to communicate.
    • getMailFrom

      private String getMailFrom(Connection connection)
      Gets MAIL FROM address from the current envelope.

      Helper method to avoid code duplication in proxy and blackhole checks.

      Parameters:
      connection - Connection instance.
      Returns:
      MAIL FROM address or null if no envelope exists.
    • handleProxyRecipient

      private boolean handleProxyRecipient(Connection connection, ProxyRule rule) throws IOException
      Handles a recipient that matches a proxy rule.
      Parameters:
      connection - Connection instance.
      rule - Proxy rule that matched.
      Returns:
      Boolean indicating success.
      Throws:
      IOException - Unable to communicate.
    • establishProxyConnection

      private ProxyEmailDelivery establishProxyConnection(Connection connection, ProxyRule rule)
      Establishes a new proxy connection.
      Parameters:
      connection - Connection instance.
      rule - Proxy rule.
      Returns:
      ProxyEmailDelivery instance.
    • setRecipientsLimit

      public ServerRcpt setRecipientsLimit(int limit)
      Sets recipients limit.
      Parameters:
      limit - Limit value.
      Returns:
      ServerMail instance.
    • checkBotAddress

      private void checkBotAddress(Connection connection) throws IOException
      Checks if the recipient address matches any bot patterns and records matches.

      Bot addresses are matched against configured patterns with domain and IP restrictions.

      If a match is found, the bot address and bot name are recorded in the envelope.

      Parameters:
      connection - Connection instance.
      Throws:
      IOException - RCPT address parsing problem.
    • getAddress

      public javax.mail.internet.InternetAddress getAddress() throws IOException
      Gets RCPT TO address.
      Overrides:
      getAddress in class ServerMail
      Returns:
      Address instance.
      Throws:
      IOException - RCPT address parsing problem.