Subject: Re: Stripped addresses and IMAP clients

From: [email-masked]
Date: Sat, 8 Apr 1995 01:59:45 -0400

John, I hate to tell you this, but the pine-info to comp.mail.pine 
gateway never passed this article, nor could I find it on the zmailer 
archive.  I only found out about it after I saw someone else quote from 
it, and then I had to search the pine-info archive, where a couple other 
of your posts appeared that had never made it to news.  I haven't looked 
thoroughly to see if there are other posts mailed to pine-info that never 
made it through the gateway.
    Also, said news to mail and back gateway fails to pass the Reply-To: 
header from one to the other, which could be a problem for those whose 
From: fields are not the ones at which mail is desired...

On Tue, 21 Mar 1995, John Gardiner Myers wrote:

> <One of my e-mail addresses> writes:
> >     Zmailer rewrites the fully-qualified sender's name, if delivery is
> > done locally, with only the login.
> 
> ICK!

    But then, this is not too much different from how the mail would appear
were it to be sent by Unix mail, such as...
% uuencode core My_last_Unix_act.jpg | mail -s "Oh yeah?  Up yours" root
...since most rewriting rules do not add hostname for local delivery.

As a result, I've added comp.mail.headers (and dropped the zmailer group)
to debate the merits of headers with only the login for the address.
I was discussing how I attempted to reply to a message received on a remote
machine, but delivered locally on that machine, retrieved via IMAP.  My
reply wound up with the *local* hostname appended to the login, which was
not a valid recipient...

> >     Given that zmailer is delivering mail in this rather distributed
> > environment, my feeling is that what it should be doing (and what any
> > MTA should be doing), given the increased use of remote protocols such
> > as IMAP to read mail, is not reducing e-mail addresses to the bare
> > minimum, with the resulting ambiguity, but rather, the MTA should
> > instead always be completing incomplete e-mail addresses.  Comments?
> 
> I agree with you completely.  Zmailer should not be gratuitously
> rewriting a perfectly valid, RFC 822 conforming, address into
> something which is not even syntactically valid.
> 
> The IMAP servers then try to turn this garbage back into something
> that is syntactically valid, but as you seem to have found out it is
> sometimes Garbage In Garbage Out.

    I've done more tests, having read through the IMAP4 RFC in a state of
exhaustion to the point of hallucination, since it seemed that page 48 gave
the indication that an IMAP client should be able to reconstruct the address
as the IMAP server provides the hostname in its replies.
    Attempting to reply to a number of messages with no hostname in the
address, whether stripped to <login> form by zmailer, or simply never given
the hostname by the sendmail rules for local delivery; in all cases, I
wound up with a reply to the correct address, hostname and all.

    Then I got to thinking.  The mailbox from which I read the mail is a bit
distant, so I am in the habit of saving my mail to which I wish to reply to
a local mailbox, so that the connection to the IMAP server does not hinder
my composing a response.

    When I saved messages from a couple different IMAP servers, with the
address as either login (from Unix mail on local machine) or <login> (from
Pine stripped by zmailer), and attempted to reply to those, I could not get
the correct address.  The information provided by the IMAP server about the
hostname is lost when the message is saved to the local folder.

    My question now is:  should the IMAP client be saving the message with
the qualified address, so that information does not get lost?  And would
it be a good idea for the various sendmail rewriting rules to provide the
full address as a default, even for messages delivered locally, in case
those messages are accessed remotely and transferred to another machine?

    While the simplicity of a simple login for an address may have had its
merits in years past, I feel that the time may have come to recognize that
mail delivered locally doesn't always stay that way, and in my opinion, it
would be preferable for the default sendmail rules to provide a complete
e-mail address for delivery, even locally, regardless of the source of the
mail (Pine, Unix mail, or whatever).

    Of course, there will always be mail with only the login for an address,
so perhaps the IMAP client should do something with these when placing them
anywhere other than where the message was received...

Barry Bouwsma
<[email-masked]>

---

From: John Gardiner Myers <[email-masked]>
Date: Sun, 9 Apr 1995 15:15:31 -0400

> ...since most rewriting rules do not add hostname for local delivery.

