To send mail from acme on native Plan 9 via gmail, this is what just
worked for me:

- make sure the last line of /mail/lib/rewrite is

([^!]*)!(.*)            |               "/mail/lib/qmail '\s' 'net!$smtp'" 
"'\2@\1'"

- change /mail/lib/remotemail to add the '-a' flag to smtp

exec /bin/upas/smtp -a -d -h $fd $addr $sender $*

- define $smtp for my local network in /lib/ndb/local

ipnet=localnet
        ip=192.168.0.0 ipmask=255.255.0.0
        smtp=smtp.gmail.com
        ntp=pool.ntp.org
        ...

- give factotum the password for my gmail account

auth/factotum -g 'proto=pass service=smtp server=smtp.gmail.com user? 
!password?'

- add a tls thumbprint for the gmail server to /sys/lib/tls/smtp

x509 sha1=9C0ACC931DE7513790616BA11828679554C569A8 server=smtp.gmail.com

(I found the hash by trying to send once, then looking in /sys/log/smtp)

- finally, after receiving a "Google Account: sign-in attempt blocked"
email from google, followed their suggestion to:

"change your settings at  
https://www.google.com/settings/security/lesssecureapps so that your  
account is no longer protected by modern security standards."

I guess upas/smtp is considered a less secure app.

BTW, when having trouble sending email it's often useful to look
in /sys/log/smtp and /sys/log/smtp.fail




Reply via email to