O'Reilly logo

qmail by John Levine

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. Remote Mail Delivery

Remote mail delivery is actually somewhat simpler than local mail delivery, because there’s really only one way to deliver remote mail: locate a suitable host for the message and deliver the mail to that host.

Telling Local from Remote Mail

Any domain that is listed in locals or virtualdomains is local. Anything else is remote. Note in particular that whether a domain appears in rcpthosts or morercpthosts has no bearing on whether it’s local or remote. (If a domain is in rcpthosts but isn’t local, that makes this host a backup or secondary MX for the domain, which I discuss later in this chapter.)

qmail-remote

As we saw in Chapter 2, the main qmail-send daemon passes remote deliveries to qmail-rspawn, which runs qmail-remote to attempt each delivery. The arguments to qmail-remote are the remote hostname, the envelope sender, and the envelope recipients, with the message to send on its standard input. Within qmail, qmail-remote is always run with a single recipient, and the host is the domain part of the recipient address. Other applications can use qmail-remote as a simple mail sending application, with as many recipients per message as desired.

Once qmail-remote has attempted delivery, it writes recipient report(s) and a message report to its standard output. The format of the reports is documented in the qmail-remote manpage.

Locating the Remote Mail Host

qmail-remote can identify the remote host for a message in two ways. If the smtproutes control ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required