Skip to main content

Outgoing Mail Queue

Every message the server's outgoing mail system has accepted and not delivered, bounced or expired yet, whoever sent it. Most messages are in the queue for seconds; the ones you see on the screen are the ones that wait, and the screen says why.

The account holder's view of the same queue is in the account docs. Your view adds the whole server, the account behind each message, and the mail that belongs to no account.

Where the queue is​

ScreenWhat it lists
System › Outgoing Mail QueueEvery queued message on the server, with the address and the account that sent it.
The Outgoing Queue tab of an account (Accounts)What that account's mailboxes and send-only users sent and the server hasn't delivered.
The Outgoing Queue tab of an address (Outgoing Mail Quarantine › the address)One mailbox's or send-only user's queued mail. During a quarantine, this is where its held mail is released or deleted.

The three screens are one list. Each row shows the subject and queue ID, the state with the reason it waits, Sent by, Account, the envelope sender under From, the recipients, the arrival time and the size. The buttons above the list narrow it to one state. The sender links to the address's Outgoing Queue tab, the account to its page.

The screens are read-only, with one exception: the held mail of an Outgoing Mail Quarantine, which you release or delete from the address's tab.

The states of a message​

The states are the queues of the mail system (Postfix):

StateMeaning
IncomingAccepted, delivery not started.
Being deliveredA delivery attempt is running.
DeferredA recipient's server, or the network, refused the message for now. The reason is shown under the state, one line per reason, with the recipients it concerns when they differ.
On holdNothing is tried until somebody releases the message. A quarantine holds messages this way; so do you when you hold one by hand.

A deferred recipient without a reason shows Not tried yet: a message released from hold is moved to the deferred queue before its first attempt, which follows at the next queue run, usually within a few minutes. A message you made expire by hand carries an Expiring badge: it goes back to its sender at the next attempt.

The mail system retries a deferred message for five days, then returns it to the sender with the last reason.

Who sent what​

The server attributes a message to the mailbox or send-only user that submitted it: the spam filter stamps an X-Elpan-User-ID header on every authenticated submission, and the outgoing mail system logs it as the message enters the queue. Sent by and Account come from that header.

Not attributed is mail that no address of an account submitted: forwarded mail, mailing-list copies, the server's own bounces and notices, mail sent through a relay collection credential, and an account's system mailbox. Mail queued a moment ago can show as not attributed until its header has reached the panel. Deleted address means the sender existed when the message was queued and not any more.

A mailbox that moved

A mailbox moved to another account keeps its queued mail with the old account. The attribution is read once, when the message is queued.

One message​

The subject opens the message's page: the queue ID, the state, whether a quarantine holds it, the arrival time, the size, the envelope sender, the sender and account, and each recipient with the full text of its last deferral or Not tried yet. If the server rewrote a recipient, e.g. for an alias, the address the sender gave is shown as Originally.

When the panel recorded the submission, the page also shows the message's From and Message-ID headers and Open in the traffic log, which opens the delivery record in the Email Traffic Log. The server's own bounces have no record, so their headers aren't known.

A message that left the queue after the list was read sends you back to the list with a notice: it was delivered, returned to its sender or deleted.

How fresh the list is​

The panel never reads the queue directly. A daemon, elpan-mail-queue-sync, takes a snapshot of the whole queue and replaces the panel's copy in one transaction:

  • five seconds after the queue last changed, and at most once every five minutes;
  • not while the one-minute load average is above twice the number of CPUs (it tries again a minute later);
  • not at all when nothing changed since the last snapshot.

So a message can be gone before the list shows it, and the list can be a few minutes old. The screens say so.

After you work on the queue by hand

When you use postsuper on the outgoing mail system's queue, or you want the screens current right now, run one sync without the guards:

systemctl start elpan-mail-queue-sync-now

It blocks until the snapshot is written.

The queue counts are also in the server's telemetry, as elpan_mail_queue_messages by queue (see Telemetry).

What limits how fast mail enters the queue​

The queue has no limit of its own. What paces it is the submission rate limit of each address and the script-mail limit of each account, both on Limits; neither drops mail that is already queued.

Why a quarantine holds mail instead of refusing it

Mail on hold is still in the queue and can go out later; a refusal is final. When the server suspects a stolen password, it holds the address's mail rather than bounce it. Outgoing Mail Quarantine has the rules and the actions.