SCES Queue Management

Overview

SCES is a powerful mail transfer agent (MTA) that manages email delivery efficiently using its queue system. The SCES queue system is responsible for storing and processing emails before final delivery. Understanding the different types of queues and how SCES handles message retries, deferrals, and bounces is crucial for troubleshooting mail delivery issues.

SCES Queues

SCES primarily organizes mail into the following queues:

  • Incoming Queue: Holds newly received emails before processing.
  • Active Queue: Holds emails that are actively being delivered.
  • Deferred Queue: Contains emails that could not be delivered immediately and will be retried later.
  • Bounce Queue: Stores undeliverable messages that will be returned to the sender.
  • Hold Queue: Messages that are held for review.
  • Corrupt Queue: Stores messages that are malformed or unreadable.

Key Concepts: Defer, Retry, and Bounce

1. Defer

A message is deferred when SCES encounters a temporary failure and cannot deliver the email immediately. These emails are placed in the deferred queue and retried periodically based on the configured retry policy.

Common Causes of Defer:

  • Recipient mail server is temporarily unavailable.
  • Greylisting by the recipient’s server.
  • DNS resolution failures.
  • Rate-limiting by the destination server.

Key Logs Indicating Defer:

status=deferred (delivery temporarily suspended: connect to mail.customer.com[192.168.1.1]: Connection timed out)

2. Retry

When an email is deferred, SCES will retry delivery at specific intervals.

Relevant Configuration Parameters:

  • Time interval for queue scans is 300s.
  • Minimum delay before retrying delivery is 300s.
  • Maximum delay before retrying delivery is 1800s.
  • Maximum time a message stays in queue before bouncing is 1d

Understanding maximum time in the queue

The maximum time in the queue parameter determines how long a message remains in the deferred queue before being bounced. The timer starts when the message first enters the deferred queue. Each time an attempt is made to deliver the email and fails, SCES logs the failure and schedules another retry based on the Minimum delay before retrying delivery and Maximum delay before retrying delivery values.

  • If an email remains undeliverable for the entire duration set by Maximum delay before retrying delivery, SCES will generate a bounce message and return it to the sender.
  • The time is measured continuously from when the email is first deferred, not reset after each retry attempt.
  • By default, Maximum time a message stays in queue is set to 1 days (1d), but it can be increased or decreased as needed.

After 1 days, any message still in the deferred queue will be bounced back to the sender with a permanent failure notice.

SCES will attempt delivery periodically until maximum time a message stays in queue(1d) is reached. If the email cannot be delivered within this period, it is bounced.

3. Bounce

A message bounces when it is permanently undeliverable. SCES moves the email to the bounce queue and generates a Non-Delivery Report (NDR) to inform the sender.

Common Causes of Bounce:

  • Invalid recipient address.
  • Recipient domain does not exist.
  • Mailbox full or disabled.
  • Sender blocked by recipient’s spam filters.

Key Logs Indicating Bounce:

status=bounced (User unknown)

Conclusion

Understanding SCES queue management is essential for diagnosing and resolving email delivery issues. Deferred messages are temporarily delayed, retried based on SCES queue management settings, and ultimately bounced if undeliverable.