ssmtp 停止工作

ssmtp 停止工作

这曾经有效,但现在不再有效了?

NOW=$(date +%m-%d-%Y_%I:%M%p)
CONTENT="Backup to Maxtor Drive performed on $NOW ."
echo "Sending email."
/usr/sbin/ssmtp -t << EOF
To: [email protected]
From: [email protected]
Subject: Backups to Maxtor Drive 

$CONTENT

EOF

我重新安装了 ssmtp,然后我得到了

  ssmtp: Cannot open mail:25

ssmtp配置文件

# The full hostname
hostname=7

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
#FromLineOverride=YES

[email protected]
mailhub=smtp.mail.yahoo.com:587
AuthUser=7
AuthPass=***
UseSTARTTLS=YES

重新命名

# sSMTP aliases
# 
# Format:   local_account:outgoing_address:mailhub
#
# Example: root:[email protected]:mailhub.your.domain[:port]
# where [:port] is an optional port number that defaults to 25.
[email protected]:smtp.mail.yahoo.com:587

答案1

可能未授予用户权限。我尝试$sudo chmod ug+rwx /etc/ssmtp/ssmtp.conf对重新别名执行相同操作。成功了!

相关内容