This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
vps:vps4th2nd_07 [2019/06/29 13:34] hoge@hoge [/etc/mail/aliases.db 設定] |
vps:vps4th2nd_07 [2019/06/29 14:42] hoge@hoge |
||
---|---|---|---|
Line 16: | Line 16: | ||
=== /etc/mail/mailer.conf 設定 === | === /etc/mail/mailer.conf 設定 === | ||
導入した ssmtp を指定する。 | 導入した ssmtp を指定する。 | ||
+ | <code> | ||
#sendmail /usr/libexec/sendmail/sendmail | #sendmail /usr/libexec/sendmail/sendmail | ||
- | #send-mail /usr/libexec/sendmail/sendmail | ||
#mailq /usr/libexec/sendmail/sendmail | #mailq /usr/libexec/sendmail/sendmail | ||
#newaliases /usr/libexec/sendmail/sendmail | #newaliases /usr/libexec/sendmail/sendmail | ||
- | #hoststat /usr/libexec/sendmail/sendmail | + | hoststat /usr/libexec/sendmail/sendmail |
- | #purgestat /usr/libexec/sendmail/sendmail | + | purgestat /usr/libexec/sendmail/sendmail |
sendmail /usr/local/sbin/ssmtp | sendmail /usr/local/sbin/ssmtp | ||
- | send-mail /usr/local/sbin/ssmtp | ||
mailq /usr/local/sbin/ssmtp | mailq /usr/local/sbin/ssmtp | ||
newaliases /usr/local/sbin/ssmtp | newaliases /usr/local/sbin/ssmtp | ||
- | hoststat /usr/local/sbin/true | + | </code> |
- | purgestat /usr/local/sbin/ture | + | |
=== /usr/local/etc/ssmtp/revaliases 設定 === | === /usr/local/etc/ssmtp/revaliases 設定 === | ||
Line 44: | Line 42: | ||
FromLineOverride=YES | FromLineOverride=YES | ||
UseTLS=YES | UseTLS=YES | ||
+ | UseSTARTTLS=YES | ||
AuthUser=<転送先メールアドレス> | AuthUser=<転送先メールアドレス> | ||
AuthPass=<パスワード> | AuthPass=<パスワード> | ||
Line 50: | Line 49: | ||
==== /etc/rc.conf 設定==== | ==== /etc/rc.conf 設定==== | ||
- | fw, web, desktopからメールを受け取るため、rc.confにdaemon起動の設定を追加する。 | + | 標準の sendmail を完全に無効化する。 |
<code> | <code> | ||
- | sendmail_enable="YES" | + | sendmail_enable="NO" |
- | sendmail_procname="/usr/local/sbin/ssmtp" | + | sendmail_submit_enable="NO" |
+ | sendmail_outbound_enable="NO" | ||
+ | sendmail_msp_queue_enable="NO" | ||
</code> | </code> | ||
+ | 編集後、一度サーバの再起動を行う。 | ||
==== /etc/hosts 設定 ==== | ==== /etc/hosts 設定 ==== | ||
メールのリレー元であるfw, web, desktopを/etc/hostsに登録する。 | メールのリレー元であるfw, web, desktopを/etc/hostsに登録する。 | ||
- | |||
- | |||
- | |||
- | |||
- | |||
==== 送信テスト ==== | ==== 送信テスト ==== | ||
- | - sendmailを停止、起動する。<code> | ||
- | # service sendamil stop | ||
- | # service sendmail start | ||
- | </code> | ||
- mailコマンドでroot宛メールを送信する。<code> | - mailコマンドでroot宛メールを送信する。<code> | ||
# mail root | # mail root | ||
Line 84: | Line 77: | ||
メールのリレー先であるjailerを/etc/hostsに登録する。 | メールのリレー先であるjailerを/etc/hostsに登録する。 | ||
+ | ==== /etc/mail/aliases.db 設定 ==== | ||
+ | aliasesを編集して、root宛メールの送付先をroot@jailerとする。 | ||
+ | # root: me@my.domain | ||
+ | root: <jailerのroot宛> | ||
+ | |||
+ | newaliaesを実行し、aliases.dbを更新する。 | ||
+ | # newaliases | ||
+ | /etc/mail/aliases: 28 aliases, longest 22 bytes, 301 bytes total | ||
+ | # | ||
==== 送信テスト ==== | ==== 送信テスト ==== |