小编Rog*_*rat的帖子

ssmtp 不会发送 cron 电子邮件

我不明白为什么我的 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)

cron amazon-web-services ssmtp

4
推荐指数
1
解决办法
6480
查看次数

aws 上的 apt-get 不会安装 zip

我在 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)

ubuntu amazon-web-services apt

2
推荐指数
1
解决办法
6636
查看次数

标签 统计

amazon-web-services ×2

apt ×1

cron ×1

ssmtp ×1

ubuntu ×1