I have a Postfix SMTP server that sends transactional emails from a web service. These messages use VERP for the return path, so bounces go back to an address like this:
bounce-7232-useremail=userdomain.com@e.mydomain.com
This postfix server running on e.mydomain.com
is used exclusively to send email, there are no local mailboxes, POP or IMAP access, and so forth. Only systems on the local network can relay mail through it.
I then have a separate custom SMTP application that only processes bounces running on the same server (e.mydomain.com), but on a different port (8025). It drops any messages that aren't going to a properly formatted bounce address. Emails with properly formatted bounce addresses are accepted.
When a bounce is accepted, this custom application looks up the proper user in the database based on the bounce email address, and increments a bounce counter. The main web service will only send transactional email to users who's bounce count isn't over a threshold.
My questions are these:
Would it be better to set up my bounce handling SMTP (bounces.mydomain.com) server to handle bounces directly (and run on port 25)? Or is it better to have all bounces go to my postfix server, and then have postfix forward only the bounces to the bounce SMTP application?
If it is better to have postfix handle all incoming messages, how do I configure it to forward only messages formatted like the above address to another SMTP server, running on an unprivileged port (8025)?