sendmail and delivery problem

Andy S Poling andy at jhunix.HCF.JHU.EDU
Thu Nov 15 08:18:59 AEST 1990


In article <1990Nov13.141646.4032 at msuinfo.cl.msu.edu> lees at briggs1.lbs.msu.edu (John Lees) writes:
>We have a mail delivery problem on our 3B2-500s running 3.1.1 and
>sendmail 4.12 (9/7/83) from Wollongong. The problem is that all
>mail from off-site is delivered as "From root". The following line
>begins with ">From", and has the correct address of the sender. The
>remainder of the message is just fine. Example:
>
>  From root Mon Nov 12 17:47 EST 1990
>  >From freemacs-request at sun.soe.clarkson.edu  Mon Nov 12 17:47:21 1990
>
>The sendmail.cf uses this definition for the mailer:
>
>Mlocal, P=/bin/mail, F=lsSMmh, S=10, R=10, A=mail $u
>
>I thought the problem might be that there is no "-d" option to mail, as
>I have seen on other systems, but adding this option results in no mail
>bewing delivered at all. (BTW, freezing the sendmail.cf causes sendmail
>to complain "out of memory" on its next invocation. Sheeesh.)

This is a long-standing problem with the /bin/mail on various SysV boxes.
/bin/mail is adding the first From_ line and escaping the second one (which
it doesn't do right anyway - it can still allow spoofing).  /bin/mail can
also cause people to be charged for receiving mail (not reading it) because
it resets it's uid.

I finally got fed up enough to write a no-frills program to bop mail into
people's mailboxes.  It doesn't do forwarding, or aliasing, but who cares.
It was written for use with sendmail and thus doesn't try to add it's own
From_ line.  The command line is eminently simple:

	/usr/local/bin/delivermail username < mail_message

A sample sendmail.cf Mlocal definition is

Mlocal, Path=/usr/local/bin/delivermail,
	Flags= DFPSUsl,
	Sender=10,
	Recipient=11
	Argv=delivermail $u

There are no command-line flags.  Sendmail (and, I believe, MMDF as well)
provides all of the frills you could want already anyway.  Actually, it does
have one compile-time-enablable frill - I added the capability to "write" to
the user's terminal whenever they receive mail if the user-execute bit on
their tty is enabled.

We are using it on our AT&T 3b4000 (SysVr3.1.5) with no apparent problems.
It is, however, SysV-specific in that it uses lockf() instead of flock() and
putenv().  It can be anon-FTPed from jhunix.hcf.jhu.edu (128.220.2.5) in
pub/delivermail/shar.Z.  I consider it a reasonable alternative to /bin/mail
for use by sendmail.

That's my solution... throw code at the problem :-)

-Andy
--
Andy Poling                              Internet: andy at gollum.hcf.jhu.edu
UNIX Systems Programmer                  Bitnet: ANDY at JHUNIX
Homewood Academic Computing              Voice: (301)338-8096    
Johns Hopkins University                 UUCP: uunet!mimsy!aplcen!jhunix!andy



More information about the Comp.sys.att mailing list