我正在尝试在我的 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 帐户。对此的任何帮助将不胜感激!
-谢谢