procmail
[Top] [All Lists]

Re: Bouncing messages and unwanted headers

1999-09-09 21:12:04
procmail(_at_)towel(_dot_)com writes:
Does anyone have any suggestions on how to get rid of the
"X-Authentication-Warning" and "Received:" headers that show up in mail
that I'm bouncing (using procmail/sendmail)?

You have two choices: either a) get yourself added to the trusted users
list in the sendmail.cf, or b) submit the messages using some other
program that talks SMTP directly.


Here's a quick perl script that uses the Net::SMTP module from the
libnet package:

        #!/usr/local/bin/perl -w
        use Net::SMTP;
        my($smtp) = Net::SMTP->new('mailhost'); # maybe 'localhost' instead?
        $smtp                   or die;
        $smtp->mail('<>')       or die;         # Empty path for bounces
        $smtp->to(@ARGV)        or die;
        $smtp->data();
        while (<>) {
            $smtp->datasend($_);
        }
        $smtp->dataend()        or die;
        $smtp->quit;
        exit(0);

It could use better error handling (e.g., try another host if the first
hostname couldn't be opened, mention what command actually failed when
one does), but you get the idea.


Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>