Setting up External MTA IPs with HTTP proxy (using tinyproxy)
The External MTA IPs feature lets MailerQ use IP addresses available on a remote host for sending emails, as if they are available on the MailerQ host. This feature is useful when for example you are running MailerQ in a container, and the public IP addresses used for sending are on a different host. It can also be used to move traffic from one on premises MTA to another, without moving the IP addresses to the new host right away.
In this tutorial, we will focus on the HTTP proxy mechanism. This simple mechanism is useful in a case when your sending IPs are on a different host than your MTA and you can't or don't want to move the IP addresses to the MailerQ host. It also allows your users to bring their own IPs in an easy way.
For this tutorial, we have chosen tinyproxy as the HTTP proxy server, because it's simple, lightweight and easy to use.
Step-by-step instructions:
1. Install tinyproxy on a remote machine that has the public IP address(es).
Ubuntu/Debian:
apt-get install tinyproxy
RHEL7 / CentOS7
yum install epel-release
yum install tinyproxy
2. Configure /etc/tinyproxy/tinyproxy.conf, set:
Port <proxy listening port>
ConnectPort 25
BindSame yes
Allow <internal IP range, i.e 10.0.0.0/24>
3. Restart tinyproxy service
systemctl restart tinyproxy
4. Configure External MTA IP in MailerQ via the Management Console or REST API:
Protocol: HTTP
Public IP: <public IP>
Local IP: <local IP>
NAT IP: <public IP>
NAT port: <proxy listening port>
5. Send test message over the external MTA IP
That's it, you should now be able to use the external MTA IPs for sending, just as if they're on the same host as MailerQ.