LoginSignup
6
3

More than 5 years have passed since last update.

自宅のラズパイからメール送信する(NURO光)

Last updated at Posted at 2018-06-02

表題の通り。

前提

  • プロバイダはNURO光(G2V マンションミニ)
  • OS: CentOS 7
  • メールクライアント: Postfix
  • OP25B対策がなされているので 必要な設定を行う

手順

1.main.cfの設定
# vim /etc/postfix/main.cf

下記の内容を追記/編集する
mydomain = (取得しているドメイン)
relayhost = [mail.so-net.ne.jp]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/relay_password
smtp_sasl_security_options = noanonymous

replayhost で指定するリレーホストはSo-netのものに、サブミッションポート(587番)を利用していることに注意

2.SMTP-AUTHの設定
# yum install cyrus-sasl-plain
# touch /etc/postfix/relay_password
# vim /etc/postfix/relay_password
/etc/postfix/relay_password
[mail.so-net.ne.jp]:587    [ユーザ名]:[パスワード]
# ユーザ名、パスワードは申し込み後に到着するハガキに書いてある!
3.relay_password.dbの設定、再起動
# chmod 600 /etc/postfix/relay_password ※パスワードが記載されてるのでパーミッション変えておく
# postmap /etc/postfix/relay_password
# systemctl restart postfix.service
# systemctl enable postfix.service
4.テスト送信
$ mail hoge@sample.com
Subject: hoge

hogehoge
.
EOT

無事に送信成功。
キャプチャ.PNG

SPFレコードは各自で対応してください。私はMyDNS使ってます。
自宅の動的IPアドレスではなく 以下のアドレスになる様子。
202.238.84.151(ms-somxout01.so-net.ne.jp)
202.238.84.152(ms-somxout02.so-net.ne.jp)

以上

6
3
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
6
3