当我使用后缀发送消息时,我无法更改发件人姓名。我总是得到[电子邮件保护],我已经检查了整个过程,但缺少了一些东西,你能看一下吗?
在 /etc/postfix/main.cf 中我有
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mydomain.com
mydomain = mydomain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
#myorigin = $mydomain
#mydestination = mydomain.com, localhost.localdomain, localhost.localdomain, localhost
mydestination = $myhostname localhost.$mydomain localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
后配置-n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 0
milter_default_action = accept
milter_protocol = 2
mydestination = $myhostname localhost.$mydomain localhost
mydomain = mydomain.com
myhostname = mydomain.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
non_smtpd_milters = inet:localhost:8891
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_destination_concurrency_limit = 2
smtp_destination_rate_delay = 3s
smtp_extra_recipient_limit = 2
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_milters = inet:localhost:8891
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
cat /etc/邮件名称
mydomain.com
我发送一封测试邮件,内容如下:
mail -s "test" [email protected] < test.txt
进入/var/log/mail.log我得到:
ED8021574F: from=<[email protected]>, size=35175, nrcpt=1 (queue active)
在我的收件箱中我收到了以下源电子邮件:
From: [email protected] (root)
答案1
改变
mail -s "test" [email protected] < test.txt
到
mail -s "test" [email protected] -a "From:[email protected]" < test.txt
如果该域名的 SPF 记录不包含您发送的系统或其智能主机(如果使用),则该邮件可能会被视为垃圾邮件。