我最近一直在testingPostfix并将其configuration为虚拟环境中的发送专用邮件客户端。 我一直在使用几台虚拟机上的设置,直到我开始工作,终于find了我应该join的适当的值。我们的configuration是非常基本的,我会掩盖或域代码如下,我们正在使用。
# See /usr/share/postfix/main.cf.dist for a commented, more complete version # Debian specific: Specifying a file name will cause the first # line of that file to be used as the name. The Debian default # is /etc/mailname. #myorigin = /etc/mailname smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) 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 # 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 # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for # information on enabling SSL in the smtp client. smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination myhostname = mail.example.com alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = mail.example, localhost.localdomain, localhost relayhost = smtp-relay.gmail.com mynetworks = 10.0.0.0/8 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_command = procmail -a "$EXTENSION" mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all inet_protocols = all
/ etc / hostname的内容如下
mail.example.com
/ etc / hosts的内容如下
127.0.0.1 localhost.localdomain localhost 10.xxx mail.example.com mail # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters
下面的/ etc / mailname的内容
example.com
但是无论什么原因,这个configuration和另外一个与这些文件相同的服务器是一样的,但是当我从命令行发送邮件时,就像这样:
echo "testing email" | mail -s "test subject" [email protected]
一台服务器显示它来自[email protected],另一台显示它来自[email protected]。 我不能为我的生活弄清楚,我不知道这两个服务器之间的设置是什么和不同(我已经重新启动它们,并重新启动Postfix服务几次)。
这看起来像一个系统variables或有另一个configuration文件被轮询。 我很好奇,想知道这里发生了什么,任何信息都会非常有帮助。 谢谢!
更新1:包括mail.log比较和postconf -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_command = procmail -a "$EXTENSION" mailbox_size_limit = 0 mydestination = mail.example.com, localhost.localdomain, localhost myhostname = mail.example.com mynetworks = 10.0.0.0/8 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 myorigin = /etc/mailname readme_directory = no recipient_delimiter = + relayhost = smtp-relay.gmail.com smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) 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
Mail.log比较
uid=1000 from=<operations> uid=1000 [email protected] 这些都在Ubuntu 14.04.3虚拟机上运行,这些虚拟机是为此创build的,并且完全更新。 我在哪里可以find这个裸用户名configuration? 我检查了/ etc / passwd,但它只是说“操作”,必须有一个文件或我在某处丢失的东西 – 你有什么想法吗?
我想到了。 无论出于何种原因,我的/ etc / mailname似乎没有得到处理,即使它与其他服务器相同 – 文件甚至具有相同的MD5sum – Postfixconfiguration没有使用它。 我也注意到,我在一个系统上使用mailutils(一个不工作,在事实之后安装了Postfix的系统),另一个使用了bsd-mailx。 我在尝试更改/ etc / mailname之前进行了交换,似乎没有什么区别,但是为了以防万一,值得注意的是它。 无论如何,我改变了我的/ etc / mailname到一个虚假的价值,如testing,然后做了一个sudo后缀重新加载和sudo服务postfix重新启动,然后切换回我想要的是(contoso.com)后跟相同的两个命令刷新configuration和服务,并看到,它是按预期工作。 感谢所有帮助。