flashmob / go-guerrilla

Mini SMTP server written in golang
MIT License
2.76k stars 361 forks source link

SMTP Proxy #107

Closed bir closed 6 years ago

bir commented 6 years ago

I'm looking at leveraging go-guerrilla as an SMTP Proxy. Specifically, an email comes in, we look the address up in an internal database (PG) and then forward to a new address. Raw performance is not a concern, so running a store and forward could work as well. At first glance, it does not appear that go-guerrilla has a backend processor that supports this directly. Would the best solution be to use the DB backend then have a poll that picks off the emails and forwards, rather than trying to introduce the processor with the SMTP flow?

flashmob commented 6 years ago

Not sure about that one. Perhaps you could store the emails first, then develop another program that queues them for forwarding. Also, small backend could be developed that checks if the recipient address mapping exists, before the email gets saved. When saving, you could also rewrite the headers there, so saved emails would be ready to be queued.

Another idea could be, if you may want to save some dev time and not worried about performance, then Postfix could be an alternative, something like this: https://workaround.org/ispmail/jessie/postfix-mysql