Home » Other

在Debian 下配置Postfix的SMTP认证

25 09月 2008 254 views No Comment Print This Post Print This Post Email This Post Email This Post

要用Postfix配置邮件服务器,配置SMTP要求发信认证是非常必要的,如果没有SMTP认证,就会有很多人利用你的SMTP来发送大量垃圾邮件。

本文记述了在 下是怎么配置一个明文的SMTP认证。明文的SMTP认证不安全,配置完明文的认证后,应该再配置一个Postfix的TLS发信认证,TLS是加密的,安全的,关于TLS的配置,我们会在另外一篇文章中描述。

安装必要的软件包:

apt-get install libsasl2 sasl2-bin libsasl2-modules

然后对postfix进行基本配置,这部分很简单,不再描述,下面描述怎样加入SMTP认证:

修改/etc/postfix/main.cf文件,在末尾加入:

smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes

修改/etc/default/saslauthd

START=yes
PWDIR="/var/spool/postfix/var/run/saslauthd"
PARAMS="-m ${PWDIR} -r"
PIDFILE="${PWDIR}/saslauthd.pid"
MECHANISMS="pam"
OPTIONS="-c -m ${PWDIR}"

然后运行:

mkdir -p /var/spool/postfix/var/run/saslauthd
echo 'pwcheck_method: saslauthd' >> /etc/postfix/sasl/smtpd.conf
echo 'mech_list: plain login' >> /etc/postfix/sasl/smtpd.conf

然后重启postfix和saslauthd,应该就能实现明文的发信认证了。

Related Posts

Tags: ,

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.