Friday, January 16, 2004

Relaying mail to a remote MTA with Qmail...

Up to now, I've sent email through my LAN's MTA, which uses the IP of my cable modem. Lately, it seems, there is a growing number of exchanges (such as AOL.COM) that no longer accept mail from these "dynamic" addresses. So, I needed a way to relay mail from my LAN's MTA to an alternate MTA that uses a static IP address.

To do this, I first had to add the IP address of my MTA to the remote MTA (with the static IP address) as an authorized relay. See the qmail faq for more information.

Next, I had to tell my local MTA to relay mail to the remote MTA. This is accomplished through the qmail/control/smtproutes file (see qmail-remote(8) for more information). Here is how I set it up:

localdomain.com:
:mail.remote.com


(Since I use my local MTA as a mail exchanger for localdomain.com, I added an entry here to allow messages to that domain to be delivered normally.)

All other email (mostly from my desktop) is relayed to mail.remote.com, which in turn relays it to the appropriate destination.

Now, email to addresses whose exchangers had previously denied my email is accepted.

No comments: