centos + qmail + telnet +open localhost 25 出现 Connection closed by foreign host

Last login: Wed Oct 26 02:20:04 2011 from 192.168.21.36
[root@centos-qmail ~]# netstat -a |grep smtp
tcp        0      0 *:smtp                      *:*                         LISTEN      
[root@centos-qmail ~]# telnet
telnet> open localhost 25
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
[root@centos-qmail ~]# telnet 

 

回头看一下tcpserver才发现

warning: dropping connection, unable to run /var/qmail/bin/qmail-smtpd: out of memory


tcpserver: status: 0/20
tcpserver: status: 1/20
tcpserver: pid 1924 from 127.0.0.1
tcpserver: ok 1924 centos-qmail.local:127.0.0.1:25 localhost:127.0.0.1::49868
tcpserver: warning: dropping connection, unable to run /var/qmail/bin/qmail-smtpd: out of memory
tcpserver: end 1924 status 28416
tcpserver: status: 0/20

 

尝试着把

smtp/run改大点.竟然可以了

memLimit=10000000

本来官方中教程中是2000000,接着改400000,还不行,再改成10000000才ok了

-----------

#!/bin/sh

QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
LOCAL=`head -1 /var/qmail/control/me`

if [ -z "$QMAILDUID" -o -z "$NOFILESGID" -o -z "$MAXSMTPD" -o -z "$LOCAL" ]; then

    echo QMAILDUID, NOFILESGID, MAXSMTPD, or LOCAL is unset in
    echo /var/qmail/supervise/qmail-smtpd/run
    exit 1
fi

if [ ! -f /var/qmail/control/rcpthosts ]; then
    echo "No /var/qmail/control/rcpthosts!"
    echo "Refusing to start SMTP listener because it'll create an open relay"
    exit 1
fi

memLimit=10000000

echo "/usr/local/bin/softlimit -m $memLimit   /usr/local/bin/tcpserver -v -R -l "$LOCAL" -x /etc/tcp.smtp.cdb -c "$MAXSMTPD"         -u "$QMAILDUID" -g "$NOFILESGID" 0 smtp /var/qmail/bin/qmail-smtpd 2>&1"

exec /usr/local/bin/softlimit -m $memLimit   /usr/local/bin/tcpserver -v -R -l "$LOCAL" -x /etc/tcp.smtp.cdb -c "$MAXSMTPD"         -u "$QMAILDUID" -g "$NOFILESGID" 0 25 /var/qmail/bin/qmail-smtpd 2>&1

 

 

 

---------------

 

发送测试

 

-------

telnet> open localhost 25
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 centos-qmail.local ESMTP
helo qq.com
250 centos-qmail.local
mail from:root@centos-qmail.local
250 ok
rcpt to:qiedizi^H
250 ok
rcpt to :qidizi@qq.com
250 ok
data
354 go ahead
k
k

.
250 ok 1319611689 qp 2717

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值