Postfix仅发送服务器安装程序不返回任何结果


Postfix send only server setup returns nothing

我正在尝试在我的linux机器上创建一个邮件服务器,作为仅发送电子邮件的服务器,最终在我的web服务器上与PHP集成。

不幸的是,无论我使用什么邮件服务器,我都没有成功。现在,我正在做后缀。我根据本教程安装并配置了它。

在我解释我的问题之前,这里是我的配置文件:

    # 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 = ns526169.ip-198-100-148.net
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, localhost.example.com, example.com
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = all

所以,我用这个控制台命令测试了smtp服务器:

echo "This is the body of the email" | mail -s "This is the subject line" *my email*

我执行命令,什么也没发生。命令没有返回任何信息,我也没有收到电子邮件。我测试的电子邮件是一个gmail帐户。如有任何帮助,我们将不胜感激!

-感谢

您应该在/var/log/mail.log中看到一些内容,这些内容解释了您的电子邮件的标题。

Postfix conf看起来是正确的,如果您的邮件命令没有返回任何内容,这是正常的。

主机名ns526169.ip-198-100-148.net可能是个问题,因为它不是一个具有反向和MX记录的真实域名。