Ubuntu 管理心得

搜尋此網誌

2018年8月29日 星期三

setup gmail relay

cf: https://www.howtoforge.com/tutorial/configure-postfix-to-use-gmail-as-a-mail-relay/#debian-ubuntu
  1. edit /etc/postfix/sasl_passwd, add this line
    [smtp.gmail.com]:587 username@gmail.com:password 
  2. chmod 0400 /etc/postfix/sasl_passwd, 
  3. vi /etc/postfix/main.cf, add these lines:
    #relayhost = (uncomment this line)
    # chiao
    relayhost = [smtp.gmail.com]:587
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
    smtp_sasl_security_options =
    smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
    smtp_use_tls = yes 
  4. postmap /etc/postfix/sasl_passwd 
  5. service postfix restart

網誌存檔