我试图让我所有的系统电子邮件被转发到我的gmail地址,使用msmtp 1.8.3和/etc/aliases上的debian。它很有效,但我从gmail那里得到了错误。
当我通过root (通过echo "hello world" | mail -s "forward me" root)发送电子邮件时,我在gmail地址的收件箱中获得2封电子邮件:
mailer-daemon@googlemail.com的以下消息Address not found
Your message wasn't delivered to root@backupbox because the domain backupbox couldn't be found. Check for typos or unnecessary spaces and try again.
The response was:
DNS Error: 5452395 DNS type 'mx' lookup of backupbox responded with code NXDOMAIN Domain name not found: backupbox显然,gmail无法到达root@backupbox并不奇怪,因为从他们的角度来看,backupbox并不是一个完全限定的域名。然而,我很惊讶,因为我把我所有的系统地址都化成了我的gmail地址。
下面是我的msmtp配置:
# /etc/msmtprc
defaults
port 587
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
account gmail
host smtp.gmail.com
from me@gmail.com
auth on
user me
password xxxxxxxxxxxxxxxx
account default : gmail
aliases /etc/aliases这是我的系统别名
# /etc/aliases
default: me+backupbox@gmail.com我如何确保只有第一封电子邮件到达我?例如,msmtp可以将root@backupbox重写为me@gmail.com吗?
发布于 2021-09-15 10:35:38
是的,msmtp可以像这样重写地址。我的机器上也有类似的装置
echo 'a test email' | msmtp root按预期工作。
也许问题在于+符号。也许它需要以某种方式逃脱。我建议在没有+测试的情况下尝试它。尽管很明显,你的问题是从2019年开始的,但你现在可能已经找到了另一种方式!
https://unix.stackexchange.com/questions/555833
复制相似问题