혹시 Qmail셋팅후 telnet 자동 closed 되는 현상..
경험하신 분 계신가요..?
[root@mysql netqmail-1.05]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
Connection closed by foreign host.
아래와 같이 셋팅했고... 설치는 잘 되었습니다.
방화벽도 열려 있구요..
[root@mysql ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.0.231 petpsoft.com localhost2
192.168.0.231 everytalking.com localhost3
192.168.0.231 real79.com localhost4
192.168.0.231 mysql.petpsoft.com localhost5
[root@mysql ~]# cat /etc/resolv.conf
search petpsoft.com
nameserver 168.126.63.1
nameserver 164.126.63.1
[root@mysql ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain
DOMAINNAME=petpsoft.com
[root@host netqmail-1.05]# ps ax
2975 ? Ss 0:00 /bin/sh /command/svscanboot
3039 ? S 0:00 svscan /service
3040 ? S 0:00 readproctitle service errors: ..........................................................................
13235 ? S 0:00 supervise qmail-smtpd
13236 ? S 0:00 supervise log
13237 ? S 0:00 supervise qmail-send
13238 ? S 0:00 supervise log
13240 ? S 0:00 /usr/local/bin/multilog t /var/log/qmail/smtpd
13241 ? S 0:00 qmail-send
13242 ? S 0:00 /usr/local/bin/multilog t /var/log/qmail
13243 ? S 0:00 splogger qmail
13244 ? S 0:00 qmail-lspawn ./Maildir/
13245 ? S 0:00 qmail-rspawn
13246 ? S 0:00 qmail-clean
20419 ? Z 0:00 /usr/local/bin/tcpserver -vRHl0 -x /etc/tcp.smtp.cdb -u id -u qmaild -g id -g qmaild 0 25 /
[root@host ~]# pstree
|-svscanboot-+-readproctitle
| `-svscan-+-supervise---tcpserver
| |-2*[supervise---multilog]
| `-supervise---qmail-send-+-qmail-clean
| |-qmail-lspawn
| |-qmail-rspawn
| `-splogger
[root@host netqmail-1.05]# vi /etc/sysconfig/iptables
# Firewall configuration written by system-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 23 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 110 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 143 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3690 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
-- 아래는 설치 전문 입니다. 하도 안되서... CentOS밀고 책에 있는대로 설치한후 Qmail만 설치하고 있습니다. 먼저번에 APM 설치하고 나서 Qmail 설치 한번 성공은 했는데... 여러번 다시 해도 실패해서 아예 Qmail먼저 설치하고 있습니다.
[root@host ~]# yum install gcc gcc-c++ openssl-devel
[root@host ~]# cd /usr/local/src/
[root@host src]# mv /home/every/apm .
[root@host src]# mv /home/every/qmail .
[root@host src]# ls -l
?⑷퀎 8
drwxrwxr-x 3 every every 4096 11??11 14:13 apm
drwxrwxr-x 3 every every 4096 11??11 14:11 qmail
[root@host src]# chown -R root.root *
[root@host ~]# vi .bashrc
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
LANG=C
~
~
".bashrc" 13L, 183C written
[root@host ~]# . .bashrc
[root@host ~]# cd /usr/local/src/
[root@host src]# ls -l
total 8
drwxrwxr-x 3 root root 4096 Nov 11 14:13 apm
drwxrwxr-x 3 root root 4096 Nov 11 14:11 qmail
[root@host src]# vi /etc/resolv.conf
search petpsoft.com
nameserver 168.126.63.1
nameserver 164.126.63.1
~
[root@host src]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 host.petpsoft.com host localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.0.231 petpsoft.com petpsoft
192.168.0.231 everytalking.com localevery
192.168.0.231 real79.com localreal79
192.168.0.231 mysql.petpsoft.com localmysql
~
~
"/etc/hosts" 8L, 377C written
[root@host src]# vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=host.petpsoft.com
DOMAINNAME=everytalking.com
GATEWAY=192.168.0.1
--> 파일은 미리 다 받았음.
[root@host src]# /etc/rc.d/init.d/sendmail stop
-bash: /etc/rc.d/init.d/sendmail: No such file or directory
[root@host src]# cd /usr/local/src/qmail/
[root@host qmail]# tar -xzf netqmail-1.05.tar.gz
--> ucspi-tcp-0.88 설치
[root@host qmail]# tar -xzf ucspi-tcp-0.88.tar.gz
[root@host qmail]# cd ucspi-tcp-0.88
[root@host ucspi-tcp-0.88]# patch -p1 < /usr/local/src/qmail/netqmail-1.05/other-patches/ucspi-tcp-0.88.errno.patch
patching file error.h
[root@host ucspi-tcp-0.88]# patch -p1 < /usr/local/src/qmail/netqmail-1.05/other-patches/ucspi-tcp-0.88.a_record.patch
patching file rblsmtpd.c
[root@host ucspi-tcp-0.88]# patch -p1 < /usr/local/src/qmail/netqmail-1.05/other-patches/ucspi-tcp-0.88.nodefaultrbl.patch
patching file rblsmtpd.c
Hunk #1 succeeded at 193 (offset 38 lines).
Hunk #3 succeeded at 227 (offset 38 lines).
[root@host ucspi-tcp-0.88]# make
[root@host ucspi-tcp-0.88]# make setup check
./install
./instcheck
--> install daemontools-0.76
[root@host ucspi-tcp-0.88]# mkdir -p /package
[root@host ucspi-tcp-0.88]# chmod 1755 /package/
[root@host ucspi-tcp-0.88]# cd ..
[root@host qmail]# tar -xzf daemontools-0.76.tar.gz -C /package/
[root@host qmail]# cd /package/admin/daemontools-0.76/
[root@host daemontools-0.76]# patch -p1 < /usr/local/src/qmail/netqmail-1.05/other-patches/daemontools-0.76.errno.patch
patching file src/error.h
[root@host daemontools-0.76]# package/install
Making compatibility links in /usr/local/bin...
Creating /service...
Adding svscanboot to inittab...
init should start svscan now.
[root@host daemontools-0.76]# ps ax
.....
5286 ? S 0:00 readproctitle service errors: ..............................................
5287 pts/2 R+ 0:00 ps ax
[root@host daemontools-0.76]# pstree
.....
|-svscanboot-+-readproctitle
| `-svscan
--> install QMAIL.................
[root@host daemontools-0.76]# cd /usr/local/src/qmail/netqmail-1.05
[root@host netqmail-1.05]# mkdir /var/qmail
[root@host netqmail-1.05]# ./collate.sh
You should see 7 lines of text below. If you see anything
else, then something might be wrong.
[1] Extracting qmail-1.03...
tar: Read 1024 bytes from -
[2] Patching qmail-1.03 into netqmail-1.05. Look for errors below:
24
[4] The previous line should say 24 if you used GNU patch.
[5] Renaming qmail-1.03 to netqmail-1.05...
[6] Continue installing qmail using the instructions found at:
[7] http://www.lifewithqmail.org/lwq.html#installation
[root@host netqmail-1.05]# groupadd nofiles
[root@host netqmail-1.05]# useradd -g nofiles -d /var/qmail/alias alias
[root@host netqmail-1.05]# useradd -M -g nofiles -d /var/qmail qmaild
[root@host netqmail-1.05]# useradd -M -g nofiles -d /var/qmail qmaill
[root@host netqmail-1.05]# useradd -M -g nofiles -d /var/qmail qmailp
[root@host netqmail-1.05]# groupadd qmail
[root@host netqmail-1.05]# useradd -M -g qmail -d /var/qmail qmailq
[root@host netqmail-1.05]# useradd -M -g qmail -d /var/qmail qmailr
[root@host netqmail-1.05]# useradd -M -g qmail -d /var/qmail qmails
[root@host netqmail-1.05]# chgrp qmail /var/qmail
[root@host netqmail-1.05]# cd /usr/local/src/qmail/netqmail-1.05/netqmail-1.05
[root@host netqmail-1.05]# patch -p1 < /usr/local/src/qmail/qmail-date-localtime.patch
patching file date822fmt.c
[root@host netqmail-1.05]# patch -p0 < /usr/local/src/qmail/netqmail-1.05-tls-smtpauth-20070417.patch
....
patching file ./tls.h
patching file ./update_tmprsadh.sh
[root@host netqmail-1.05]# make
[root@host netqmail-1.05]# make setup check
./install
./instcheck
[root@host netqmail-1.05]# make cert
Generating a 1024 bit RSA private key
...++++++
.......++++++
writing new private key to '/var/qmail/control/servercert.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:KR
State or Province Name (full name) [Berkshire]:SEOUL
Locality Name (eg, city) [Newbury]:SEOUL
Organization Name (eg, company) [My Company Ltd]:WICSSOFT
Organizational Unit Name (eg, section) []:RND
Common Name (eg, your name or your server's hostname) []:host.petpsoft.com
Email Address []:kevinhappy@nate.com
[root@host netqmail-1.05]# make tmprsadh
[root@host netqmail-1.05]# ./config-fast
Your fully qualified host name is .
Putting into control/me...
Putting into control/defaultdomain...
Putting into control/plusdomain...
Putting into control/locals...
Putting into control/rcpthosts...
Now qmail will refuse to accept SMTP messages except to .
Make sure to change rcpthosts if you add hosts to locals or virtualdomains!
[root@host netqmail-1.05]# ./config-fast host.petpsoft.com
Your fully qualified host name is host.petpsoft.com.
Putting host.petpsoft.com into control/me...
Putting petpsoft.com into control/defaultdomain...
Putting petpsoft.com into control/plusdomain...
Putting host.petpsoft.com into control/locals...
Putting host.petpsoft.com into control/rcpthosts...
Now qmail will refuse to accept SMTP messages except to host.petpsoft.com.
Make sure to change rcpthosts if you add hosts to locals or virtualdomains!
[root@host netqmail-1.05]# ./config-fast everytalking.com
Your fully qualified host name is everytalking.com.
Putting everytalking.com into control/me...
Putting everytalking.com into control/defaultdomain...
Putting everytalking.com into control/plusdomain...
Putting everytalking.com into control/locals...
Putting everytalking.com into control/rcpthosts...
Now qmail will refuse to accept SMTP messages except to everytalking.com.
Make sure to change rcpthosts if you add hosts to locals or virtualdomains!
[root@host netqmail-1.05]# ./config-fast real79.com
Your fully qualified host name is real79.com.
Putting real79.com into control/me...
Putting real79.com into control/defaultdomain...
Putting real79.com into control/plusdomain...
Putting real79.com into control/locals...
Putting real79.com into control/rcpthosts...
Now qmail will refuse to accept SMTP messages except to real79.com.
Make sure to change rcpthosts if you add hosts to locals or virtualdomains!
[root@host netqmail-1.05]# vi /var/qmail/rc
#!/bin/sh
exec env - PATH="/var/qmail/bin:$PATH" \
qmail-start ./Maildir/ splogger qmail
[root@host netqmail-1.05]# chmod 755 /var/qmail/rc
[root@host netqmail-1.05]# mkdir -p /var/qmail/supervise/qmail-send/log
[root@host netqmail-1.05]# mkdir -p /var/qmail/supervise/qmail-smtpd/log
[root@host netqmail-1.05]# chmod +t /var/qmail/supervise/qmail-send
[root@host netqmail-1.05]# chmod +t /var/qmail/supervise/qmail-smtpd
[root@host netqmail-1.05]# vi /var/qmail/supervise/qmail-send/run
#!/bin/sh
exec /var/qmail/rc
[root@host netqmail-1.05]# vi /var/qmail/supervise/qmail-send/log/run
#!/bin/sh
exec /usr/local/bin/setuidgid qmaill \
/usr/local/bin/multilog t /var/log/qmail
[root@host netqmail-1.05]# vi /var/qmail/supervise/qmail-smtpd/run
#!/bin/sh
Q_UID='id -u qmaild'
Q_GID='id -g qmaild'
exec /usr/local/bin/softlimit -m 20000000 \
/usr/local/bin/tcpserver -vRHl 0 -x /etc/tcp.smtp.cdb \
-u $Q_UID -g $Q_GID 0 25 /var/qmail/bin/qmail-smtpd 2>&1
[root@host netqmail-1.05]# vi /var/qmail/supervise/qmail-smtpd/log/run
#!/bin/sh
exec /usr/local/bin/setuidgid qmaill \
/usr/local/bin/multilog t /var/log/qmail/smtpd
[root@host netqmail-1.05]# chmod 755 /var/qmail/supervise/qmail-send/run
[root@host netqmail-1.05]# chmod 755 /var/qmail/supervise/qmail-send/log/run
[root@host netqmail-1.05]# chmod 755 /var/qmail/supervise/qmail-smtpd/run
[root@host netqmail-1.05]# chmod 755 /var/qmail/supervise/qmail-smtpd/log/run
[root@host netqmail-1.05]# mkdir -p /var/log/qmail/smtpd
[root@host netqmail-1.05]# chown qmaill /var/log/qmail /var/log/qmail/smtpd
[root@host netqmail-1.05]# vi /etc/tcp.smtp
127.0.0.1:allow,RELAYCLIENT=""
192.168.0.231:allow,RELAYCLIENT=""
192.168.0.:allow,RELAYCLIENT=""
[root@host netqmail-1.05]# tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
[root@host netqmail-1.05]# vi /etc/rc.d/init.d/qmail
#!/bin/sh
# For RedHat chkconfig
# chkconfig: - 80 30
# description: the qmail MTA
PATH=/var/qmail/bin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin
export PATH
case "$1" in
start)
echo "Starting qmail"
if [ -e /service/qmail-send ] ; then
if svok /service/qmail-send ; then
svc -u /service/qmail-send
else
echo qmail-send supervise not running
fi
else
ln -s /var/qmail/supervise/qmail-send /service/
fi
if [ -e /service/qmail-smtpd ] ; then
if svok /service/qmail-smtpd ; then
svc -u /service/qmail-smtpd
else
echo qmail-smtpd supervise not running
fi
else
ln -s /var/qmail/supervise/qmail-smtpd /service/
fi
if [ -d /var/lock/subsys ]; then
touch /var/lock/subsys/qmail
fi
;;
stop)
echo "Stopping qmail..."
echo " qmail-smtpd"
svc -dx /service/qmail-smtpd /service/qmail-smtpd/log
rm -f /service/qmail-smtpd
echo " qmail-send"
svc -dx /service/qmail-send /service/qmail-send/log
rm -f /service/qmail-send
if [ -f /var/lock/subsys/qmail ]; then
rm /var/lock/subsys/qmail
fi
;;
stat)
svstat /service/qmail-send
svstat /service/qmail-send/log
svstat /service/qmail-smtpd
svstat /service/qmail-smtpd/log
qmail-qstat
;;
doqueue|alrm|flush)
echo "Flushing timeout table and sending ALRM signal to qmail-send."
/var/qmail/bin/qmail-tcpok
svc -a /service/qmail-send
;;
queue)
qmail-qstat
qmail-qread
;;
reload|hup)
echo "Sending HUP signal to qmail-send."
svc -h /service/qmail-send
;;
pause)
echo "Pausing qmail-send"
svc -p /service/qmail-send
echo "Pausing qmail-smtpd"
svc -p /service/qmail-smtpd
;;
cont)
echo "Continuing qmail-send"
svc -c /service/qmail-send
echo "Continuing qmail-smtpd"
svc -c /service/qmail-smtpd
;;
restart)
echo "Restarting qmail:"
echo "* Stopping qmail-smtpd."
svc -d /service/qmail-smtpd
echo "* Sending qmail-send SIGTERM and restarting."
svc -t /service/qmail-send
echo "* Restarting qmail-smtpd."
svc -u /service/qmail-smtpd
;;
cdb)
tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
chmod 644 /etc/tcp.smtp.cdb
echo "Reloaded /etc/tcp.smtp."
;;
help)
cat <<HELP
stop -- stops mail service (smtp connections refused, nothing goes out)
start -- starts mail service (smtp connection accepted, mail can go out)
pause -- temporarily stops mail service (connections accepted, nothing leaves)
cont -- continues paused mail service
stat -- displays status of mail service
cdb -- rebuild the tcpserver cdb file for smtp
restart -- stops and restarts smtp, sends qmail-send a TERM & restarts it
doqueue -- schedules queued messages for immediate delivery
reload -- sends qmail-send HUP, rereading locals and virtualdomains
queue -- shows status of queue
alrm -- same as doqueue
flush -- same as doqueue
hup -- same as reload
HELP
;;
*)
echo "Usage: $0 {start|stop|restart|doqueue|flush|reload|stat|pause|cont|cdb|queue|help}"
exit 1
;;
esac
exit 0
[root@host netqmail-1.05]# chmod 755 /etc/rc.d/init.d/qmail
[root@host netqmail-1.05]# chkconfig --add qmail
[root@host netqmail-1.05]# chkconfig --level 345 qmail on
[root@host netqmail-1.05]# mv /usr/lib/sendmail /usr/lib/sendmail.org
mv: cannot stat `/usr/lib/sendmail': No such file or directory
[root@host netqmail-1.05]# mv /usr/sbin/sendmail /usr/sbin/sendmail.org
mv: cannot stat `/usr/sbin/sendmail': No such file or directory
[root@host netqmail-1.05]# ln -s /var/qmail/bin/sendmail /usr/lib
[root@host netqmail-1.05]# ln -s /var/qmail/bin/sendmail /usr/sbin
[root@host netqmail-1.05]# echo master > /var/qmail/alias/.qmail-root
[root@host netqmail-1.05]# echo master > /var/qmail/alias/.qmail-postmaster
[root@host netqmail-1.05]# echo master > /var/qmail/alias/.qmail-mailer-daemon
[root@host netqmail-1.05]# chmod 644 /var/qmail/alias/.qmail*
[root@host netqmail-1.05]# /etc/rc.d/init.d/qmail start
Starting qmail
[root@host netqmail-1.05]# ps ax
2975 ? Ss 0:00 /bin/sh /command/svscanboot
3039 ? S 0:00 svscan /service
3040 ? S 0:00 readproctitle service errors: ..........................................................................
....
25218 ? S 0:00 supervise qmail-smtpd
25219 ? S 0:00 supervise log
25220 ? S 0:00 supervise qmail-send
25222 ? S 0:00 /usr/local/bin/multilog t /var/log/qmail/smtpd
25224 ? S 0:00 supervise log
25225 ? S 0:00 /usr/local/bin/multilog t /var/log/qmail
25272 ? S 0:00 qmail-send
25273 ? S 0:00 /usr/local/bin/tcpserver -vRHl0 -x /etc/tcp.smtp.cdb -u id -u qmaild -g id -
25274 ? S 0:00 splogger qmail
25275 ? S 0:00 qmail-lspawn ./Maildir/
25276 ? S 0:00 qmail-rspawn
25277 ? S 0:00 qmail-clean
[root@host ~]# pstree
|-svscanboot-+-readproctitle
| `-svscan-+-supervise---tcpserver
| |-2*[supervise---multilog]
| `-supervise---qmail-send-+-qmail-clean
| |-qmail-lspawn
| |-qmail-rspawn
| `-splogger
[root@host netqmail-1.05]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
Connection closed by foreign host.
눈팅만으로는 답변글을 볼 수 없습니다. 로그인하셔야 합니다.