LoginSignup
1
0

More than 1 year has passed since last update.

raspberry piでSMTPリレーサーバーを立ち上げた時の備忘録

Posted at

postfixのインストール

csudo apt install -y postfix libsasl2-2 libsasl2-modules bsd-mailx

main.cfの編集

main.cfを開く

sudo nano /etc/postfix/main.cf

mynetworks= にメールの送信元になる機器のIPアドレスを記述する。

mynetworks =127.0.0.0/8, <IPアドレス>, <IPアドレス>・・・

SMTPリレーサーバーの設定を追記

#mail Settings
relayhost = <SMTPサーバーアドレス>:<ポート>
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_mechanism_filter = plain
smtp_use_tls = yes

パスワードファイルの作成

sudo nano /etc/postfix/passwd

記述

<SMTPサーバーアドレス>:<ポート> <ログインID>:<パスワード>

ハッシュ化

sudo postmap /etc/postfix/passwd

削除

sudo rm /etc/postfix/passwd

再起動

sudo postfix reload
1
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
1
0