Link zur deutschen Version/link to German-language version
Requisites for working multidrop mailboxes
Matthias Andree 2004-05-27
Introduction
Many ISPs offer a POP3 multidrop or "domain in a mailbox"
setup to their clients who can then fetch mail for multiple
recipients in their domain "in one go".
Often enough, such an undertaking goes awry during the mail
fetch, causes and remedies are to be presented in this
document.
Initial Examination
POP3, the Post Office Protocol version 3, was intended to
transport mail for a single recipient. It does not keep the
envelope that indicates the actual recipient and sender.
The envelope sender is often copied to the "Return-Path"
header, with respect to the envelope recipient, every
programmer of a mail server will have their own implementation.
Common solutions are "do nothing" (sendmail), "Delivered-To:"
(in qmail, potentially with a domain prefix; Postfix),
"X-Envelope-To:" (certain procmail-based setups) and
"X-Original-To:" (Postfix releases after 2002-10-25 will write
this in addition to Envelope-To:)
Important background information: Mail
headers such as To:, Cc:, Bcc: are IRRELEVANT for routing and
delivery of the mail. Mail routing will only look at the
ENVELOPE - there is no difference from snail mail here.
We will frequently see that upon injection, the envelope is
created from the headers, but ONLY THE ENVELOPE carries, in
contrast to the HEADER, the full information:
- Bcc: is removed from the header - it is supposed to be
invisible to the recipients
- To: and Cc: are not updated to reflect the new target
when mail is being redirected
- To: and Cc:, in mailing list mail, contain the LIST
address and not the subscriber's address
Dropping off mail for multiple distinct recipients in the
same mailbox requires the server to deposit the actual
recipient in the mail in order to achieve proper delivery. POP3
makes no provisions, so this must take place outside the
protocol, the mail header lends itself to the task.
Requirements
POP3 multidrop can work reliably all the same, provided that
some requirements are met. These are:
- The ISP MUST drop one copy per recipient in that
domain.
- The ISP MUST deposit the envelope recipient in the mail
header. Which one your ISP chooses can be asked from their
tech support or you'll see it when looking at a mail header.
You'll typically find X-Original-To:, X-Envelope-To:,
Delivered-To:.
- The POP3 client (Mercury/32, fetchmail, getmail, ...)
MUST reliably recognise the header where the envelope
recipient has been deposited and use ONLY this header for
mail delivery.
- The POP3 client MUST IN NO CASE evaluate To: or
Cc: headers. It MUST ON NO ACCOUNT feed the mail into a
command that is used for injection, such as
sendmail -t -oi (whereas sendmail with a fixed
local mail address, for instance, sendmail -oi joe,
is justifiable).
Explanations
- Ad 1:
- If this requirement is not met, mails to multiple
recipients of the multidrop domain will only reach one of the
recipients.
- Ad 2:
-
If this requirement is not met, delivery will be faulty.
Attempting to derive this information from the headers
(To:, Cc:) is dangerous and unreliable:
- Mail for mailing lists (which have their addresses in
the To: or Cc: header) will loop, which must be
avoided
- the regeneration of recipients that were placed in
the Bcc: header at the sender's site, is impossible
because the Bcc: header is removed for transport, as the
name "blind carbon copy" suggests.