3. Qmail ¼³Ä¡

ÀÚ... ÇÊ¿äÇÑ ÆÄÀϵéÀÌ ¸ðµÎ ÁغñµÇ¾ú´Ù¸é ÀÏ´Ü Qmail À» ¼³Ä¡ÇÑ´Ù.

ÀÌ¹Ì qmail(¾Æ¹«·± ÆÐÄ¡µµ °¡ÇÏÁö ¾ÊÀº) À» ¼³Ä¡ÇÑ ½Ã½ºÅÛ À̶ó¸é ´ÙÀ½ÀåÀÎ vpopmail ·Î ³Ñ¾î°£´Ù.

¸¸¾à ´ç½ÅÀÌ ¿­½ÉÈ÷ sendmail ÀÌ µ¹¾Æ°¡°í ÀÖ´Â ¼­¹ö¿¡ ¼³Ä¡¸¦ ÇØ¾ß ÇÑ´Ù Çصµ °ÆÁ¤ÇÒ°ÍÀº ÀüÇô ¾ø´Ù. ÀÌ ¹®¼­¸¦ ³¡±îÁö ÀÐ°í ¸ðµç ¼³Á¤À» ¸¶Ä£ÈÄ sendmail ¿¡¼­ qmail ·ÎÀÇ ÀüȯÀº ¼öÃÊ¿¡ ³¡³¾¼ö ÀÖÀ¸¸ç, qmail µ¥¸óÀ» ½Ãµ¿Çϱâ Àü±îÁö´Â ¾Æ¹«·± ¿µÇâµµ ¹ÌÄ¡Áö ¾Ê´Â´Ù. ÇÊÀÚµµ ÇÏ·ç¿¡ ¼ö¸¸ÅëÀ» ¹è´ÞÇÏ´Â ¼­¹öµéÀ» qmail·Î ÀüȯÇϴµ¥ ¾Æ¹«·± Àå¾Öµµ ÁÖÁö ¾Ê¾Ò´Ù.

´ÙÀ½ ¼ø¼­´ë·Î ÇÏ¸é µÇ´Âµ¥ Çϳª¶óµµ Àذųª Ʋ¸®¸é ¹®Á¦°¡ »ý±â´Ï ÁÖÀÇ Çϵµ·Ï

3.1. qmail ÄÄÆÄÀÏ, ¼³Ä¡

ÀÏ´Ü Å¸º¼À» Ç®°í
tarx qmail-1.03.tar.gz
cd qmail-1.03

´ÙÀ½ µð·ºÅ丮¸¦ ¸¸µç´Ù.

mkdir /var/qmail

INSTALL.ids ¸¦ ÆíÁýÇÑ´Ù. ´ÙÀ½°ú °°ÀÌ ¸®´ª½º Ç׸ñµé¸¸ ³ö´©°í ¸í·É¾îµéÀ» ¾ðÄÚ¸àÆ® ½ÃŲ´ÙÀ½ ÀúÀå. ¸®´ª½º°¡ ¾Æ´Ï¶ó¸é ¾Ë¾Æ¼­ Çϼ¼¿ä ;-)

groupadd nofiles
useradd -g nofiles -d /var/qmail/alias alias
useradd -g nofiles -d /var/qmail qmaild
useradd -g nofiles -d /var/qmail qmaill
useradd -g nofiles -d /var/qmail qmailp
groupadd qmail
useradd -g qmail -d /var/qmail qmailq
useradd -g qmail -d /var/qmail qmailr
useradd -g qmail -d /var/qmail qmails 

sh INSTALL.ids ÇØÁÖ¸é ÇÊ¿äÇÑ À¯Àú,±×·ìÀÌ »ý¼ºµÈ´Ù. (½Ã°£ÀÌ ³²¾Æµµ´Â »ç¶÷Àº À§ ¸í·ÉµéÀ» ÇϳªÇϳª ÀÔ·ÂÇصµ ÁÁ´Ù :-))

Qmail ÄÄÆÄÀÏ Çϱâ

make
make setup check

