Re: connecting directly to external smarthost
<quote who="Hanspeter Roth" on Mon, Sep 05, 2005 at 05:29:25PM EDT>
>
> for certain recipients I'd like to connect directly to some
> smarthost instead of to the MTA on the localhost.
> I guess I can use the `sendmail' variable to call some program.
> What programs can I use to bypass the local MTA?
>
If you use postfix, you can use the transport feature. I use that with gmail
so that every mail going to an @gmail.com address gets sent through gmail
using Postfix as the SMTP client and the transmission is secured using TLS.
What's cool with Gmail that I dont find with my other accounts, is the
message is stored in my Sent Mail mailbox automagically on Gmail using the
web interface. Doesnt exactly bypass the local MTA, but it works great on my
local machine. Here's how I have it setup:
<file:///etc/postfix/main.cf>
smtp_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtp_tls_CApath = /etc/ssl/certs
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_sasl_mechanism_filter = plain, login
disable_dns_lookups = yes
transport_maps = hash:/etc/postfix/transport
<file:///etc/postfix/sasl_passwd>
[smtp.gmail.com] myname@xxxxxxxxx:mypassword
<file:///etc/postfix/transport>
gmail.com smtp:[smtp.gmail.com]
Get the ssl cert for smtp.gmail.com. I have it installed under
/etc/ssl/certs/, but you can put it whereever you want. Afterwards run
`postmap /etc/postfix/sasl_passwd` and `postmap /etc/postfix/transport`.
Reload postfix and and test. There's a great how-to on the web that shows
step by step how to do this. If I come across it again, I'll post the link.
Seth