View Single Post
  #1   (View Single Post)  
Old 7th August 2011
backrow backrow is offline
Real Name: Anthony J. Bentley
Shell Scout
 
Join Date: Jul 2009
Location: Albuquerque, NM
Posts: 136
Default OpenSMTPD as a GMail relay

I have successfully set up smtpd to relay to GMail in the past, but for some reason it doesn’t work on this new install. This is on a 5.0 snapshot from August 3.

I followed smtpd(8) and smtpd.conf(5) to the letter:
  • /etc/mailer.conf:
    Code:
    sendmail	/usr/sbin/smtpctl
    send-mail	/usr/sbin/smtpctl
    mailq		/usr/sbin/smtpctl
    makemap		/usr/libexec/smtpd/makemap
    newaliases	/usr/libexec/smtpd/makemap
  • ran newaliases
  • Code:
    $ ls -l /etc/mail/secrets
    -rw-r-----  1 root  _smtpd  59 Aug  4 21:36 /etc/mail/secrets
    $ sudo cat /etc/mail/secrets  
    smtp.gmail.com  anthonyjbentley@gmail.com:password
    $ sudo makemap /etc/mail/secrets
    $ ls -l /etc/mail/secrets.db
    -rw-r-----  1 root  _smtpd  65536 Aug  7 11:14 /etc/mail/secrets.db
  • /etc/mail/smtpd.conf:
    Code:
    listen on lo0
    map aliases { source db "/etc/mail/aliases.db" }
    map secrets { source db "/etc/mail/secrets.db" }
    accept for local deliver to mbox
    accept for all relay via smtp.gmail.com tls auth "secrets"
  • /var/log/maillog:
    Code:
    Aug  7 11:25:41 pinetree smtpd[30795]: startup
    Aug  7 11:26:44 pinetree smtpd[18881]: c78ba518: from=<anthony@pinetree.gateway.
    2wire.net>, size=497, nrcpts=1, proto=ESMTP, relay=1000@localhost [IPv6:::1]
    Aug  7 11:29:21 pinetree smtpd[18881]: 82f032ec: from=<anthony@pinetree.gateway.
    2wire.net>, size=419, nrcpts=1, proto=ESMTP, relay=1000@localhost [IPv6:::1]
    Aug  7 11:29:21 pinetree smtpd[12503]: 82f032ec33204ac1: to=<root@pinetree.gatew
    ay.2wire.net>, delay=0, stat=Sent
The above maillog is from two messages sent, the first to myself@gmail and the second to root. The mail to root arrived and I read it with mail(1), so local delivery works. But remote delivery doesn’t seem to:
Code:
# smtpctl show queue
MTA|c78ba518021c1668|ENQUEUED|anthony@pinetree.gateway.2wire.net|anthonyjbentley@gmail.com|1312738004|345600|1|110 connect error: No route to host
Could this be a network issue instead of a configuration issue?

I’m getting really tired of using Gmail’s webmail…

Google’s page on configuring mail clients
__________________
Many thanks to the forum regulars who put time and effort into helping others solve their problems.
Reply With Quote