procmail
[Top] [All Lists]

Re: Altering "From " line When Bouncing Messages

1998-03-08 09:04:25
David Hunt <dh(_at_)west(_dot_)net> writes:
...
These recipes begin "|formail -r" or "-rk", which doesn't generate a 
'From ' line. That would require breaking the recipes apart and building a
'From ' line, and inserting it ahead of the header. The shortest route to
that end that I can think of is capture the formail output into a var,
then use a recipe after that, that echos a 'From ' line, then echos the
var, output to sendmail. That's not as pretty as slipping in a sed

All the versions of sendmail that I know of *ignore* the address in the
"From " line when receiving a message (the date is stored in the 'a'
macro).  The "From " line is generated at the final delivery point
using the envelope sender address.  So the real question is, how do you
change sendmail's idea of who the envelope sender is?  Answer: using
the -f flag, i.e.,

        .... | $SENDMAIL $SENDMAILFLAGS -f'<guenther(_at_)gac(_dot_)edu>' -t

The address given to the -f flag should be _just_ the actual address:
no parts in parens, nothing outside of the angle brackets (if you
include angle brackets).

HOWEVER: like all addresses that go through sendmail, it will be
processed by sendmail's rewriting engine.  If the problem is just a
matter of fully qualified vs not-fully qualified address, then setting
it with -f _might_ work.  Then again, the rewriting engine may decide
to change it to the incorrect form.

As a final note, I'll quote part of the sendmail 8.7 RELEASE_NOTES entry:

        When sendmail starts up on systems that have no fully qualified
                domain name (FQDN) anywhere in the first matching host map
                (e.g., /etc/hosts if the hosts service searches "files dns"),
                sendmail would sleep to try to find a FQDN, which it really
                really needs.  This has been changed to fall through to the
                next map type if it can't find a FQDN -- i.e., if the hosts
                file doesn't have a FQDN, it will try dns even though the
                short name was found in /etc/hosts.  This is probably a crock,
                but many people have hosts files without FQDNs.  Remember:
                domain names are your friends.
        Log a high-priority message if you can't find your FQDN during startup.
                Suggested by Simon Barnes of Schlumberger Limited.

If your machine is running 8.7 or later, and it's logging that message,
then your setup is *broken*.  Either change the hostname of the machine
to its FQDN, or put the FQDN in the sendmail.cf (look for Dj).  Of
course, if you're running a version before 8.8.5, then there's almost
certainly a security hole in it.

Philip Guenther