Consulting djbware Publications

8. Local Delivery

Local delivery is considered to be the transfer of a received email to a local INBOX of a known email account in the local system from the MTA's queue. This is subject and responsibility of a Local Delivery Agent (LDA). In case of s/qmail this delivery can be multi-staged; both on a system level, as well on a virtual domain or personal account level.

After injecting the email in s/qmail queue, it is treated depending on the domain information given in the Rcpt To: <user@doman.tld> SMTP envelope field according to two mechanisms considering

  1. locals
  2. virtualdomains.

To deliver those mails to the users, two processes are responsible for the delivery:

qmail-lspawn is a system process and is enabled to provide an additional s/qmail system's user mapping.

Rather, qmail-local can be advised to include a user-defined second stage delivery process. Here a user can setup:

If nothing particular is provided, the systems defaultdelivery takes place.

Email addresses are thus subject of rewriting the original SMTP recipient facilitad upon recognition those as virtualdomain address. Depending on the rewriting, emails - the message - needs to be stored. In general, emails are treated as files in the following ways:

Persistent storage of email messages follows typically the following formating rules:

qmail-local supports a variety of mechanisms; known as

8.1 Acceptance of mails targeting local Accounts

In the s/qmail system, acceptance for emails to local accounts happens under two different conditions, and depends whether the email was generated locally or received from an external system.

8.1.1 Remote Acceptance for local delivery

In the s/qmail system email arrive from an external originator ('Mail From:' targeting a local recipient ('Rcpt to:') while using

8.1.2 Local injection

However, emails can be generated locally by means of

  1. qmail-inject,
  2. mailsubj, and
  3. sendmail

and those are not subject of verification; rather they are delivered locally immediately (in case a local address is targeted).

8.1.3 QMQPD injection

Further, emails received via qmail-qmqpd are treated like locally send mails too.

8.1.4 Bounce mails for local delivery

8.2 Email accounts

We now need to identify in the first place, who can eventually receive email, thus is qualified for reception. Email recipient accounts in the s/qmail system may be distinguished as:

  1. Local managed accounts:
  2. Virtual managed accounts:
  3. Remote managed accounts:
  4. Mailing Lists

Environment variables:

Local managed accounts

Locally assigned accounts

The s/qmail 'alias' user

Virtual accounts

8.3 Delivering Emails

8.4 s/qmail Alias and System Users

User 'alias' and 'alias' users:

8.5 Virtual domain users

8.6 Dot-qmail Mechanism

Mail container:

  1. Maildir
  2. mbox
  3. VSM

Quotas:

dot-qmail mechanism:

8.7 Mail Repository

Storage for User mails

Location:

8.8 Email Forwarding