´ÙÀ½ ±âº» control ÆÄÀϵéÀÇ ¼³Á¤À» À§ÇØ

./config

ÀÌ°ÍÀÌ Á¤»óÀûÀ¸·Î ½ÇÇà µÇ¾ú´Ù¸é /var/qmail/control/ ¾È¿¡´Â qmailÀÌ Á¤»óÀûÀ¸·Î ÀÛµ¿Çϱâ À§ÇÑ ¼³Á¤ ÆÄÀϵéÀÌ »ý°Ü¾ß ÇÑ´Ù. ¸¸¾à ±×·¸Áö ¾Ê´Ù¸é ¼­¹öÀÇ DNS ¼³Á¤¿¡ ¹®Á¦°¡ Àִ°ÍÀÌ´Ù. ´õ ÀÚ¼¼ÇÑ°ÍÀº qmail ¹®¼­¸¦ ÂüÁ¶Ç϶ó

ÀÌÂë¿¡¼­ qmailÀ» À§ÇÑ ¸î°¡Áö ºÎ¼öÀûÀÎ ÇÁ·Î±×·¥µéÀ» (ucspi-tcp , daemontools , rblsmtpd, autorespond)À» ¼³Ä¡ÇÑ´Ù. ´ÙÀ½°ú °°ÀÌ °£´ÜÇÏ´Ù.

tar xzf ucspi-tcp-0.88.tar.gz
cd ucspi-tcp-0.88
make
make setup check

tar xzf daemontools-0.70.tar.gz
cd daemontools-0.70
make
make setup check

tar xzf rblsmtpd-0.70.tar.gz
cd rblsmtpd-0.70
make setup check

tar xzf autorespond-1.0.0.tar.gz
cd autorespond-1.0.0
gcc -Wall -o autorespond autorespond.c
cp autorespond /usr/local/bin/

¸ðµÎ ÀÌ»ó¾øÀÌ ¼³Ä¡°¡ µÇ¾ú´Ù¸é ´Ù½Ã qmail À» À§ÇØ ÆÄÀÏÀ» ¸¸µç´Ù.

vi /var/qmail/rc

#!/bin/sh
exec env - PATH="/var/qmail/bin:$PATH" \
qmail-start ./Maildir/ splogger qmail

ÀÌ ÆÄÀÏ¿¡ ½ÇÇà Æ۹̼ÇÀ» ÁØ´Ù.

chmod a+x /var/qmail/rc

´ÙÀ½Àº Å¥¸ÞÀÏ µ¥¸óÀ» À§ÇÑ µð·ºÅ丮¿Í ÆÄÀϵéÀ» »ý¼º.

mkdir -p /var/qmail/supervise/qmail-send/log
mkdir -p /var/qmail/supervise/qmail-smtpd/log
chmod +t /var/qmail/supervise/qmail-send
chmod +t /var/qmail/supervise/qmail-smtpd
/var/qmail/supervise/qmail-send/run ÀÇ ³»¿ë

#!/bin/sh
exec /var/qmail/rc

/var/qmail/supervise/qmail-send/log/run ÀÇ ³»¿ë

#!/bin/sh
exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t /var/log/qmail

/var/qmail/supervise/qmail-smtpd/run ÀÇ ³»¿ë

#!/bin/sh
ALIAS_UID=`id -u alias`
ALIAS_GID=`id -g alias`
exec /usr/local/bin/softlimit -m 2000000 \
	/usr/local/bin/tcpserver -v -p -x/etc/tcp.smtp.cdb \
	-u $ALIAS_UID -g $ALIAS_GID 0 25 /var/qmail/bin/qmail-smtpd 2>&1

À§¿Í °°ÀÌ alias ÀÇ UDI,GDI ¸¦ »ç¿ë ÇÑ´Ù.

/var/qmail/supervise/qmail-smtpd/log/run ÀÇ ³»¿ë

#!/bin/sh
exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t /var/log/qmail/smtpd

ÀÌ·¸°Ô ÆíÁýÇÑ ÆÄÀϵ鿡 ½ÇÇà ±ÇÇÑÀ» ÁØ´Ù.

