외부 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 서버에서).

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 인증이 있고 이 "알림 이메일 발신자"에 대한 계정이 없기 때문에 이것은 요점이 아닙니다. 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

관련 정보