R Aldridge writes:
> This isn't really a qmail question, more mail in general. I received an
> email with the following header. Although it was "Received: .... for
> [EMAIL PROTECTED]", it doesn't have a "To: [EMAIL PROTECTED]" line ?!
> Or maybe I'm missing something. Any ideas anyone ?
.Ah "A bit about email"
Before you can understand qmail, you have to understand email.
Perhaps you have used email for years, and know all about how to get
mail through to people with weird addresses. Very likely, though, you
have only ever had to deal with RFC822 messages. You know, From:,
To:, and Subject: headers, and a body. But that's not the major
concern of an MTA like qmail. It's more concerned with RFC821. None
of this explanation is specific to qmail.
.Bh "The post office analogy"
Probably everyone is familiar with the way a national mail system
works. You've got a message to send. You type it up on a piece of
paper. All the business schools teach you how to format a letter,
with your address at the top, followed by the recipient's address,
followed by a salutation and the body of the message. Then the letter
goes into an envelope, the envelope is addressed, a return-address
sticker placed on the top-left corner, and a stamp on the top-right
corner.
Email works much the same way. You enter the message that you want to
send into your MUA (Mail User Agent). You give it the recipient's
address. Earlier you gave it your own address. Since that never
changes, it's stored it away and tacks it onto outgoing messages.
Then the MUA hands the mail to the MTA (Mail Transfer Agent), which
usually examines the headers to get the address of the recipient. It
uses that for the envelope recipient. It supplies the username that
was running the MUA as the envelope sender.
.Bh "The crucial distinction"
The post office uses the envelope address to send the mail. It
doesn't look at the letter inside the envelope. It could care less
what the recipient address on the letter is, nor even if there is any
address at all. If the envelope recipient is wrong, then the post
office sends the mail back to the envelope sender. If that is also
wrong, then the letter goes to the dead letter office, where a human
opens the letter to see if the proper recipient address can be
discerned from the contents.
Similarly, an MTA makes a distinction between the envelope addresses
(RFC821--only address matter, no comments) and the message addresses
(RFC822--typically full name <address>). It tries to send the mail to
the envelope recipient, if that fails, then it tries the envelope
sender, and if that fails, you have a double bounce and the postmaster
gets it.
.Bh "The source of the envelope information"
The envelope information is usually derived from the message headers.
If you don't tell the submittal program (for which the Unix standard
is /usr/lib/sendmail) any special addresses, it will search the
headers for To:, CC:, and BCC: headers. All of those addresses will
be used for envelope recipients. The envelope sender is usually the
username associated with the UID that ran the submittal program.
Those aren't always the right values to use. For examples, consider a
mailing list. A user submitted mail to the list, so the envelope
sender is them, and the envelope recipient is the list submission
address. The mailing list needs to create a totally different
envelope. The list's envelope needs to have it's bounce-processing
address as the envelope sender, and the list of members as the
envelope recipient(s).
Typically, the submittal program has a way to make those changes.
/usr/lib/sendmail has a -f option to set the envelope sender, and you
can give it an address as a parameter, which it will use as the
envelope recipient. This parameter names an alias which the submittal
program expands into the whole list of members.
.Bh "How qmail fits into this"
Qmail emulates /usr/lib/sendmail, but also provides it's own
submission program (which /usr/lib/sendmail runs), called
qmail-inject. This program adds headers to make the message
RFC822-compliant, and derives the envelope sender and recipient as
described above. It's an improvement over the /usr/lib/sendmail
interface mostly because it was designed to be a submission program,
where /usr/lib/sendmail just aggregated features.
Qmail-inject is the only part of qmail which parses RFC822 headers.
So, once it's derived the envelope addresses, it effectively seals the
envelope.
--
-russ nelson <[EMAIL PROTECTED]> http://crynwr.com/~nelson
Crynwr supports Open Source(tm) Software| PGPok | There is good evidence
521 Pleasant Valley Rd. | +1 315 268 1925 voice | that freedom is the
Potsdam, NY 13676-3213 | +1 315 268 9201 FAX | cause of world peace.