chmod 755 /var/qmail/supervise/qmail-send/run
chmod 755 /var/qmail/supervise/qmail-send/log/run
chmod 755 /var/qmail/supervise/qmail-smtpd/run
chmod 755 /var/qmail/supervise/qmail-smtpd/log/run

´ÙÀ½Àº qmail-smtpd ¸¦ À§ÇÑ ·Î±× µð·ºÅ丮 ¸¸µé±â

mkdir -p /var/log/qmail/smtpd
chown qmaill /var/log/qmail /var/log/qmail/smtpd

´ÙÀ½ ÆÄÀÏ¿¡´Â qmail smtp µ¥¸óÀÌ ¸ÞÀÏÀ» Áß°èÇÒ ÁÖ¼Ò¸¦ Àû¾îÁÖ´Â °ÍÀÌ´Ù. 192.168.1.1 Àº ´ç¿¬È÷ ¼³Ä¡ÇÒ ¼­¹öÀÇ ÁÖ¼Ò·Î ¹Ù²ã¾ß ÇÑ´Ù. ±×¿Ü ¸ÞÀÏÀ» Áß°è ÇØÁÙ ¼­¹öÀÇ ÁÖ¼Ò°¡ ÀÖ´Ù¸é °°Àº Çü½ÄÀ¸·Î Ãß°¡ÇÑ´Ù.

/etc/tcp.smtp ÀÇ ³»¿ë

127.0.0.1:allow,RELAYCLIENT=""
192.168.1.1:allow,RELAYCLIENT=""

ÈÄ¿¡ ÀÌ ÆÄÀÏ¿¡ º¯°æÀÌ ÀÖ´Â °æ¿ì ´ÙÀ½ÀÇ qmail ºÎÆ® ½ºÅ©¸³Æ®¸¦ ÀÌ¿ëÇØ ´ÙÀ½°ú °°ÀÌ ÇÑ´Ù.

/etc/rc.d/init.d/qmail cdb

3.2. ¾Ë¸®¾Æ½º ¼³Á¤

¸¸¾à ÁÖ µµ¸ÞÀÎÀÇ ¸ÞÀÏ °èÁ¤µéµµ ¸ðµÎ vpopmail ·Î °ü¸®ÇÒ °ÍÀÌ ¾Æ´Ï¶ó¸é (ÇÊÀÚ´Â ÁÖ µµ¸ÞÀÎÀÇ ¸ÞÀÏ °èÁ¤µéµµ ¸ðµÎ vpopmail ·Î °ü¸®ÇÒ°ÍÀ» ±ÇÀåÇÑ´Ù.) ¸î°¡Áö ¾Ë¸®¾Æ½º¸¦ ¼³Á¤ÇØ ÁØ´Ù. ¿©±â¼­ silver ´Â root, postmaster µîÀ¸·Î ¿À´Â ¸ÞÀÏÀ» ¹ÞÀ» ÀÏ¹Ý °èÁ¤ÀÌ´Ù.

cd ~alias
echo silver > .qmail-mailer-daemon
echo silver > .qmail-postmaster
echo silver > .qmail-root

3.3. qmail ºÎÆ® ÆÄÀÏ

´ÙÀ½Àº qmail µ¥¸óÀÇ ºÎÆ® ½ºÅ©¸³Æ®ÀÌ´Ù.

#!/bin/sh
# Comments to support chkconfig on RedHat Linux
# chkconfig: 2345 80 80
# description: sendmailÀ» ´ëüÇÏ´Â ºü¸£¸ç, ¾ÈÁ¤ÀûÀÌ°í, À¯¿¬ÇÑ MTA

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

PATH=/var/qmail/bin:/usr/local/bin:/usr/bin:/bin
export PATH

