My Requirements
I have two email servers, james and winmail. They hold same users, for example, account [email protected]
exists both in james and winmail.
When someone sends a email to [email protected]
, I expect that both james and winmail receive that email, and the eml content should be exactly the same.
My Attempts
I tried to configure two MX in DNS. But it can only map example.com
to james or winmail, not both.
So I try postfix, which means example.com
resolved to postfix server, and when postfix receives the email, it should forward this email to james and winmail without saving it to local storage.
However, /etc/postfix/transport
only supports map example.com
to one server too.
My current solution is to define a pipe using python script to send mail to both server via smtplib
multi_forward unix - n n - - pipe
flags=Rhu user=nobody argv=/usr/local/bin/multi_forward.py ${sender} ${recipient}
I think this approach is not so reliable, because multi_forward.py
is just a very simple script. I wonder whether postfix has other approach to do this. Any recommendations?