On my systems, I always configure sendmail with
FEATURE(always_add_domain) turned on.  I suppose I should lobby to
make it the default.

A message which does not travel across the network does not
necessarily have to conform to any network standards, such as the RFC
822 message format.  In the case of many traditional unix mail
systems, messages which remain local to the host contain address
information in a form which does not conform to 822.

This is not as serious a problem as taking messages that arrived from
the network and changing them such that they no longer conform to 822,
which a previous message from you indicated that zmailer did.

> the qualified address, so that information does not get lost?

The IMAP server should not be modifying the content of the messages it
hands out.  In this situation, it has been given a message with
addresses which do not conform to 822.  It can interpret them the best
it can, for purposes of computing the IMAP4 ENVELOPE data item, but it
should not make a bad situation worse by trying to rewrite the
headers.

> And would

Yes, it would be a very good idea.  In sendmail v8, you can do this by
putting FEATURE(always_add_domain) in the mc file you use to generate
the cf file.

As you seem to have found out, in today's environments, "local"
information tends not to stay local.  Addresses should be sent in
fully-qualified network-standard form.

-- 
_.John G. Myers		Internet: [email-masked]
			LoseNet:  ...!seismo!ihnp4!wiscvm.wisc.edu!give!up

---

From: Unauthorized System User <[email-masked]>
Date: Mon, 10 Apr 1995 20:12:25 -0400

> which a previous message from you indicated that zmailer did.

    I'm sorry if I didn't make that clear, but the mail which started 
this thread was composed by Pine (thus the full address) but delivered 
locally.  (I was reading it remotely).  However, since delivery was 
local, zmailer took the full address which Pine created and rewrote it to 
resemble mail that had been composed by a different MUA which does not 
bother to complete local addresses.  Apologies for the misunderstanding.
Zmailer works fine when presented with addresses that have arrived over 
the network.  Its aggressive rewriting of a local address started this.

> should not make a bad situation worse by trying to rewrite the

    Okay, the server has given out an address and enough additional 
information for the IMAP client to compose a proper reply, so long as the 
message is being read from the server and the additional information 
provided by this IMAP server (in the form of hostname) is available.

    But as soon as I make a copy of that message from the remote IMAP 
server, via my local IMAP client, to a local filesystem, or presumably, 
to a different remote IMAP server, the additional hostname information as 
provided by the IMAP server from which the message was read, which is 
needed to properly complete a reply to the message, is lost, or replaced 
with the different remote IMAP server's hostname when I read the 
transferred copy of the original message.

    If the client receives data for which the additional hostname is 
required for generating correct replies, and the client is asked to store 
the message elsewhere, should the client then decide to attempt to preserve 
this hostname information by rewriting the headers, which are going to be 
meaningless anyway when the context of the IMAP server from which they 
were retrieved is lost?  (Or doesn't this make sense yet?)  It's not an 
ideal situation, but perhaps it would help to make a bad situation (non-
822 addresses) better (non-822 addresses qualified with the hostname 
from which they were read)...

> fully-qualified network-standard form.

    Having not personally had experience with out-of-the-box 
configurations for sendmail or any of its popular replacements, I can 
only guess that the average sysadmin would not bother to do this if it is 
not the default, and I surmise it is not the default for the majority of 
configurations of different versions (BSD v8, IDA, Smail, zmailer, and 
any others I've left out).  Thus, I'm introducing this to 
comp.mail.sendmail, knowing that v8.7 is under construction, so that 
perhaps Eric Allman might consider supplying this in the default 
configuration for the new release.  I believe the reason that JustSend8 
mail works successfully in so many cases is due to the supplied default 
of stripping mail to 7 bits set to False, and most sysadmins would not 
bother to change this, and similarly wouldn't make the effort to 
unqualify addresses for local delivery either, being more interested in 
simply plugging in the local information and trying to run with that.

    If I were really gung-ho about this, I'd bring it up back in the 
original zmailer discussion group, as well as introduce it in 
comp.mail.smail, but one step at a time for now...

Barry Bouwsma
<[email-masked]>
(ignore the From: field of this newspost)