Monday, January 18, 2010

 

NetBSD postfix to gmail relay

Over the weekend I decided to configure my NetBSD system to stop sending emails to the local mbox (where I never read them) and start sending emails correctly to the internet. I also wanted to do so using my gmail account. Most of my info came from here but it's a little verbose for my tastes. Basically I had to do the following:


Now test with mailx someone@something.com and watch the maillog. I do get a warning about not liking the thawt cert, so I may figure out how to import it, but other tutorials all talked about needing your own CA and other insanity. I would hope the MUST in tls_policy insured that I was using SSL. I'll tcpdump and see sometime, but for now this seems to be all that's needed.

(Can we get SASL in base? I know LDAP, kerberos, and NFSv4 would appreciate it)

UPDATE!
To fix the ssl cert warning, add the following package:
mozilla-rootcerts
then
cd /etc/openssl/certs
mozilla-rootcerts extract
mozilla-rootcerts rehash

And add the following to your main.cf:
smtp_tls_CApath = /etc/openssl/certs

Labels:


Comments:
Thank you for posting this, I had a similar setup on my slackware linux box forever, and couldn't figure out why authentication mechanisms weren't working until I saw your post. The mechanisms are within cyrus-sasl standard and I didn't realize pkgsrc segregates them out.

you should enable sender_dependent_relayhost_maps as well, it allows you to define relay_hosts by the sender email address.

main.cf:

sender_dependent_relayhost_maps = hash:/usr/pkg/etc/postfix/sender_relay
smtp_sender_dependent_authentication = yes

sender_relay:
example@submission.com [smtp.submission.host.com]:587
example@smtp.com [smtp.smtp.host.com]
 
Post a Comment





<< Home