我正在尝试发送电子邮件,但经常收到错误的发件人电子邮件地址。
操作系统详细信息:
NAME="Ubuntu" VERSION="18.04.5 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.5 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
笔记:我们已经安装了mail
和ssmtp
。我只在文件中配置了mailhub ssmtp.conf
。
来自地址应该是,[email protected]
但它是作为xyz@guid
。
到目前为止尝试过的命令:
echo "Hello there" | mail -s "Test Mail" -r [email protected] mail-to@[email protected]
echo "Hello there" | mail -s "Test Mail" -r mail-from@[email protected] mail-to@[email protected]
echo "Hello there" | mail -s "Test Mail" -r 'First Last <[email protected]>' [email protected]
echo "Hello there" | mail -s "Test Mail" -aFrom:'First Last <[email protected]>' [email protected]
echo "Hello there" | mail -s "Test Mail" [email protected] -aFrom:[email protected]
echo "Hello there" | mail -s "Test Mail" -aFrom:IROL-Admin\<[email protected]\> [email protected]
答案1
我让它与下面的 SSMTP.Conf 一起工作
[email protected]
mailhub=mailhost.company.com:25
FromLineOverride=YES