- 论坛徽章:
- 0
|
Qmail SMTP认证信息随意输入也能发邮件解决方法!
SMTP认证
使用SMTP认证:
1:下载软件并且解开http://qmail.org/qmail-auth-20010105.tar.gz
2:cp README.auth base64.c base64.h ../qmail-1.03
patch -d ../qmail-1.03 < auth.patch
3:安装QMAIL
relay的意思是:服务器接受客户端的smtp请求,将客户端发往第三方的邮件进行转发。 qmail下控制relay很简单,只要客户端接入的smtp进程的环境变量里包含(RELAYCLIENT=""就允许relay ,否则拒收。实现方法是在/etc/tcp.smtp 里对需要relay的IP逐条设置(RELAYCLIENT="",然后用tcprules 生成规则表。因为本文要实现SMTP认证后的relay ,不需要对任何IP进行预先设定,所以默认规则设置成“只对本服务器relay”。/etc/tcp.smtp内容应该为:
127.0.0.1:allow,RELAYCLIENT=""
:allow
重新生成新的tcp.smtp.cdb文件:
/usr/local/bin/tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
4:设置qmail-smtp的run:
#!/bin/sh
QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g vpopmail`
QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl" export QMAILQUEUE
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
exec /usr/local/bin/softlimit -m 6000000 \
/usr/local/bin/tcpserver -v -R -l 0 -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \
-u "$QMAILDUID" -g "$NOFILESGID" 0 smtp /var/qmail/bin/qmail-smtpd bossard.com.cn /home/vpopmail/bin/vchkpw /usr/bin/true 2>;&1
5: chmod 6755 /usr/vpopmail/bin/vchkpw
With smtpd-auth, you should NOT have --enable-roaming-users=y (enabled). If this is enabled, the the first session with smtp relaying will be OK. If you then connecting again, your tcpserver enviroment will be :allow,RELAYCLIENT="" and nothing more. If you for instance is running a virus-scanner or anything else based on the QMAILQUEUE-patch, this will not occoure for this session or the rest until clearance of the relaying info. |
|