Postfix 从主机名发送邮件

Postfix sending mail from hostname

大家好,

我对 postfix 及其发送邮件的方式有疑问。 我已正确设置,并且能够发送不会以垃圾邮件结尾的邮件。

但出于某种原因,当我显示邮件的详细信息时(例如在 gmail 上),它显示了一个发件人地址:user@mail.domain.com

我希望它成为 user@domain.com 我怎么会做这样的事情?

我的另一个问题是如何加密电子邮件?不直接进入垃圾邮件文件夹?

我正在使用 mailutilssquirrelmail 的形式发送我的邮件 不能发送我的邮件。然而 squirrelmail 可以查看邮件。 我使用 Debian Jessie 作为我的服务器

我的后缀主文件:

myhostname = mail.domain.com
mydomain = domain.com
myorigin = $mydomain
mydestination = $myhostname, $mydomain, localhost, localhost.$mydomain
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
relay_domains = $mydestination
syslog_name=postfix/submission

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

smtpd_tls_cert_file=/etc/letsencrypt/live/domain.com/fullchain.pem
smtpd_tls_key_file=/etc/letsencrypt/live/domain.com/privkey.pem
smtpd_use_tls = yes
smtpd_tls_auth_only = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_tls_security_level = may
#smtp_tls_security_level = may
smtpd_tls_protocols = !SSLv2, !SSLv3
smtpd_tls_wrappermode=no

smtpd_sasl_type=dovecot
smtpd_sasl_path=private/auth
smtpd_sasl_auth_enable=yes
milter_macro_daemon_name=ORIGINATING
#Security and Anti-Spam cinfig
policy-spf_time_limit = 3600s
smtpd_helo_required = yes

smtpd_recipient_restrictions =
 reject_non_fqdn_recipient
 reject_unknown_recipient_domain
 permit_mynetworks
 permit_sasl_authenticated
 reject_unauth_destination
 check_policy_service unix:private/policy-spf
 check_policy_service inet:127.0.0.1:10023

smtpd_helo_restrictions =
 permit_mynetworks
 reject_non_fqdn_helo_hostname
 reject_invalid_helo_hostname

smtpd_client_restrictions=
 permit_mynetworks
 permit_sasl_authenticated
 reject_unknown_client_hostname

smtpd_data_restrictions =
 reject_unauth_pipelining

#DKIM
milter_default_action = accept
milter_protocol = 6
smtpd_milters = inet:localhost:8891
non_smtpd_milters = inet:localhost:8891

local_recipient_maps = proxy:unix:passwd.byname $alias_maps

我只能回答你的第一个问题,你需要 "Address Rewriting" 规则,你可以在这里找到如何设置它们:

http://www.postfix.org/ADDRESS_REWRITING_README.html