Simple SMTP forwarder?

Does anyone have experience with any published docker container that can have just a destination email address provided via ENV, and it will open up an SMTP port to forward everything it receives?

Thinking of a solution for civic tech projects with their own domains. Instead of the old gsuite setup, we could run this container in their namespace, point their MX at it, and have it just dump into a maintainers mailbox or a dedicated one the project sets up somewhere

I know we could also just run postfix at the cluster level and maintain a list of forwarding rules, but having each one self contained with project-scoped logs seems nice too

I don’t know of any already published solutions, but I think that a light init script wrapper that dynamically writes that one piece of the postfix config (the dest email address) at runtime before exec’ing postfix itself would be a reasonably small-ish effort solution, particularly if you already have a postfix configuration sitting around somewhere that does this in non-containerized environments.

1 Like