ユーザ用ツール

サイト用ツール


サイドバー

このページの翻訳:



最近の更新



Tag Cloud

01_linux:03_mail:postfix_op25b環境でfqdnを持たないホストからメールを投げる方法

文書の過去の版を表示しています。


Postfix - OP25B環境でFQDNを持たないホストからメールを投げる方法

LAN内でFreeBSD/Linux鯖を動かし、ジャーナルやアラートをインタネットメールで

投げたい事ってありますよね。

昔は第三者中継なんて気にしてなかったので深く考えないでメールが出せました。

今は25/tcpのパケットを外に出すことすら難しく、FQDNが正しくセットされていな

い計算機からのメールを受け取ってくれる奇特なsmtpサーバは皆無です。

postfixはsmtp-auth(smtp認証)のクライアントになってメールを特定の中継smtp

サーバに投げつけてくれる機能がありました。

smtp-auth(smtp認証)がサポートされているsmtpサーバにsmtp-authでアクセスす
るために

インストール

# yum -y install postfix

smtp認証ファイル用意

hostname:port username:password
# vi /etc/postfix/relay_password
mail.flat8.co.jp:587 hogehoge:xxhoge

transportファイル用意

# vi /etc/postfix/transport
* smtp:dns.flat8.co.jp:587

hashDB化

# postmap /etc/postfix/relay_password
# postmap /etc/postfix/transport

hashDB化したファイルを見るには

  # strings /etc/postfix/transport.db
  smtp:dns.flat8.co.jp:587

main.cfに下記追加

# vi /etc/postfix/main.cf
smtp_sasl_auth_enable = yes 
smtp_sasl_password_maps = hash:/etc/postfix/relay_password
smtp_sasl_security_options = noanonymous 
transport_maps = hash:/etc/postfix/transport 

postfixをreload

# /usr/sbin/postfix reload

logwatchの送り先変更

CentOS 6 の場合

下記のエラーが出て送信できない

SASL authentication failure: No worthy mechs found
SASL authentication failed; cannot authenticate to server mail.flat8.co.j

対応方法

下記のライブラリをインストールしてあげると上手くい

# yum install cyrus-sasl-md5

https://smtps.jp/docs/integrate/si/postfix/index.html

01_linux/03_mail/postfix_op25b環境でfqdnを持たないホストからメールを投げる方法.1555587530.txt.gz · 最終更新: 2019/04/18 20:38 by matsui