On 2/23/15 2:08 AM, Wietse Venema wrote: > Wietse: >> Milters must see the entire SMTP session, not just the RCPT TO >> command. >> >> If you want different Milters for different domains, configure >> different smtpd services in master.cf, each listening on a different >> IP address, one with milter and one without. Then point each >> domain's MX records to the appropriate IP address. > Kirill Peskov: >> Ouch! Sounds not really as 'elegant' solution... Thank you for the quick >> response, anyway. > There is nothing inelegant about using two IP addresses, but I > suppose you don't have that. > >> Is there any way to pass the message through content filter (which >> can potentially amend the content of the message or even bounce >> it if the message does not fit certain criteria) JUST before passing >> it to the lmtp (dovecot in my case) for the final delivery to the >> recipient's mailbox? > There is no content filter interface "in front of Postfix delivery > agents. There is the after-queue filter as described in > http://www.postfix.org/FILTER_README.html. I'm already reading exactly this document, seems to be much better place to 'plug in' my code, but the question is if after-queue messages are already 'multiplied' as one copy per each recipient, because filter reaction should be recipient-dependent. In other words, if john_doe@some-external.domain sends the message to bob@my.domain and alice@my.domain putting both addresses in To: and/or Cc: fields, users can have individual settings and the very same message should pass through for Bob, but be bounced from Alice.
Cheers, Kirill