I am looking for a way to check outgoing mails with rules like :
- mails sent to a particular domain
- mails sent without subject or with a specific subject
- mails with an attachment of a certain size
- mails sent to x recipients
What I want to do when a mail is recognised by one of these rules could be to send it to a special address, to save it with smtp-sink or return a special message.
Is this possible to do this check and apply an action within postfix or a couple of scripts called by postfix ?

