I'm working for a company that will be renting smtp server capacity similarly to MySMTP. Our end users use a 3rd party email marketing frontend application configured with the details of our SMTP gateway to send emails. These frontend applications do not support custom HTTP APIs and only work over direct SMTP protocol.
As always with email related services, spam and abuse are very real concerns for us. Therefore we will need some processor component for filtering out suspicious content, checking user credits and sending the received mails through multiple different SMTP servers to provide faster processing for multiple users and hopefully avoiding problems related to excessive volume with ISPs.
So my question is, how can I receive emails to a PHP or Java preprocessor program via SMTP protocol and then send/forward it through another SMTP server?
A few minutes of search provided me with http://emailrelay.sourceforge.net/. This seems like the thing I'm looking for, except it has a couple of problems:
- It looks like it can only be statically configured to forward to a single smtp server.
- I would like to leverage a more "powerful" filtering method than javascript. For example, PHP or Java. The filters need to be configured dynamically from administrator panel (accessible from cloud) due to changes in spam patterns.
- It's likely that the system will have it's own frontend service sometime in the future, which would need to be able to communicate with this processor component.
TL;DR
How can I get a preprocessor program to intercept SMTP requests before any email is sent by the SMTP server and then forward it trough another SMTP server?