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: Patric Falinder <patric.falinder_at_nospam>
Date: Mon Oct 18 2010 - 13:03:25 GMT
To: postfix-users@postfix.org

Ralf Hildebrandt skrev 2010-10-18 14:43:
> * Patric Falinder<patric.falinder@omg.nu>:
>> Hi,
>>
>> I'm not really sure if this has to do with Postifx so just tell me if
>> I'm wrong.
>>
>> Is it possible to resend emails that are in a Maildir already?
>
> Yes.
>
> #!/bin/sh
>
> #
> # verschickt die gesamte Mail eines Benutzers an $1
> #
> USAGE="usage: $0 user@domain"
>
> if test $# != 1
> then
> echo $USAGE
> exit 1
> fi
>
> if ! grep @<<STOP> /dev/null
> $1
> STOP
> then
> echo $USAGE
> echo No @ in Mail-address
> exit 1
> fi
>
> if ! test -d new -a -d cur -a tmp
> then
> echo You are not in Maildir
> echo there is no new cur tmp
> exit 1
> fi
>
>
> find cur new tmp -type f | xargs --replace /usr/local/scripts/send_mail $1 {}
>
>
> ----
> /usr/local/scripts/send_mail
> ----
> #!/bin/sh
> /usr/local/sbin/mini_sendmail -syour.mail.host -p25 -fnobody@charite.de $1< $2&& rm -f $2
>
Thanks a lot, will try that! :)

-Patric