How to switch between SMTP servers at different locations on a laptop

emailprofilesmtp

I have two ISPs at two separate locations, both with separate SMTP servers. Neither SMTP server allows relaying from the other ISP, so when taking my laptop between each location, I have to swap between smtp servers.

I currently edit the /etc/hosts file to override smtp.magichost.com with the IP addresses of the SMTP server I'm supposed to be using, but that is a pain.

Is there a better way to do this?

Best Answer

If you are using Thunderbird, you can try installing the SmtpSelect extension.

If you are trying to solve the more general problem, most (at least the ones I work with) ISPs allow you to authenticate and submit mail to the mail submission port (587). Perhaps this will work for you.

If that still doesn't work, sign up for a gmail account and use gmail's mail submission port (smtp.gmail.com:587) to send your mail out.

If you really don't want to do that, setup some sort of smart script that wakes up every n minutes, checks to see where it is, and reconfigures /etc/hosts or /etc/mail/mailertable to redirect the mail appropriately.