邮件配置Postfix + wordpress

时间:2018-08-20 12:04:49

标签: wordpress email postfix-mta

这是我第一次必须配置邮件服务器,但我不知道必须配置什么。我读了很多不同的东西,我必须问你们。 我已经可以使用mail命令在服务器上发送邮件了。

我希望我的服务器能够在雷鸟之类的客户端上接收邮件并查阅我的邮件,我也希望我的网站(wordpress)能够发送邮件(联系表格)。

我应该配置什么才能使其正常工作? 这是我的实际配置

/ etc / hostname

domain

/ etc / hosts

xx.xx.xxx.xx domain.fr domain

/ etc / mailname

domain.fr

/etc/postfix/main.cf

# 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 (Debian/GNU)
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 2 on
# fresh installs.
compatibility_level = 2

# 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
# 51.68.121.77
myhostname = domain.fr
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = domain.fr, localhost.domain.fr, localhostrelayhost =
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 = all

1 个答案:

答案 0 :(得分:0)

如果使用SMTP插件(例如WP Mail SMTP),则不需要Postfix。这种插件可以通过SMTP从您的Google帐户发送电子邮件。

我刚刚通过停止后缀并通过WP Mail SMTP成功发送电子邮件来进行检查。

如果您的站点上未激活任何SMTP插件,则您肯定需要系统传输,该系统传输可以是Postfix或Linux上的另一个邮件传输代理(MTA)。 Postfix还可以使用您的Google帐户作为中继来发送电子邮件。