플랫폼: Arch Linux Cron: cronie 메일: msmtp
CLI를 통해 메일을 보내는 것이 제대로 작동하더라도 cron 출력을 Office 365 호스팅 사서함으로 보내면 다음 오류가 발생하는 것으로 나타났습니다.
Apr 01 04:41:10 prod crond[306]: msmtp: the server did not accept the mail
Apr 01 04:41:10 prod crond[306]: msmtp: server message: 550 5.7.1 Client does not have permissions to send as this sender
Apr 01 04:41:10 prod crond[306]: msmtp: could not send mail (account default from /etc/msmtprc)
Apr 01 04:41:10 prod crond[306]: msmtp: cannot log to /var/log/msmtp.log: cannot open: Permission denied
Apr 01 04:41:10 prod crond[306]: msmtp: log info was: host=smtp.office365.com tls=on auth=on [email protected] [email protected] [email protected] smtpstatus=550 smtpmsg='550 5.7.1 Client does not have permissions to send as this sender' errormsg='the server did not accept the mail' exitcode=EX_UNAVAILABLE
Apr 01 04:41:10 prod CROND[3212]: (postgres) MAIL (mailed 29 bytes of output but got status 0x0045 )
Apr 01 04:41:10 prod CROND[3212]: pam_unix(crond:session): session closed for user postgres
답변1
해결책은 MAILTO 외에 crontab에 다음을 추가해야 한다는 것입니다.
[email protected]