Rolf E. Sonneveld:
> Hi, all,
> 
> running Postfix 2.8.6 in combination with MIMEdefang (MD) 2.72.
> 
> What I want to achieve is the following: the combination Postfix + MD 
> should provide per-user anti-spam functionality. In itself this is not a 
> big problem, but the real problem here is: how to do this for messages 
> which has multiple recipients? (with that I mean: a single SMTP session 
> with multiple RCPT TO addresses). For example: one recipient would like 
> to quarantine a particular message, while another recipient of the same 
> message would like to get it delivered.

To implement per-user filters RELIABLY, you need to make per-recipient
modifications AFTER the mail is queued.

    postfix -> transport map -> per-recipient filter -> postfix

Here, each recipient is delivered in its own mail transaction;
if one recipient's mail transaction fails, then it will not affect
the other recipient's mail transactions.

> To achieve this I'm experimenting with the MD stream_by_recipient() 
> function. This means: the MD milter during the first run splits up a 
> multi-recipient message into separate single-recipient messages and 
> reinjects them via the sendmail command as a local SMTP submission, 
> which triggers the MD milter again, but the second time it's applied per 
> single-recipient message. This doesn't solve all problems, but it is 
> know to work well, with a regular Sendmail installation.

This is not reliable. If one recipient mail transaction fails (no
disk space or whatever) then you must report a tempfail error to
the remote SMTP client. Later, the SMTP client will send the whole
message again, WITH THE THE SAME RECIPIENTS AS BEFORE. In other
words, if one recipient transaction fails, other recipients will
receive an extra copy of the message.

        Wietse

Reply via email to