Michael Neurohr:
> Although it's not a Postfix problem, I'd like to share the solution just
> for completeness in the hope it might be useful.
>
> Instead of setting sender and recipient as parameters, one should
> forward it as arguments.
>
> The whole thing now looks as follows:
>
> The filter definition in Postfix' master.cf:
> =====================================================================
> procmail unix - n n - 10 pipe
> flags=Rq user=vmail null_sender= argv=/usr/bin/procmail -m
> /etc/procmailrc ${sender} ${recipient} ${domain}
...
> ER_DOMAIN=$3
> SENDMAILFLAGS="-i -f $E_SENDER $E_RECIPIENT"
WARNING: THIS WILL LOSE MAIL when the message has more than one recipient.
You must specify "procmail_destination_recipient_limit=1" in main.cf.
Wietse
Quote 1 from pipe(8) manpage:
SINGLE-RECIPIENT DELIVERY
Some destinations cannot handle more than one recipient per delivery
request. Examples are pagers or fax machines. In addition, multi-
recipient delivery is undesirable when prepending a Delivered-to: or X-
Original-To: message header.
To prevent Postfix from sending multiple recipients per delivery
request, specify
transport_destination_recipient_limit = 1
in the Postfix main.cf file, where transport is the name in the first
column of the Postfix master.cf entry for the pipe-based delivery
transport.
Quote 2 from the pipe(8) manpage:
${recipient}
This macro expands to the complete recipient address.
A command-line argument that contains ${recipient}
expands to as many command-line arguments as there are
recipients.
Presumably, this also applies to the ${domain} expansion.