Starting with the following basic configuration to relay all messages in Postfix to PostMarkApp.com:
#start postmarkapps settings smtp_sasl_auth_enable = yes smtp_sasl_password_maps = static:secret:secret (where "secret is your API key") smtp_sasl_security_options = noanonymous relayhost = [smtp.postmarkapp.com]:25 #end postmarkapp settings
The problem with this is if for example something starts spitting out error messages they will all go through PostMark and cost money.
One way to bypass
relayhost is to setup
sender_dependent_relayhost_maps and have certain addresses map back to yourdomain.com. But this doesn't work in web apps where all messages are sent by the same user but with varying From headers.
So how can I achieve the same effect as
sender_dependent_relayhost_maps but looking at the From or Subject headers instead of merely the user?