[Mimedefang] add_recipient followed by stream_by_domain
David F. Skoll
dfs at roaringpenguin.com
Sat May 1 08:44:48 EDT 2010
> Our Mimedefang checks for the sender if his mails are handled by
> us,If yes then it adds one more address outgoing at sendersdomain as a
> recipient to archive all outgoing mails.
> Now if this domain is sending mails to say 3 different domains,it
> would send 3 copies of same message to outgoing at sendersdomain.
> I read somewhere in this list that we can modify @Recipients to
> include added recipients and I tested out that stream_by_domain
> doesnt discard it.
Pushing a recipient onto @Recipients will work *only* if stream_by_domain
actually does stream the message. If the original message comes in
for only one domain, then adding a recipient to @Recipients will not work.
What you are trying to achieve is tricky. At filter_begin time, you have
to check if the original message has already been streamed. If it has,
then do nothing. If it has not, then you should call add_recipient *and*
push the recipient onto @Recipients and call stream_by_domain. Doing both
ensures that the recipient is added whether or not stream_by_domain actually
streams the message.
You can check the $WasResent global variable to determine whether or
not a message has been streamed. (But it's a hack.)
More information about the MIMEDefang