配置Postfix邮件系统的访问权限

Postfix邮件系统的配置主要通过main.cf文件,路径在/etc/postfix下。如果要允许其他服务器使用Postfix的服务,需要重点关注inet_interfaces和mynetworks这两个参数。

# The inet_interfaces parameter specifies the network interface
# addresses that this mail system receives mail on. By default,
# the software claims all active interfaces on the machine. The
# parameter also controls delivery of mail to user@[ip.address].
#
# See also the proxy_interfaces parameter, for network addresses that
# are forwarded to us via a proxy or network address translator.
#
# Note: you need to stop/start Postfix when this parameter changes.
#
inet_interfaces = all

要注意的是,修改这个参数必须要停止再启动Postfix,单纯的restart是不生效的。

# You can also specify the absolute pathname of a pattern file instead
# of listing the patterns here. Specify type:table for table-based lookups
# (the value on the table right-hand side is not used).
#
mynetworks = 11.12.13.14,127.0.0.0/8

这个参数指定了要使用Postfix的IP地址,如果不设定正确,会在maillog里看到类似如下的提示信息:

Dec 1 11:16:21 mail postfix/smtpd[21197]:warning: 11.12.13.14: address not listed for hostname banping.com
Dec 1 11:16:21 mail postfix/smtpd[21197]: connect from unknown[11.12.13.14]
Dec 1 11:16:21 mail postfix/smtpd[21197]: NOQUEUE: reject: RCPT from unknown[11.12.13.14]: 554 5.7.1: Relay access denied; from= to= proto=ESMTP helo=<banping.com>

自己搭建邮件系统还是比较折腾的,使用Amazon ses是比较便捷的做法。

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>