Here's an example of correct quoting behavior. An SMTP client that wants
to send mail to the address

   Joe,[EMAIL PROTECTED]

generates the SMTP command

   RCPT TO:<Joe\,[EMAIL PROTECTED]>

which the SMTP server then decodes into

   Joe,[EMAIL PROTECTED]

There are many other possibilities for the SMTP command in the middle.
For example:

   RCPT TO:<"Joe,Smith"@cr.yp.to>
   Rcpt To:<\J\o\e\,\S\m\i\t\[EMAIL PROTECTED]>
   rCpT tO:<"\Jo\e,\S\mi\t\h"@cr.yp.to>

The SMTP client may use any of these address encodings. The SMTP server
decodes all of them into the same address.

(The idea that the SMTP server is required to preserve the quotes and
backslashes when it relays messages to other hosts is as ludicrous as
the idea that the SMTP server is required to preserve the case of RCPT.
RFC 821 says nothing of the sort.)

Similar comments apply to RFC 822. A message generator might encode the
address Joe,[EMAIL PROTECTED] as

   From: "J\oe\,S\mi\th" (Joey) @ cr.yp.to

A message reader decodes this address into Joe,[EMAIL PROTECTED] and sends
a reply to that address. The address might be encoded in the reply as

   To: "Joe,Smith"@cr.yp.to

and in a subsequent SMTP conversation as

   RCPT TO:<"Joe\,Smith"@cr.yp.to>

which, as above, specifies the address Joe,[EMAIL PROTECTED] This address
has, as RFC 821 says, ``a single nine character user field with comma
being the fourth character of the field.''

Scott Schwartz writes:
> qmail-smtpd wrongly transforms <"A B"@ARPA> into <A B@ARPA>

No. You are confusing two different objects:

   * the address, eight characters long in this example: A B@ARPA
   * an SMTP command specifying that address: RCPT TO:<"A B"@ARPA>

Surely you understand the concepts of ASCII-encoded IP addresses, and
zone-file-encoded domain names, and sh-encoded command-line arguments.
So why are you having so much trouble with SMTP-encoded email addresses?

---Dan

Reply via email to