|
|
SMTP Relaying Via a SmarthostThis page describes how to set up exim 4 on both a laptop and a server so that you can relay mail via the server no matter where your laptop logs in from.OverviewLaptops are portable and end up being connected to various networks from day to day. You might connect it at the office, at home, at a friend's house, at conferences, at random coffee houses.... For most configuration settings, you can rely on DHCP, but an exception is mail relaying. Because SMTP doesn't do anything about spam, many sites do not accept mail that is relayed from untrusted networks. Untrusted networks include those of a lot of ISP's such as Comcast and BellSouth, which is irritating. Untrusted networks include those of random coffee houses, which--let's be honest--is unavoidable. For practical purposes, you can't use direct SMTP if you log into a large variety of networks. The strategy I use is to have a relay out on a host that is considered to be on a trusted network by the major spam lists. The relay server requires authentication from the client, so that the client can safely connect to the relay server no matter what kind of network connection is available. The relay server can then send mail to its ultimate destination using direct SMTP as normal. Since its network is not on the spam lists, the email goes through reliably. As an extra complication, I set the laptop-to-relay connection to
avoid the standard ports 25 and 465. Many local networks, including
BellSouth/DSL, block connections to standard ports completely. It's
evil, it's aggravating, it's understandable, there has to be a better
way, etc., but again, that's how things are, and so that's what a
practical configuration has to deal with. It turns out that
There are alternative approaches you may also want to consider:
Exim Configuration FilesExim on Debian is configured in a confusing way. You can install
it to use "split" or "unsplit" configuration files, and in either
case, the configuration files you see are not the ones that exim
itself sees. I use the unsplit version, and I edit
As an aside, this situation strikes me as more complicated than is
helpful. I found myself wishing there was a way to create and use a
single Configuring the Relay ServerFirst the relay server needs to be set up. As you go along, you will want a way to test how the server is working. I found this short page helpful: Testing SMTP AUTH connectionsThe suggestion on that page regarding the -starttls
option of openssl did not work for me, but after some
Googling, I found a
proposed patch for openssl that appears to fix the
problem. So, by the time you read this, even that might work.
Start by installing the Run Turn on plain-text authentication by uncommenting the
You also need to set up a couple of other things. Put the following
settings near the top of your MAIN_TLS_ENABLE=1 daemon_smtp_ports=smtp : 26 That should be it. Your exim server on the relay machine should now:
Configuring the ClientNext, set up the client to send all outgoing mail via the relay
host. Install ### CONFDIR/passwd.client # # Format: #targetmailserver.example:login:password # # default entry: ### *:bar:foo *:USERNAME:PASSWORD Finally, hack your
That should be it. Now mail sent locally will get relayed via port 26 on your relay host. |