■以下の手順で行ってみる。
# vi /etc/postfix/sasl_passwd
———————sasl_passwd—————————————————————————————
[smtp.gmail.com]:587 xxxxxxx@gmail.com:password
——————————————————————————————————————————————-
# vi main.cf
———————————main.cf——————————————————————————————----------------------------------------------
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = raspberrypi
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, raspberrypi, localhost.localdomain, , localhost
#relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
# Posifix Configuratoins
relayhost = smtp.gmail.com:587
# SASL Authentication
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_mechanism_filter = plain
# TLS Settings
smtp_use_tls = yes
smtp_tls_security_level = encrypt
tls_random_source = dev:/dev/urandom
—————————————————————————————————————————————————-----------------------------------------------
■sasl_passwdを設定する
sudo chmod 400 /etc/postfix/sasl_passwd
sudo postmap /etc/postfix/sasl_passwd
■smtp.gmail.comのルート認証局(Root CA)をダウンロードして配置する
wget https://www.thawte.com/roots/thawte_Premium_Server_CA.pem
■Gmail アカウントへのアクセスとセキュリティ設定の管理のページに行く。
->接続済みのアプリとサイト - 安全性の低いアプリの許可: 有効にする。
0 件のコメント:
コメントを投稿