[comp.mail.sendmail] Different mail header format?

berg@marvin.e17.physik.tu-muenchen.de (Stephen R. van den Berg) (03/13/91)

Could it be that some mailers (notably in the UK) strip the
"From " line, or don't add a "From " line?

And if so, could it be that they use some other method to authenticate the
mail, like:

From: Real Name <Authenticated_user_name>

instead of the usual:

From Authenticated_user_name Date

And what happens if sendmail receives a message without a "From " line.
Does it append one itself?  What username and date does it use?
And if sendmail doesn't add any "From " line, what does /bin/mail
(the normal mail delivery program) do with it?  Does it append the
"From " line?  What username and date does it use?
Does it parse the <...>?

Inquiring minds want to know.  Thanks.
--
Sincerely,                 berg@marvin.e17.physik.tu-muenchen.de
           Stephen R. van den Berg.
"I code it in 5 min, optimize it in 90 min, because it's so well optimized:
it runs in only 5 min.  Actually, most of the time I optimize programs."

rickert@mp.cs.niu.edu (Neil Rickert) (03/14/91)

In article <4146@rwthinf.UUCP> berg@marvin.e17.physik.tu-muenchen.de (Stephen R. van den Berg) writes:
>Could it be that some mailers (notably in the UK) strip the
>"From " line, or don't add a "From " line?

 Approximately true.  A more accurate description would be that some transports
rely on header information to determine message delivery.  The SMTP protocol
instead relies on the separate envelope information, which is transmitted
with the MAIL and RCPT smtp commands, and is independent of the headers.

>And if so, could it be that they use some other method to authenticate the
>mail, like:
>
>From: Real Name <Authenticated_user_name>
>
>instead of the usual:
>
>From Authenticated_user_name Date

 Actually the 'From user date' format is usually referred to as the
"Unix from line", and is largely restricted to unix systems.  It is the way
the envelope sender information is represented with UUCP mail protocols.
When a message is received via UUCP, typically 'rmail' reads the 'From ' line
to determine the sender, and removes that line from the message.  It invokes
'sendmail' with the argument list:
 sendmail -fsender recipient [recipient] ...
as a way of transmitting the envelope information to 'sendmail'.

>And what happens if sendmail receives a message without a "From " line.

 This is completely normal.  'sendmail' does not expect a 'From ' line, and
if it finds one, it discards it.

>Does it append one itself?  What username and date does it use?

 'sendmail' never 'appends' a 'From ' line.  It may, however, prepend it.
This depends entirely on the mailer flags.  With a standard setup,
'sendmail' includes the 'From ' line in messages to the UUCP mailer and to
the PROG mailer.  It excludes the 'From ' line in SMTP messages and in
messages to the local mailer.

>And if sendmail doesn't add any "From " line, what does /bin/mail
>(the normal mail delivery program) do with it?  Does it append the

 The 'From ' line in messages in your mailbox is normally put there by
/bin/mail.  In the common BSD setup, if the message is from an external
sender, 'sendmail' invokes /bin/mail with the '-rsender' option, which
is used to create the 'From ' line.  If the message has a local origin,
however, the '-rsender' is omitted, and /bin/mail use the realuid under
which it is invoked to determine the sender.  (One result is that mail from
MAILER-DAEMON received locally often has 'From daemon' instead of
'From MAILER-DAEMON'.

 /bin/mail itself does not expect a 'From ' line, and if it finds one, it
"escapes" it by changing to '>From ', but otherwise ignores the line.

 ----------
 A footnote.  You make several references to "Authenticated_user_name".  Be
warned that the authentication is less than perfect, and it is well known
that forging the sender is not excessively difficult.

-- 
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  Neil W. Rickert, Computer Science               <rickert@cs.niu.edu>
  Northern Illinois Univ.
  DeKalb, IL 60115                                   +1-815-753-6940