I gave up on this method, and will wait for Varien to implement it someday.
My workaround for now is to use msmtp, which supports multiple smtp relay accounts. This is useful for me, since I host virtual domains in apache, and each domain needs access to its own external mail server. I like rollernet.us as a mail provider, and they require full smtpauth and tls/ssl.
Let me plug http://rollernet.us again—they’re awesome! (I’m in no way affiliated with them—just a customer. I like to send my clients to them for mail hosting, since they have awesome anti-spam capabilities.)
msmtp is really well documented, and you’ll learn a lot about mail: http://msmtp.sourceforge.net
With msmtp you can setup multiple accounts, and then call the account from the command line. This is where the php setting, sendmail_path, comes in handy. You can actually set sendmail_path in your apache vhost definition for the particular domain.
Here’s the php value within my vhost section of httpd.conf:
php_admin_value sendmail_path "/usr/sbin/sendmail -a vhost1 -t "
And the /etc/msmtprc setup:
# default setup
# account 0
# Set a default account
account default : vhost0
# this next line is to set EHLO strictly
# tls trust file for vhost1.mailserver
The big flaw in this architecture—or using an external mail server directly if Magento ever supports it with smtpauth and ssl/tls—is the potential for lost outbound mail. Let’s just say your external mail server becomes unreachable for some reason, and during that time, a shopper on your site requests a new account password, or he places an order, or whatever. That outbound email will fail, and will be lost. Magento does no mail queuing, nor does msmtp, nor does ssmtp, etc.
The solutions are:
1) Install a local MTA (postfix, qmail, etc) which can store and forward to your relay;
2) Convince Varien to build mail queuing into Magento. The queue could be scanned by cron every minute, and mail sent.
And now for something completely off-topic:
The next big topic is spam, rather, anti-spam measures implemented by your customers and their ISPs. You really, really need to make sure you have all of your t’s crossed and your i’s dotted, so that outbound mail conforms to every possible smtp standard, so your sent messages don’t get flagged as spam. This is a big topic, beyond the scope of this thread.