OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: Resend emails from a Maildir

From: mouss (moussml.netoyen.net)
Date: Wed Oct 20 2010 - 16:16:51 CDT


  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{joeexample.com} );
> args = qw(sendmail -i);
> push(args, "-f", "$envsender");
> push(args, "--", rcpts);
> system { $prog } args;
> if (($code = $?) ne 0) {
> # handle errors
> }
>