[net.mail] Yet another Sendmail problem

urban@spp2.UUCP (Mike Urban) (04/10/85)

Yes, it's another query for the Group Mind regarding the
vagaries of Sendmail.  We have a semi-complex configuration
file that knows about our local ethernet, UUCP, and even
does automatic routing to places like "ihnp4" (who insist
on putting `From: site!person@ihnp4' in the header).  This
is on a 4.2bsd system, BTW.

But, there's something weird going on.  When we send mail via
UUCP among our machines, the information on the sender fails
to get turned into a `From:' header line on delivery.  Some
investigation showed that if `rmail' hands `sendmail' a
message like:

	Date: whatever
	Subject: whatever else
	body of message

and supplies the sender in the -f option to sendmail, the
sender information only gets placed in a "mail"-format (not
rfc822) "from" header line in the /usr/spool/mail file,  and no
"From:" header is created.  BUT, if the "Date:" line is
omitted, sendmail *will* create the "From:" line on the basis
of the -f information (and the Full-name: option and all that
stuff).

Evidently(?), something is assuming that if there's a "Date:"
line, there's going to be a "From:" line as well, and none gets
created.  But a quick glance through the code didn't shed any
light on this behavior.  I would rather that our news-sending
programs (MH) be permitted to place "Date:" lines, but don't
want them to place "From:" lines since such lines tend to
confuse far-away mail programs much more than they help (what
do YOU do when you see one of those "From: foo!bar@ihnp4.UUCP"
lines, assuming you're not a direct neighbor of ihnp4?).

  Can someone give me a clue?

	Mike

-- 

   Mike Urban
	{ucbvax|decvax}!trwrb!trwspp!spp2!urban 

"You're in a maze of twisty UUCP connections, all alike"

gjm@ihnp4.UUCP (Gary J. Murakami) (04/15/85)

> ... "ihnp4" (who insist
> on putting `From: site!person@ihnp4' in the header).  This
> is on a 4.2bsd system, BTW.

As far as I know, ihnp4 does NOT put mixed addresses into the "From:"
line -- and this is the first complaint that I have had from my over
1000 neighbors.

Sendmail couples the "UGLY UUCP From" lines and the RFC "From:" line;
this causes dificulty since it is difficult to rewrite "From" while
leaving "From:" intact.  However, my tests show that at worst, the line
may read "From: ihnp4!site!person", and any other munging is probably
being done at your local site.

If you have any problems, please send me mail with appropriate
information so that problems (if any) can be resolved.

-Gary

laura@utzoo.UUCP (Laura Creighton) (04/15/85)

I get a lot of mail from ihnp4. Ocassionally it comes with a From: line
with an @ in  it -- though I have never seen ``@ihnp4''. In every case
I know of, though, this is when:

a sire on ARPA or CSnet sends mail to a site not running sendmail, and
that site sends mail to ihnp4. I think this problem is a sub class of the
``if it doesn't run sendmail then it doesn't modify the From: line''
problem. I fix it by deleting all From: lines in may mail before I read
it. Grubby, but effective.

Laura Creighton
utzoo!laura

andrew@stc-a.UUCP (Andrew Macpherson) (04/18/85)

> From: gjm@ihnp4.UUCP (Gary J. Murakami)
> Message-ID: <749@ihnp4.UUCP>

> Sendmail couples the "UGLY UUCP From" lines and the RFC "From:" line;
> this causes dificulty since it is difficult to rewrite "From" while
> leaving "From:" intact.  However, my tests show that at worst, the line
> may read "From: ihnp4!site!person", and any other munging is probably
> being done at your local site.

This coupling can be avoided!  It is caused by $g being expanded/ripped
apart to form the "UGLY UUCP From" line, but..  4.2 rmail can accept
UGLY UUCP lines, or ``Bang Notation'' From-space lines.  If you are
trying to stick to RFC822 for the From: part of the headder by using
the "suucp" mailer (u@h), scrap the 'U' flag in the mailer definition,
and redefine the 'l' macro:

DlFrom $w!$f  $d

$w is your hostname, $d the date and $f is the string passed in as the
-f argument to sendmail by rmail, which will always be ``Bang Format''
so you build up the return path in the From-space line while leaving
the domain based addresses inviolate.

_G_r_e_a_t_ _i_s_n_'_t_ _i_t_?

BTW my SYSV neighbours havn't complained (yet), so I assume that their
rmail behaves simmilarly.

If anyone's experiance proves this wrong, please let me know (I expect
an empty mailbox...)
-- 
Regards,
	Andrew Macpherson.	<andrew@stc.UUCP>
	{creed, idec, root44, stl, ukc}!stc!andrew

hokey@plus5.UUCP (Hokey) (04/22/85)

Well, it sort of works for us.  If we use the trick on our Mlocal mailer,
replies go to "uucp" instead of to the author.  It seems to work on
relayed mail, though.

Another interesting case comes when we attempt to fully qualify names in
the ruleset.  This works, however it *always* causes a "remote from" UUCP
line to be generated.

I can understand that sendmail assumes the mailer will do the conversion
to the target protocol (with the exception of UUCP mail, which sendmail
tries to account for itself), but I am all set to hack sendmail into
doing the conversion directly.  It would be equally swell if sendmail
directly handled the incoming conversion as well, instead of relying on
rmail (for example).  This is kinda hard.
-- 
Hokey           ..ihnp4!plus5!hokey
		  314-725-9492

jim@hwcs.UUCP (05/01/85)

Posted for Jim Crammond @ hwcs.UUCP by A.Macpherson @ stc.UUCP

> 
> This coupling can be avoided!  It is caused by $g being expanded/ripped
> apart to form the "UGLY UUCP From" line, but..  4.2 rmail can accept
> UGLY UUCP lines, or ``Bang Notation'' From-space lines.  If you are
> trying to stick to RFC822 for the From: part of the headder by using
> the "suucp" mailer (u@h), scrap the 'U' flag in the mailer definition,
> and redefine the 'l' macro:
> 
> DlFrom $w!$f  $d
> 

Sorry, but this only works if ruleset 3 leaves uucp addresses in bang form.

In case you didn't know this, $f is run through rulesets 3,1 and 4.

The result is then passed through 3,1,S and 4 (where S is the
per-mailer-sender-rewrite-rule) and this is set to $g.

822 headers which are flagged as H_FROM (e.g. From, Sender, Return-Path) are
run through 3,1,S and 4 again so a typical From: line will have travelled
through 3,1,4,3,1,S,4,3,1,S and 4. Bizarre isn't it.

My solution to this is to define macro 'l' as:

DlFrom $g $d remote from $U

where the uucp ruleset rewrites $g in total bang form (no '@'s or '%'s)
sticking the local *domain* on if there isn't one, and defining $U as
the uucpname, e.g.

>From hwcs.uucp!jim <date> remote from hwcs

This does mean the From: line says "hwcs.uucp!jim" but that's really
the best sendmail can do.

-Jim.

p.s. please post this to the net if you think its worth it, cstvax hasn't
got its act together with sending news to kent just now.

p.p.s you will here more on my sendmail quite soon - it gateways to janet!!