0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Google アカウントを送信アドレスにしてアプリパスワードを活用して VirtualBox CentOS8 サーバからメールを送る

Last updated at Posted at 2020-05-09
# dnf install mailx

テストメール送信

# mail <email_address>
Subject: test
test
.
# tail -f /var/log/maillog

Connection timeout...

メール転送設定

設定ファイル

/etc/postfix/sasl_passwd
[smtp.gmail.com]:587 <googleアカウントのメールアドレス>:16桁のアプリパスワード
# postmap /etc/postfix/sasl_passwd

設定ファイル

/etc/postfix/main.cf
relayhost = [smtp.gmail.com]:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_tls_security_options = noanonymous
smtp_sasl_mechanism_filter = plain
# systemctl restart postfix

firewalld の設定

# firewall-cmd --list-services --permanet
cockpit dhcpv6-client ssh
# firewall-cmd --add-service=smtp --permanent
Success
# firewall-cmd --add-service=smtps --permanent
Success
# firewall-cmd --list-services --permanet
cockpit dhcpv6-client smtp smtps ssh

テストメール送信

# mail <email_address>
Subject: test
test
.

キューの確認

# postqueue -p

(参考)キューの削除

# postsuper -d ALL deferred
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?