Le 19/10/2010 21:22, Victor Duchovni a écrit :
On Mon, Oct 18, 2010 at 11:37:18PM +0200, mouss wrote:
- get the MAIL FROM address from the "Return-Path" header. with this you
can do: sendmail -f $returnpath yourdestinationemail
Make that:
sendmail -i -f "$returnpath" -- "$destpath"< msgfile
The returnpath can have all kinds of interesting characters.
indeed.
If using
Perl, it is highly advisable to entirely bypass shell argument parsing:
$prog = "/usr/sbin/sendmail";
@rcpts = ( q{...@example.com} );
@args = qw(sendmail -i);
push(@args, "-f", "$envsender");
push(@args, "--", @rcpts);
system { $prog } @args;
if (($code = $?) ne 0) {
# handle errors
}