外部SMTPサーバーにメールを送信するようにpostfixを設定する方法は?

外部SMTPサーバーにメールを送信するようにpostfixを設定する方法は?

機械があります。http://phabricator.org/これを設定しながら、会社のメールボックスに電子メールを送信できるようにpostfixを設定したいと思います(たとえば、から送信される通知メールの場合[email protected])。

SMTPサーバーがあるとしますsmtp.company.net

postfixアカウントなしでこのサーバーに電子メールを送信できるようにするにはどうすればよいですか?relayhost内部構成に関連していますか/etc/postfix/main.cf

このネットワークの他のコンピュータにJenkinsを設定しましたが、設定する唯一のものはSMTP用のホスト名(ここsmtp.company.net)とSTMPサーバーからEメールを送信するための管理者Eメール(そのEメールのアカウントはありません)です。

Jenkinsとphabricator LDAP認証を設定しましたが、何らかの魔法の理由でJenkinsが機能し、次の場所でこのエラーが発生します/var/log/maillog

Oct  6 16:36:22 hostname_machine postfix/smtp[15077]: fatal: open database /etc/postfix/sasl_passwd.db: No such file or directory
Oct  6 16:36:23 hostname_machine postfix/master[14965]: warning: process /usr/libexec/postfix/smtp pid 15077 exit status 1
Oct  6 16:36:23 hostname_machine postfix/master[14965]: warning: /usr/libexec/postfix/smtp: bad command startup -- throttling

私はsasl_passwd.dbこれを使ってこれを作ることができます

postmap /etc/postfix/sasl_passwd

しかし、それは重要なことではありません。私はLDAP認証を持っており、この「Eメール送信者に通知」アカウントを持っていません... Jenkinsで魔法のように動作するからです。

ノート 個人アカウントの資格情報を手動で追加しました。sasl_passwd

echo "smtp.company.net myusername:mypassword" > /etc/postfix/sasl_passwd
postmap /etc/postfix/sasl_passwd
service postfix restart

私はこれを得ますpostmap /etc/postfix/sasl_passwd

Oct  6 16:42:28 hostname_machine postfix/pickup[15611]: 9237FE4E6E: uid=0 from=<root>
Oct  6 16:42:28 hostname_machine postfix/trivial-rewrite[15650]: warning: database /etc/postfix/virtual.db is older than source file /etc/postfix/virtual
Oct  6 16:42:28 hostname_machine postfix/cleanup[15648]: 9237FE4E6E: message-id=<[email protected]>
Oct  6 16:42:28 hostname_machine postfix/qmgr[15612]: 9237FE4E6E: from=<[email protected]>, size=545, nrcpt=1 (queue active)
Oct  6 16:42:29 hostname_machine postfix/smtp[15614]: 9237FE4E6E: to=<[email protected]>, relay=smtp.company.net[10.115.11.11]:25, delay=0.51, delays=0.16/0/0.17/0.18, dsn=2.0.0, status=sent (250 2.0.0 s96DgSY3016471 Message accepted for delivery)
Oct  6 16:42:29 hostname_machine postfix/qmgr[15612]: 9237FE4E6E: removed

ベストアンサー1

おすすめ記事