case "$1" in
  start)
    echo -n "Starting qmail: svscan"
    cd /var/qmail/supervise
    env - PATH="$PATH" svscan &
    echo $! > /var/run/svscan.pid
    echo "."
    ;;
  stop)
    echo -n "Stopping qmail: svscan"
    kill `cat /var/run/svscan.pid`
    echo -n " qmail"
    svc -dx /var/qmail/supervise/*
    echo -n " logging"
    svc -dx /var/qmail/supervise/*/log
    echo "."
    ;;
  stat)
    cd /var/qmail/supervise
    svstat * */log
    ;;
  doqueue|alrm)
    echo "Sending ALRM signal to qmail-send."
    svc -a /var/qmail/supervise/qmail-send
    ;;
  queue)
    qmail-qstat
    qmail-qread
    ;;
  reload|hup)
    echo "Sending HUP signal to qmail-send."
    svc -h /var/qmail/supervise/qmail-send
    ;;
  pause)
    echo "Pausing qmail-send"
    svc -p /var/qmail/supervise/qmail-send
    echo "Pausing qmail-smtpd"
    svc -p /var/qmail/supervise/qmail-smtpd
    ;;
  cont)
    echo "Continuing qmail-send"
    svc -c /var/qmail/supervise/qmail-send
    echo "Continuing qmail-smtpd"
    svc -c /var/qmail/supervise/qmail-smtpd
    ;;
  restart)
    echo "Restarting qmail:"
    echo "* Stopping qmail-smtpd."
    svc -d /var/qmail/supervise/qmail-smtpd
    echo "* Sending qmail-send SIGTERM and restarting."
    svc -t /var/qmail/supervise/qmail-send
    echo "* Restarting qmail-smtpd."
    svc -u /var/qmail/supervise/qmail-smtpd
    ;;
  cdb)
    tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
    chmod 644 /etc/tcp.smtp*
    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 -- sends qmail-send ALRM, scheduling queued messages for delivery
 reload -- sends qmail-send HUP, rereading locals and virtualdomains
  queue -- shows status of queue
   alrm -- same as doqueue
    hup -- same as reload
HELP
    ;;
  *)
    echo "Usage: $0 {start|stop|restart|doqueue|reload|stat|pause|cont|cdb|queue|help}"
    exit 1
    ;;
esac

exit 0

À§ÀÇ °ÍÀ» ±×´ë·Î º¹»ç,ÀúÀå Çϰųª ÀÌ°÷¿¡¼­ ¹Þ´Â´Ù. http://kltp.kldp.org/tmp/qmail.txt. ÀÌ°ÍÀ» /etc/rc.d/init.d/ ¿¡ qmail À̶ó´Â À̸§À¸·Î ÀúÀåÇÑÈÄ ½ÇÇà Æ۹̼ÇÀ» ÁØ´Ù. ´ÙÀ½ ntsysv ½ÇÇà½ÃÅ°¸é qmail À̶ó´Â »õ·Î¿î Ç׸ñÀÌ º¸ÀÏ°ÍÀÌ´Ù. ¸®ºÎÆà ÇÒ¶§ qmail µ¥¸óÀÌ ½ÇÇàµÇµµ·Ï üũÇØÁØ´Ù. ´ç¿¬È÷ sendmail Àº ¾ðüũ. (redhat ÀÌ¿Ü °è¿­ÀÇ ¹èÆ÷º»Àº ¾Ë¾Æ¼­ Çϼ¼¿ä. ºÎÆÃÇÒ¶§ ¶ßµµ·Ï ;-))

qmail ¼³Ä¡ ³¡~

º¹Àâ ÇÑµí ½ÍÁö¸¸ ¾Ë°í º¸¸é ±×·¸Áöµµ ¾Ê´Ù ;-) ÀÌÂë¿¡¼­ ÀØÀº°ÍÀÌ ¾ø´ÂÁö óÀ½ºÎÅÍ ÇϳªÇϳª ´Ù½Ã »ìÆ캸´Â °Íµµ ÁÁ°Ú´Ù. Àß ¼³Ä¡µÈ qmailÀ» ¸¶Áö¸· ±× ¼ø°£(?)±îÁö Àß ³öµÎ°í ´ÙÀ½ÀåÀ¸·Î ³Ñ¾î°¡ÀÚ.