Mailing List Archive

sendmail's backslash hack
As most readers presumably know, the way to override .forward files on
sendmail hosts is to send to \user@hostname. With qmail, you cannot do
this without the cooperation of the user, who might create a
~user/.qmail-direct allowing you to send to user-direct@hostname.

So far so good.

However, this means trouble for some users who want to receive all their
mail in more than one location. Sendmail's backslash hack makes it easy
to set up .forward files to perform this duplication without creating a
mail loop, and qmail lets you do the same using .qmail-direct and
forwarding to user-direct@otherhost.

However, if one of the hosts runs sendmail and the other qmail, nothing
seems to work right.

The problem, the way I read RFC 821 and from observations of what sendmail
actually does, is that sendmail operates right on the borderline of what
RFC 821 will allow. To send to \user@some.where, sendmail will tell the
MX of some.where:

RCPT TO:<\user@some.where>

Now, here is the relevant section from RFC 821 explaining the meaning of
the backslash:

Note that the backslash, "\", is a quote character, which is
used to indicate that the next character is to be used
literally (instead of its normal interpretation). For example,
"Joe\,Smith" could be used to indicate a single nine character
user field with comma being the fourth character of the field.

which I take as meaning that \user@some.where is completely equivalent to
user@some.where, the only effect of the backslash being to remove the
non-existent special interpretation of the `u'.

In other words, though sendmail does not violate the SMTP protocol, it
uses a supposedly equivalent variaton on the address to sneak the
information across that ``this address should not be forwarded''.

Qmail will, of course, escape the backslash with the result

RCPT TO:<"\\user"@some.where>

which is almost certainly the right thing to do, but which does not have
the intended effect.

In fact, I cannot see any way to make qmail send to \user@some.where in
such a fashion that sendmail at some.where will get the message. Nor am I
convinced that it _should_ be possible: The backslash hack seems like an
abomination that should not be supported. Still, users are going to ask
about it. (One already did.)

All I am asking of the list is some feedback: Do you agree with my
analysis? What do we tell users who complain about being unable to send
to such an address?

- Harald