![如何在不创建用户的情况下更改 Postfix 上的用户名](https://linux22.com/image/1032335/%E5%A6%82%E4%BD%95%E5%9C%A8%E4%B8%8D%E5%88%9B%E5%BB%BA%E7%94%A8%E6%88%B7%E7%9A%84%E6%83%85%E5%86%B5%E4%B8%8B%E6%9B%B4%E6%94%B9%20Postfix%20%E4%B8%8A%E7%9A%84%E7%94%A8%E6%88%B7%E5%90%8D.png)
配置:Ubuntu Server 22
当我们收到电子邮件时,它显示以下内容:来自用户[电子邮件保护]。
此“用户”是发送电子邮件之前登录系统的用户的用户名。例如,如果我以“root”用户身份登录并创建别名,例如[电子邮件保护],当我收到电子邮件时,它显示为 root[电子邮件保护]。所以,我的问题是,我可以通过在系统上创建一个新用户并以该用户身份登录来更改此设置吗?
主文件:
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 3.6 on
# fresh installs.
compatibility_level = 3.6
# 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_tls_security_level=may
smtp_tls_CApath=/etc/ssl/certs
smtp_tls_security_level=may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mail.domain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, domain.com, smtpserver, localhost.localdomain, 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 = ipv4
# Milter configuration
milter_default_action = accept
milter_protocol = 6
smtpd_milters = local:opendkim/opendkim.sock
non_smtpd_milters = $smtpd_milters