我尝试在我的linux机器上创建一个邮件服务器,作为一个只发送电子邮件服务器,最终在我的网络服务器上与PHP集成。
不幸的是,无论我使用什么邮件服务器,我都没有成功。现在,我正在研究postfix。我根据this教程安装并配置了它。
在我解释我的问题之前,这是我的配置文件:
# 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帐户。任何有关这方面的帮助将不胜感激!
-Thanks
答案 0 :(得分:0)
你应该在/var/log/mail.log中看到一些人解释你的电子邮件附带的内容。
Postfix conf似乎是正确的,如果你的邮件命令没有返回任何内容,这是正常的。
主机名ns526169.ip-198-100-148.net可能存在问题,因为它不是具有反向和MX记录的真实域名。