Re: Lee: Re: smail Solution for Dynamic IP's
dtm12@jhunix.hcf.jhu.edu (Daniel Martin at cush) writes:
> However, if smail is handed a from address (either by the SMTP "MAIL
> FROM:" command or by the "-f" or "-r" option to the senmail command),
> smail will use that address. Therefore it may be perfectly possible
> to convince your MUA to hand smail a from address.
Here's an idea then.
First, move the official sendmail out of the way:
# dpkg-divert /usr/sbin/sendmail
Then put a new sendmail in its place (this is a very brain dead
example):
-----
#!/usr/bin/perl -w
use strict;
if ((grep {$_ == '-f'} @ARGV) || (!exists($ENV{RETURNPATH}))) {
exec '/usr/sbin/sendmail.distrib', @ARGV;
} else {
exec '/usr/sbin/sendmail.distrib', '-f', $ENV{RETURNPATH}, @ARGV;
}
die "sendmail: couldn't exec /usr/sbin/sendmail.distrib: $!\n";
-----
Now set RETURNPATH in your environment and smail's sendmail will get
called with "-f $RETURNPATH" unless there's already a "-f" in the
command line. (It could have been an sh script, but I don't know how
to look in "$@" for "-f" in bash.) It could be rewritten in C.
This is all completely untested, of course.
--
Carey Evans http://home.clear.net.nz/pages/c.evans/
GNU GPL: "The Source will be with you... always."
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to: