postfix-users October 2010 archive
Main Archive Page > Month Archives  > postfix-users archives
postfix-users: Re: Resend emails from a Maildir

Re: Resend emails from a Maildir

From: mouss <mouss_at_nospam>
Date: Wed Oct 20 2010 - 21:16:51 GMT
To: postfix-users@postfix.org

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