On 07/09/2012 05:47 PM, Thomas Spycher wrote:
Hi,
if Postfix receives an mail with multiple recipients (eg. to, cc and bcc). This
mail gets processes as one single mail by postfix.
Only on reception; when it is queued, the message is duplicated as many
times as necessary to address all next-hop destinations.
How could it get accomplished to change the content of the mail for each
recipient in an different way?
The MTA is really the wrong place to manipulate message content - but
it's ultimately up to you.
Currently i've done this in an content filter. The Content filter gets the mail
and does its stuff for each recipient and then requeues it again for each
recipient.
Sounds like you've solved it, then.
I would like to know, if there is an different way? An more postfix-like way?
Since you're *changing the message for each recipient*, they must be
split up into separate messages.
It doesn't really matter how you do that.
I would probably opt to make it a fully controllable process by first
queueing and re-injecting it into a second listener or postfix instance
by utilizing ${second-smtpd}_recipient_limit = 1
This forces all multi-recipient mail to be split up before it reaches
your content filter, thus simplifying the overall design.
--
J.