我不明白为什么我的 AWS EC2 ( Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-32-generic x86_64)
)上的 cron似乎无法通过 sSmtp 向 AWS SES 发送电子邮件。
这有效:echo "test" | ssmtp my@myemail.com
我从本地用户那里收到一封电子邮件。
这有效:echo "test" | sudo ssmtp my@myemail.com
我收到一封来自 root 的电子邮件。
但是,当 cron 运行并尝试发送电子邮件时,我什么也没有得到,这出现在 syslogs:sSMTP[14608]: 554 Transaction failed: Missing final '@domain'
或有时:554 Transaction failed: User name is missing: 'Cron Daemon <root>'
。
cron 试图以谁的身份发送电子邮件?我会认为它是root
。
/etc/crontab:
MAILTO="me@myemail.com"
Run Code Online (Sandbox Code Playgroud)
(我也试过MAILTO=root
)
/etc/ssmtp/revaliases:
root:me@myemail.com:email-smtp.us-east-1.amazonaws.com:465
me:me@myemail.com:email-smtp.us-east-1.amazonaws.com:465
Run Code Online (Sandbox Code Playgroud)
/etc/ssmtp/ssmtp.conf:
root=me@myemail.com
mailhub=email-smtp.us-east-1.amazonaws.com:465
rewriteDomain=myemail.com
hostname=myemail.com
#UseSTARTTLS=YES
UseTLS=YES
AuthUser=XXXXXXXXXXXXXXXXX
AuthPass=XXXXXXXXXXXXXXXXX
AuthMethod=LOGIN
FromLineOverride=YES …
Run Code Online (Sandbox Code Playgroud) 我在 AWS 上运行 Ubuntu 12.10 (GNU/Linux 3.5.0-21-generic i686)。
当我尝试安装时unzip
,出现以下错误:
sudo apt-get install unzip
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
gir1.2-gudev-1.0 libgudev-1.0-0 netcat-traditional python-gi
Use 'apt-get autoremove' to remove them.
Suggested packages:
zip
The following NEW packages will be installed:
unzip
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 184 kB of archives.
After this operation, …
Run Code Online (Sandbox Code Playgroud)