qmailÀ̶õ?
¸®´ª½º¿¡¼ ¸ÞÀϼ¹ö¸¦ ±¸ÃàÇÑ´Ù°í ÇßÀ»¶§ ´ëºÎºÐ °í·ÁÇϴ°ÍÀÌ sendmail ¶Ç´Â qmailÀÏ °ÍÀÔ´Ï´Ù.(postfix¡¦±Û½ê) ±âÁ¸¿¡´Â sendmailÀ» »ç¿ëÇØ ¿Ô´Âµ¥ »õ·Î¿î ¼¹ö·Î ±³Ã¼ÇÏ¸é¼ À̹ø¿¡´Â qmailÀ» »ç¿ëÇÏ°í ½Í¾î ÀÌ°ÍÀú°Í ¾Ë¾Æº¸°í ¼³Ä¡ÇÑ ³»¿ëÀ» Á¤¸®ÇÑ ±ÛÀÔ´Ï´Ù.
¿©±â¼ °£´ÜÈ÷ sendmail°ú qmailÀ» º¸¸é,,
- sendmail : Unix±â¹Ý ȯ°æ¿¡¼ ¿À·£±â°£ »ç¿ëÇØ ¿Â ´ëÇ¥ÀûÀÎ SMTP ÇÁ·Î±×·¥À¸·Î °¡Àå ¸¹ÀÌ(?) »ç¿ëÁßÀÎ ÇÁ·Î±×·¥ÀÌ´Ù. RPMÀ¸·Î ½±°Ô ¼³Ä¡ÇÒ ¼ö ÀÖ°í, ¿À·£±â°£¿¡ °ÅÃÄ ÀÎÅÍ³Ý»ó¿¡ ¸¹Àº ÀÚ·á°¡ ÀÖ¾î ¹®Á¦ÇØ°á¿¡ ½±´Ù. ±×·¯³ª ¸ÞÀÏ¿¡ ´ëÇÑ ¾ÈÁ¤¼º, º¸¾ÈÀÇ Ãë¾à¼º, »ç¿ëÀÚ¸¦ Ãß°¡Çϱâ À§ÇØ ¼¹ö¿¡ °èÁ¤À» ¸¸µé¾î¾ß Çϸç, ¸ÖƼÇÁ·Î¼¼½º¸¦ Áö¿øÇÏ´Â qmail¿¡ ºñÇØ ´ÜÀÏ ÇÁ·Î¼¼½º·Î ±¸µ¿µÇ±â ¶§¹®¿¡ ¼º´É»óÀÇ À̽´µîÀÇ ´ÜÁ¡ÀÌ ÀÖ´Ù. ÀÌÁß¿¡¼ º¸¾È»óÀÇ Ãë¾à¼ºÀº °¡Àå Å« ´ÜÁ¡ÀÌ µÇ°í ÀÖ´Ù.
- qmail : sendmailÀÇ ´ÜÁ¡ÀÌ °ð qmailÀÇ ÀåÁ¡ÀÌ µÉ °ÍÀÌ´Ù. º¸¾È¼º, ½Å·Ú¼º, ¼Óµµ, È¿À²¼ºÀÌ ³ôÀº MTAÇÁ·Î±×·¥ÀÌ´Ù.(Sendmail¿¡ ºñÇØ¡¦).
°£´ÜÈ÷ qmailÀÇ Æ¯Â¡°ú ÀåÁ¡À» º¸¸é ´ÙÀ½°ú °°´Ù.
- º¸¾È¼º : SendmailÀÌ Ã³À½ ¸¸µé¾îÁ³À»¶§´Â ³ôÀº º¸¾ÈÀ» ¿ä±¸ÇÏÁö ¾Ê¾Ò´Ù, Áï º¸¾ÈÀ» °í·ÁÇÏÁö ¾ÊÀº »óÅ¿¡¼ ¸¸µé¾îÁø ÇÁ·Î±×·¥ÀÌ´Ù. ¸ÞÀÏÀÌ ´ëÁßÈµÇ¸é¼ º¸¾ÈÀÌ ´ëµÎµÇ¾ú°í, SendmailÀº º¸¾È¿¡ Ãë¾àÇÒ ¼ö ¹Û¿¡ ¾ø¾ú´Ù. qmailÀº ³ôÀº º¸¾ÈÀ» À§ÇØ ¼³°èµÇ¾ú´Ù. ±×·¸±â ¶§¹®¿¡ º¸¾È¿¡ °ÇÏ´Ù.
- ½Å·Ú¼º : ¼ö½ÅµÈ ¸ÞÀÏ¿¡ ´ëÇؼ ¼Õ½ÇÀÌ ¾øÀ½À» º¸ÀåÇÑ´Ù. ½Ã½ºÅÛÀÌ ´Ù¿îµÇ´õ¶óµµ ¸ÞÀÏÀ» ÀÒ¾î¹ö¸®´Â °æ¿ì°¡ ¾ø´Ù.
- ¼º´É : qmailÀº ±âº»ÀûÀ¸·Î 20°ÇÀ» µ¿½Ã¿¡ ¸ÞÀÏÀ» Àü¼ÛÇÒ ¼ö ÀÖ´Ù. ±×·¯¹Ç·Î ¸¹Àº ¸ÞÀÏÀ» µ¿½Ã¿¡ Àü¼ÛÇØ¾ß ÇÏ´Â °æ¿ì Ź¿ùÇÑ ¼º´ÉÀ» ¹ßÈÖÇÑ´Ù.
- È¿À²¼º : qmail ´Ù¸¥ ¾î¶°ÇÑ ±â´ÉÀ» °¡Áø MTAº¸´Ù ÀÛ°Ô ¼³°èµÇ¾ú´Ù. ±×·¯¹Ç·Î ³·Àº ½Ã½ºÅÛ¿¡¼µµ ¼º´ÉÀ» ¹ßÈÖ ÇÒ ¼ö ÀÖ´Ù.
¾î¶² ¹æ¹ýÀ¸·Î ¼³Ä¡ÇÑ°Ç°¡?
¸·»ó ¼³Ä¡¸¦ ÇÏ·Á°í ÇÏ´Ï ¸·¸·Çѵ¥ sendmail°°ÀÌ ½±°Ô ¼³Ä¡°¡ µÇÁö ¾Ê°í º¸¸é ¿©·¯°¡Áö ¼³Ä¡ ¹æ¹ý°ú ¸ðµâÀÌ Á¸ÀçÇÑ´Ù. ±×·±µ¥ ÃÖ±Ù¿¡ ¿Ã¶ó¿Â ±ÛµéÀ» º¸¸é ´ë¼¼´Â ´ÙÀ½°ú °°ÀÌ ¼³Ä¡ÇÏ´Â ¹æ¹ýµéÀÌ´Ù.
- netqmail + vpopmail + patch¼³Ä¡(date-localtime.path + smtpauth.path,¡¦. )
- netqmail + vpopmail + knetqmail
netqmailÀº qmail¿¡ ¸î°¡Áö ÆÐÄ¡¸¦ Àû¿ëÇØ °³¼±ÇÑ ¹öÀüÀÌ°í vpopmailÀº qmail°ú ¿¬µ¿ÇÏ¿© ¼öÇàµÇ´Â pop3ÇÁ·Î±×·¥À¸·Î ±× ¹Û¿¡µµ °¡»ó µµ¸ÞÀÎ ¹× »ç¿ëÀÚ °ü¸®µîÀÇ ±â´ÉÀ» Á¦°øÇÏ°í mysql°ú ¿¬µ¿ÇÏ¿© ÀÌ Á¤º¸¸¦ °ü¸®ÇÒ ¼ö°¡ ÀÖ´Ù. vpopmailÀº qmail»ó¿¡¼ ¼öÇàÇÏ´Â ÇÁ·Î±×·¥À¸·Î ¼³Ä¡ ÀÌÀü¿¡ qmailÀÌ ¼³Ä¡µÇ¾î ÀÖ¾î¾ß ÇÑ´Ù.
knetqmail˼
http://qmail.kldp.net¿¡¼ netqmail¿¡ ¸î°¡Áö ÆÐÄ¡(date-localtime.path, smtpauth.path)¸¦ Àû¿ëÇÑ qmail ¸ðµâÀÌ´Ù. knetqmail´Â vpopmail¿¡ Á¾¼ÓµÇ¾î ÀÖ´Ù. Áï, knetqmailÀ» ¼³Ä¡ÇÏ·Á¸é vpopmailÀÌ ¼³Ä¡ µÇ¾î ÀÖ¾î¾ß ÇÏ°í vpopmailÀ» ¼³Ä¡Çϱâ À§Çؼ´Â qmailÀÌ ¼³Ä¡µÇ¾î ÀÖ¾î¾ß ÇϹǷΠnetqmailÀ» ¼³Ä¡ÇØ¾ß ÇÑ´Ù. ¹æ¹ý2)
¸¸¾à,, knetqmail¸¦ ¼³Ä¡ÇÏÁö ¾ÊÀ» °æ¿ì ÆÐÄ¡¸¦ Á÷Á¢ ¼³Ä¡ÇÑ´Ù. (qmail-date-localtime.path, smtpauth.pathµî¡¦) – ¹æ¹ý1)
qmail ¼³Ä¡Àü¿¡ vpopmailÀ» ¼³Ä¡ÇÏ´Â ¹æ¹ý |
* vpopmailÀ» ¼³Ä¡Çϱâ À§Çؼ´Â qmailÀÌ ¼³Ä¡µÇ¾î ÀÖ¾î¾ß Çϴµ¥ ÀÌÀ¯´Â vpopmail ÄÄÆÄÀϽà qmail°ü·Ã ÆÄÀÏ°ú Æú´õ°¡ Á¸ÀçÇÏ´ÂÁö¸¦ ¿ä±¸Çϱ⶧¹®ÀÌ´Ù. ±×·¸±â¶§¹®¿¡ °ü·Ã ÆÄÀÏ°ú Æú´õ¸¦ ¸¸µé¾î ³õ±â¸¸ Çϸé qmail ¼³Ä¡Çϱâ Àü¿¡ ¼³Ä¡ÇÒ ¼ö°¡ ÀÖ½À´Ï´Ù.
mkdir /var/qmail/ mkdir /var/qmail/bin touch /var/qmail/bin/qmail-inject touch /var/qmail/bin/qmail-newu touch /var/qmail/bin/qmail-newmrh
¸¸¾à ÀÌ·¸°Ô ¼³Ä¡ ÇÒ °æ¿ì netqmailÀ» ¼³Ä¡ÇÏÁö ¾Ê°í vpopmail + knetqmail¸¸À¸·Î ¼³Ä¡°¡ °¡´ÉÇÏ´Ù. ±×·¯³ª ¾îÂ÷ÇÇ ¼³Á¤ÇØ¾ß µÉ ¾çÀº ¶È°°°í, ¿ÀÈ÷·Á À§¿Í °°ÀÌ ÇÏ´Â°Ô ´õ ºÒÆíÇÒ ¼ö°¡ ÀÖ´Ù. ±×·¯¹Ç·Î ±×³É netqmail + vpopmail + knetqmailÀ¸·Î ¼³Ä¡Çϴ°ÍÀ» ±ÇÀåÇÑ´Ù. |
qmailÀ» ¼³Ä¡ÇϱâÀü¿¡ ucspi-tcp, daemontools°¡ ¼³Ä¡µÇ¾î ÀÖ¾î¾ß ÇÑ´Ù.
ucspi-tcp´Â inetd, xinetdº¸´Ù ³ôÀº ¼º´ÉÀ» ³»´Â tcp°ü·Ã ¸ðµâ·Î, qmailÀº µ¿½Ã¿¡ ó¸®ÇÒ¼ö ÀÖ´Â ´É·Â¿¡ ºñÇØ inetd°¡ ¹ÞÃÄÁÖÁö ¸øÇϱ⶧¹®¿¡ tcpserver¸¦ »ç¿ëÇÑ´Ù. ¶ÇÇÑ Á¢±ÙÁ¦ÇѱÔÄ¢(tcprules)À» Àû¿ëÇÒ ¼ö ÀÖ¾î ¸±·¹ÀÌ Á¤Ã¥¿¡ È¿À²ÀûÀ¸·Î ´ëóÇÒ¼ö ÀÖ°Ô ÇØ ÁØ´Ù.
daemontoolsÀº ÇÁ·Î¼¼½º(service)¿Í ·Î±×(multilog)¸¦ °ü¸®ÇØ ÁÖ±â À§ÇÑ daemon tool·Î½á sendmail°°ÀÌ ´ÜÀÏ ÇÁ·Î¼¼½º°¡ ¾Æ´Ñ qmailÀº ¿©·¯ ÀÛÀº ÇÁ·Î¼¼½º°¡ ¼öÇàµÇ´Âµ¥ À̸¦ È¿À²ÀûÀ¸·Î °ü¸®ÇØÁÖ±â À§ÇØ »ç¿ëÇÏ°Ô µÈ´Ù.
* ÀÌ ¹®¼´Â netqmail + vpopmail + knetqmail ¹æ¹ýÀÌ°í, vpopmailÀÇ ÀÎÁõ ¸ðµâÀº MySQLÀ» »ç¿ëÇÏ°í, smtpÀÎÁõÀº vchkpw¸¦ ÀÌ¿ë¿¡ ´ëÇÑ °¡À̵幮¼ÀÌ´Ù.
ÇÊ¿äÇÑ ÇÁ·Î±×·¥µéÀº?
¼³Ä¡¿¡ ÇÊ¿äÇÑ ÇÁ·Î±×·¥À»Àº ´ÙÀ½°ú °°½À´Ï´Ù.
► À§ ´Ù¿î·Îµå URLÀº ÇØ´ç ¸ðµâÀÇ Home page ±âÁØÀ¸·Î ´Ù¿î¹ÞÀ» ¼ö ÀÖ´Â °÷Àε¥,
http://qmail.ixip.net/download/ ÀÌ°÷¿¡ qmail°ú °ü·ÃµÈ ´ëºÎºÐ ÇÁ·Î±×·¥À» ¸ð¾Æ ³õÀº °÷À̱⠶§¹®¿¡ ÀÌ°ÍÀ» ÂüÁ¶Çؼ ´Ù¿î¹Þ¾Æµµ µË´Ï´Ù.
► C comipler, MySQLÀº ¼³Ä¡µÇ¾î ÀÖ¾î¾ß ÇÕ´Ï´Ù.
´Ù¿î¹Þ±â
/usr/local/srcÆú´õ¿¡ qmail µð·ºÅ丮¸¦ ¸¸µé°í À§ ÇÁ·Î±×·¥À» ´Ù¿î¹Þ´Â´Ù.
[root@monteapps qmail]# ls -l
total 1360
-rw-r--r-- 1 root root 36975 Jul 13 2001 daemontools-0.76.tar.gz
-rw-r--r-- 1 root root 357893 Oct 4 09:42 knetqmail-1.06-20110908.tar.gz
-rw-r--r-- 1 root root 37973 Apr 24 2011 libdomainkeys-0.68.tar.gz
-rw-r--r-- 1 root root 525 Apr 24 2011 libdomainkeys.diff
-rw-r--r-- 1 root root 260941 Jan 29 2011 netqmail-1.06.tar.gz
-rw-r--r-- 1 root root 53019 Mar 19 2000 ucspi-tcp-0.88.tar.gz
-rw-r--r-- 1 root root 612426 Nov 9 2010 vpopmail-5.4.32.tar.gz
¼³Ä¡Çϱâ
ucspi-tcp
¼³Ä¡´Â °£´ÜÇѵ¥ ¾ÐÃàÇ®°í, make ; make setup checkÇÏ¸é µÈ´Ù. ¼³Ä¡°¡ ¿Ï·áµÇ¸é /usr/local/bin/¿¡ tcpserverµî tcp* °ü·Ã ÇÁ·Î±×·¥µéÀÌ ¼³Ä¡µÈ´Ù.
[root@qmail]# tar xvfz ucspi-tcp-0.88.tar.gz
[root@qmail]# cd ucspi-tcp-0.88
[root@qmail]# make
[root@qmail]# make setup check
* gcc version 3 ÀÌ»óÀÏ °æ¿ì, error.h ÆÄÀÏÀÇ ÃÖ»ó´Ü¿¡ ¡°#include <errno.h>¡± ¸¦ Ãß°¡ÇØ ÁÖ¾î¾ß ÇÑ´Ù. ±×·¸Áö ¾ÊÀ¸¸é ¾Æ·¡¿Í °°Àº ¿¡·¯°¡ ¹ß»ýÇÑ´Ù.
[error.h]
#include <errno.h>
#ifndef ERROR_H
#define ERROR_H
extern int errno;
extern int error_intr;
extern int error_nomem;
extern int error_noent;
¡¦¡¦¡¦¡¦
[¿¡·¯³»¿ë]
/usr/bin/ld: errno: TLS definition in /lib64/libc.so.6 section .tbss mismatches non-TLS
reference in tcpserver.o
/lib64/libc.so.6: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [tcpserver] Error 1
[root@monteapps ucspi-tcp-0.88]#
daemontools
datemontoots´Â UNIX ServiceµéÀ» °ü¸®Çϱâ À§ÇÑ ToolµéÀÌ´Ù. supervise´Â service¸¦ ¸ð´ÏÅ͸µÇϸç service¸¦ start/stop½ÃÄÑ ÁÖ¸ç ¸¸¾à service°¡ Á×¾úÀ» °æ¿ì ÀÚµ¿ÀûÀ¸·Î restart½ÃÄÑÁÖ´Â µîÀÇ ¿ªÇÒÀ» ÇØÁÝ´Ï´Ù.
► ucspi-tcp¿Í ¸¶Âù°¡Áö·Î ÄÄÆÄÀϽà ¿¡·¯°¡ ¹ß»ýÇϸé error.h ÆÄÀÏÀÇ ¸Ç óÀ½¿¡ ¡°#include <errno.h>¡± ¸¦ Ãß°¡ÇØ ÁÝ´Ï´Ù.
1. /package Directory¸¦ ¸¸µç´Ù.
[root@qmail]# mkdir -p /package
[root@qmail]# chmod 1755 /package
[root@qmail]# cd /package
2. daemontools-0.7.tar.gz ÆÄÀÏ¿¡ ´ëÇؼ ¾ÐÃàÀ» Ç®°í, Ǭ Æú´õ·Î À̵¿ÇÑ´Ù.
[root@admin]# tar xfz /usr/local/src/qmail/daemontools-0.76.tar.gz
[root@admin]# cd admin/daemontools-0.76
3. package/install¸¦ ÅëÇØ ÄÄÆÄÀÏÇÏ°í ¼³Ä¡ÇÑ´Ù.
[root@daemontools-0.76]# package/install
¼³Ä¡°¡ ¼º°øÀûÀ¸·Î µÇ¾úÀ¸¸é /command Æú´õ¿¡ ¾Æ·¡¿Í °°ÀÌ ÆÄÀϵéÀÌ À§Ä¡ÇÏ°Ô µÈ´Ù.
[root@command]# ls -l
total 0
lrwxrwxrwx 1 root root 41 Oct 2 20:29 envdir -> /package/admin/daemontools/command/envdir
lrwxrwxrwx 1 root root 44 Oct 2 20:29 envuidgid -> /package/admin/daemontools/command/envuidgid
lrwxrwxrwx 1 root root 41 Oct 2 20:29 fghack -> /package/admin/daemontools/command/fghack
lrwxrwxrwx 1 root root 43 Oct 2 20:29 multilog -> /package/admin/daemontools/command/multilog
lrwxrwxrwx 1 root root 43 Oct 2 20:29 pgrphack -> /package/admin/daemontools/command/pgrphack
lrwxrwxrwx 1 root root 48 Oct 2 20:29 readproctitle -> /package/admin/daemontools/command/readproctitle
lrwxrwxrwx 1 root root 42 Oct 2 20:29 setlock -> /package/admin/daemontools/command/setlock
lrwxrwxrwx 1 root root 44 Oct 2 20:29 setuidgid -> /package/admin/daemontools/command/setuidgid
lrwxrwxrwx 1 root root 44 Oct 2 20:29 softlimit -> /package/admin/daemontools/command/softlimit
lrwxrwxrwx 1 root root 44 Oct 2 20:29 supervise -> /package/admin/daemontools/command/supervise
lrwxrwxrwx 1 root root 38 Oct 2 20:29 svc -> /package/admin/daemontools/command/svc
lrwxrwxrwx 1 root root 39 Oct 2 20:29 svok -> /package/admin/daemontools/command/svok
lrwxrwxrwx 1 root root 41 Oct 2 20:29 svscan -> /package/admin/daemontools/command/svscan
lrwxrwxrwx 1 root root 45 Oct 2 20:29 svscanboot -> /package/admin/daemontools/command/svscanboot
lrwxrwxrwx 1 root root 41 Oct 2 20:29 svstat -> /package/admin/daemontools/command/svstat
lrwxrwxrwx 1 root root 41 Oct 2 20:29 tai64n -> /package/admin/daemontools/command/tai64n
lrwxrwxrwx 1 root root 46 Oct 2 20:29 tai64nlocal -> /package/admin/daemontools/command/tai64nlocal
¸¶Áö¸·À¸·Î /etc/inittab ¸Ç ¸¶Áö¸·¿¡ ¾Æ·¡¿Í °°ÀÌ Ãß°¡ÇØ ÁØ´Ù.
SV:123456:respawn:/command/svscanboot
netqmail
netqmail ¼³Ä¡´Â »ç¿ëÀÚ °èÁ¤°ú ±×·ì»ý¼º ÈÄ ¾ÐÃàÇ®°í, ¼³Ä¡ÇÏ¸é µÈ´Ù. ±¸µ¿À» À§ÇÑ ½ºÅ©¸³Æ®¿Í °ü·Ã Æú´õ »ý¼º¼øÀ¸·Î ÁøÇàµÈ´Ù.
► ucspi-tcp¿Í ¸¶Âù°¡Áö·Î ÄÄÆÄÀϽà ¿¡·¯°¡ ¹ß»ýÇϸé error.h ÆÄÀÏÀÇ ¸Ç óÀ½¿¡ ¡°#include <errno.h>¡± ¸¦ Ãß°¡ÇØÁØ´Ù.
1. qmail »ç¿ëÀÚ ¹× ±×·ì »ý¼º
»ç¿ëÀÚ¹× ±×·ì »ý¼º ¹æ¹ýÀº OS º°·Î Á¶±Ý¾¿ ´Ù¸£±â ¶§¹®¿¡, ¾ÐÃàÀ» Ǭ °÷¿¡ INSTALL.ids ÆÄÀÏ ¾È¿¡ OSº°·Î ¸í½ÃµÇ¾î ÀÖ´Â ³»¿ëÀ» ÂüÁ¶Çؼ »ý¼ºÇÑ´Ù.
# 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
2. ¾ÐÃà ÇØÁ¦
[root@qmail]# tar xfz netqmail-1.06.tar.gz
[root@qmail]# cd netqmail-1.06
3. ÄÄÆÄÀÏ
[root@netqmail-1.06]# make
[root@netqmail-1.06]# make setup check
4. ±âº» domain ¼³Á¤
DNS°¡ Á¦´ë·Î ¼³Á¤µÇ¾î ÀÖ´Ù¸é , ¡°./config¡± ½ºÅ©¸³Æ®¸¦ ½ÇÇàÇϸé ÀÚµ¿ÀûÀ¸·Î ¼³Á¤ÀÌ µÈ´Ù.
./config
¸¸¾à ¾î¶°ÇÑ ÀÌÈÄ·Î Á¦´ë·Î ½ÇÇàÀÌ ¾ÈµÈ´Ù¸é, ¡°./config-fast¡± ½ºÅ©¸³Æ®¸¦ ÅëÇØ ¼³Á¤ÇÒ¼ö ÀÖ´Ù. Çü½ÄÀº ¡°./config-fast hostname.domainnam¡± ÀÌ´Ù.
[root@netqmail-1.06]# config-fast hostname.userdomain.com
Your fully qualified host name is userdomain.com.
Puttinguserdomain.com into control/me¡¦
Putting userdomain.com into control/defaultdomain¡¦
Putting userdomain.com into control/plusdomain¡¦
Putting userdomain.com into control/locals¡¦
Putting userdomain.com into control/rcpthosts¡¦
Now qmail will refuse to accept SMTP messages except to userdomain.com.
Make sure to change rcpthosts if you add hosts to locals or virtualdomains!
vpopmail
sendmail´ë½Å qamilÀ» »ç¿ëÇÏ´Â ÀÌÀ¯Áß¿¡ Çϳª°¡ qmail¿¡¼´Â vpopmail°ú ¿¬µ¿ÇÏ¿© °¡»ó µµ¸ÞÀÎ/»ç¿ëÀÚ¸¦ µî·Ï °ü¸®ÇÒ ¼ö ÀÖ´Ù´Â Á¡°ú °ü¸®¸¦ mysql°°Àº database·Î ÇÒ¼ö ÀÖ´Ù´Â Á¡ÀÌ´Ù. sendmail°°Àº °æ¿ì ¸ÞÀÏ °èÁ¤À» Ãß°¡Çϱâ À§ÇØ ½Ã½ºÅÛ °èÁ¤À» ¸¸µé¾î¾ß Çß°í, Æнº¿öµå º¯°æÀ̳ª ºÐ½Ç½Ã º¸¾È¹®Á¦µî °ü¸®ÀÚÀÔÀå¿¡¼´Â ºÒÆíÇÑ Á¡ÀÌ Çѵΰ³°¡ ¾Æ´Ï¾ú´Ù.
vpopmail ¼³Ä¡´Â ±×·ì¹× °èÁ¤ »ý¼º ÄÄÆÄÀÏ, ¼³Á¤¼øÀ¸·Î ÁøÇàµÈ´Ù. ´Ù¸¥ ¼³Ä¡¿Í ´Ù¸£°Ô ¿É¼ÇÀ» ¼³Á¤ÇÏ°í ÄÄÆÄÀÏÇؾߵǴµ¥ À̺κи¸ °í·ÁÇÏ¸é ¼³Ä¡´Â ¾î·ÆÁö ¾Ê°Ô ÁøÇàµÉ ¼ö ÀÖ´Ù.
1. vpopmail¿ë °èÁ¤¹× ±×·ì »ý¼º.
±âº»ÀûÀ¸·Î useraddÇÏ¸é ¡°/home¡± ¹Ø¿¡ Æú´õ°¡ ¸¸µé¾îÁø´Ù. ±×·¯³ª ¾î¶°ÇÑ ÀÌÀ¯·Î vpopmailÀÇ home directory¸¦ ´Ù¸¥°÷¿¡ ¸¸µé¾îÁö°Ô ÇÏ°í ½ÍÀ¸¸é useraddÇÒ¶§ ¡°–d¡± ¿É¼ÇÀ» ÁÖ¾î À§Ä¡¸¦ ÁöÁ¤ÇÒ ¼ö ÀÖ´Ù. ÁÖÀÇÇÒÁ¡Àº ÄÄÆÄÀÏ ¿É¼Ç ¼³Á¤ÇÒ¶§ –prefix¸¦ ¹Ù²ï ¸í½ÃÀûÀÎ À§Ä¡·Î ÁöÁ¤ÇØ¾ß ÇÕ´Ï´Ù.
# groupadd vchkpw
# useradd -g vchkpw vpopmail
//¸¸¾à /usr/local/vpopmail¿¡ ¼³Ä¡ÇÏ°í ½ÍÀ¸¸é,,,
# useradd -g vchkpw vpopmail –d /usr/local/vpopmail
3. ¾ÐÃàÇØÁ¦ ¹× À̵¿.
# tar xfz vpopmail-5.4.32.tar.gz
# cd vpopmail-5.4.32
3. ÄÄÆÄÀÏÀ» À§ÇÑ ¿É¼Ç ¼³Á¤.
vpopmail´Â ´Ù¾çÇÑ ¿É¼ÇÀÌ Á¸ÀçÇϴµ¥ ¿©±â¼´Â »ç¿ëÀÚ¹× µµ¸ÞÀÎ °ü¸®¸¦ MySQL·Î ÇÏ°í, smtpÀÎÁõÀº roamingÀ» »ç¿ëÇÏÁö ¾Ê°í, qmail smtp-auth¸¦ »ç¿ëÇϱ⶧¹®¿¡ ÀÌ°Í°ú °ü·ÃµÈ ¿É¼Ç¸¸ ¼³¸íÇÑ´Ù.
Option |
Desc |
–prefix |
vpopmailÀ» ¼³Ä¡ ÇÒ À§Ä¡¸¦ ÁöÁ¤ÇÑ´Ù. ÁöÁ¤À» ¾È ÇÒ °æ¿ì /home/vpopmailÀÌ µÈ´Ù. ´Ù¸¥ Æú´õ·Î ÇÏ°í ½ÍÀ¸¸é ¡°–prefix=/usr/local/vpopmail¡± °°ÀÌ ¼³Á¤ÇÑ´Ù. |
–enable-auth-module |
vpopmail °èÁ¤Á¤º¸°¡ ÀúÀåµÉ ¹æ½ÄÀÌ´Ù. ±âº»°ªÀº cdbÀÌ°í, mysql, pgsql,ldap, oracle, sybase, or activedir µîÀ» ÁöÁ¤ÇÒ ¼ö ÀÖ´Ù. |
–enable-logging |
syslog(/var/log/maillog ¶Ç´Â /var/log/messages)¿¡ ±â·ÏµÉ log ¼öÁØÀ» ÁöÁ¤ÇÑ´Ù. n=¾Æ¹«°Íµµ ±â·Ï¾ÈÇÔ. – nothing – e=errorÀÎ °æ¿ì(default) y=All p= password°ü·Ã error¸¸ ±â·Ï. v= verbose |
–enable-incdir |
MySQL inlcude Æú´õ À§Ä¡. |
–enable-libdir |
MySQL lib Æú´õ À§Ä¡. |
–enable-domains-dir |
domains Æú´õ¸¦ ¸í½ÃÀûÀ¸·Î ÁöÁ¤ÇÕ´Ï´Ù. ÁöÁ¤À» ¾È ÇÒ °æ¿ì {prefix}/domains°¡ µÈ´Ù.
* ÀÌ À§Ä¡¿¡ domainº°·Î ±× ¾È¿¡´Â »ç¿ëÀÚº°·Î ¸ÞÀÏÀÌ ½×ÀÌ°Ô µÊ. »ç¿ëÀÚ°¡ ¸¹¾Æ Å« °ø°£ÀÌ ÇÊ¿ä ÇÑ °æ¿ì³ª ±×¹Û¿¡ °ü¸®Â÷¿ø¿¡¼ ´Ù¸¥ Æú´õ·Î ÁöÁ¤ÇÏ°í ½ÍÀº °æ¿ì »ç¿ë. |
–enable-tcprules-prog |
tcprules ÇÁ·Î±×·¥ÀÌ ÀÖ´Â Àüü À§Ä¡. ÁöÁ¤À» ¾È ÇÒ °æ¿ì /usr/{local}/bin/tcprules °¡ µÈ´Ù.
* ¡°–enable-roaming-users¡± optionÀÌ ¡°y¡±À϶§¸¸ À¯È¿ÇÑ ¿É¼Ç. |
–enable-tcpserver-file |
vpopmail¿¡¼ »ç¿ëÇÒ tcp.smtp ÆÄÀÏÀÇ ÀüÁ¦ À§Ä¡. ÁöÁ¤À» ¾È ÇÒ °æ¿ì prefix·Î ÁöÁ¤µÈ °÷¿¡ etc/tcp.smtp°¡ µÈ´Ù. {prefix}/etc/tcp.smtp
* ¡°–enable-roaming-users¡± optionÀÌ ¡°y¡±À϶§¸¸ À¯È¿ÇÑ ¿É¼Ç. |
À§ optionÁß MySQL·Î °ü¸®Çϱâ À§ÇØ ¡°–enable-auth-module¡±Àº mysql·Î ÁöÁ¤ÇØ¾ß µÇ°í ³ª¸ÓÁö´Â ȯ°æ¿¡ ¸Â°Ô ÁöÁ¤ÇÏ¸é µË´Ï´Ù.
# ./configure –enable-auth-module=mysql –enable-logging=y
½ÇÇàÇÏ¸é ¸Ç ¸¶Áö¸·¿¡ ¾Æ·¡¿Í °°ÀÌ ¼³Á¤µÈ ¿ä¾àÁ¤º¸°¡ ³ª¿À´Âµ¥ ¹®Á¦°¡ ¾ø´ÂÁö È®ÀÎÇÑ´Ù.
vpopmail 5.4.32
Current settings
---------------------------------------
vpopmail directory = /home/vpopmail
domains directory = /home/vpopmail/domains
uid = 110
gid = 159
roaming users = OFF --disable-roaming-users (default)
password learning = OFF --disable-learn-passwords (default)
md5 passwords = ON --enable-md5-passwords (default)
file locking = ON --enable-file-locking (default)
vdelivermail fsync = OFF --disable-file-sync (default)
make seekable = ON --enable-make-seekable (default)
clear passwd = ON --enable-clear-passwd (default)
user dir hashing = ON --enable-users-big-dir (default)
address extensions = OFF --disable-qmail-ext (default)
ip alias = OFF --disable-ip-alias-domains (default)
onchange script = OFF --disable-onchange-script (default)
domain quotas = OFF --disable-domainquotas (default)
auth module = mysql --enable-auth-module=mysql
mysql replication = OFF --disable-mysql-replication (default)
sql logging = OFF --disable-sql-logging (default)
mysql limits = OFF --disable-mysql-limits (default)
SQL valias table = OFF --disable-valias (default)
auth inc = -I/usr/local/mysql/include/mysql
auth lib = -Xlinker -R -Xlinker /usr/local/mysql/lib -L/usr/local/mysql/lib¡¦¡¦¡¦
system passwords = OFF --disable-passwd (default)
pop syslog = show successful and failed login attempts --enable-logging=y
auth logging = ON --enable-auth-logging (default)
all domains in one SQL table = --enable-many-domains (default)
spamassassin = OFF --disable-spamassassin (default)
maildrop = OFF --disable-maildrop (default)
* Àú°°Àº °æ¿ì ¡°auth inc = -I/usr/local/mysql/include/mysql¡± ÀÌ ºÎºÐ¿¡ ¹®Á¦°¡ ÀÖ¾ú´Ù. ¡°–enable-incdir¡± ¿É¼Ç¿¡ ÇØ´çµÇ´Â ºÎºÐÀε¥ ÁöÁ¤À» ¾È ÇÒ °æ¿ì ±âº»À§Ä¡°¡ {MySQL Install localtion}/inlcude/mysql·Î µÈ´Ù. ÇöÀç MySQL 5.5.27 versionÀÌ ¼³Ä¡µÇ¾î ÀÖ°í /usr/local/mysql¿¡ À§Ä¡ÇϹǷΠinc direcotry°¡ ¡°/usr/local/mysql/include/mysql¡±ÀÌ µÇ¾ú´Âµ¥, ½ÇÁ¦·Î´Â ¡°/usr/local/mysql/include¡± À§Ä¡¿¡ ÇÊ¿äÇÑ header ÆÄÀÏÀÌ Á¸ÀçÇÏ¿© À§Ä¡¸¦ ¸í½ÃÀûÀ¸·Î ÁöÁ¤Çؼ ÇØ°áÇß´Ù.
3. ÄÄÆÄÀÏ
# make
# make install-strip
4. MySQL ¼³Á¤.
- MySQL montior¿¡ ·Î±×ÀÎÇؼ vpopmail DB¸¦ »ý»ýÇÏ°í, vpopmail user¸¦ »ý¼ºÇÑ´Ù.
#mysql –u root –p
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 4677
Server version: 5.5.27-log MySQL Community Server (GPL)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ¡®help;¡¯ or ¡®h¡¯ for help. Type ¡®c¡¯ to clear the current input statement.
mysql> create database vpopmail;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on vpopmail.* to ¡®vpopmail¡¯@'localhost¡¯ identified by ¡®password¡®;
Query OK, 0 rows affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
- /home/vpopmail/etc/vpopmail.mysql ÆÄÀÏ¿¡ °ü·Ã Á¤º¸¸¦ ±â·ÏÇÑ´Ù. Çü½ÄÀº ¡°host|port|user|password|database¡± ÀÌ´Ù.
vi /home/vpopmail/etc/vpopmail.mysql
# MYSQL CONNECTION SETTINGS FOR VPOPMAIL
#
# Line 1 defines the connection to use for database reads,
# Line 2 defines the connection to use for database updates/writes.
#
# If you omit line 2, then the same settings will be
# used for both read and write.
#
# settings for each line:
# host|port|user|password|database
#
127.0.0.1|0|vpopmail|password|vpopmail
#
# Note:
# The value of host may be either a hostname or an IP address.
# If host is 'localhost', then sockets (Unix) or named pipes (Windows)
# will be used instead of TCP/IP to connect to the server.
# chmod 640 /home/vpopmail/etc/vpopmail.mysql
5. defaultdomain ¼³Á¤
defaultdomainÀº ·Î±×Àνà ¸ÞÀÏÁÖ¼Ò¿¡ µµ¸ÞÀÎÀ» ¾È ÁÖ¾úÀ» °æ¿ì ±âº»ÀûÀ¸·Î Àû¿ëµÉ domainÀ¸·Î /home/vpopmail/etc¿¡ defaultdomain ÆÄÀÏ¿¡ domain¸íÀ» Àû¾îÁØ´Ù.
echo ¡°default.domain.name¡± > /home/vpopmail/etc/defaultdomain
knetqmail
knetqmailÄÄÆÄÀϽà libdomainkeys¸¦ ÂüÁ¶Çϱ⠶§¹®¿¡ libdomainkeys¸¦ ¸ÕÀú ÄÄÆÄÀÏ ÇÑ ÈÄ ¼³Ä¡°¡ ÁøÇàµÈ´Ù.
1. libdomainkeys ¼³Ä¡ ¹× patch Àû¿ë.
ÁÖÀÇÇÒ Á¡Àº knetqamil¼³Ä¡½Ã ¡°../libdomainkeys¡± À§Ä¡¸¦ ÂüÁ¶ÇϹǷΠ¾ÐÃàÇ®°í ³ ÈÄ Æú´õ À̸§À» ¡°libdomainkeys-0.68¡± ¿¡¼ ¡°libdomainkeys¡±À¸·Î º¯°æÇØ ÁÖ¾î¾ß ÇÑ´Ù.
# tar xfz libdomainkeys-0.68.tar.gz
# mv libdomainkeys-0.68 vlibdomainkeys
# cd libdomainkeys
# patch -p0 < ../libdomainkeys.diff
patching file Makefile
# make
2. knetqmail ¼³Ä¡
¾ÐÃàÀ» Ǭ ´ÙÀ½ ÄÄÆÄÀÏ ÇÑ´Ù.
# tar xfz knetqmail-1.06-20110908.tar.gz
# cd knetqmail-1.06-20110908
#
# make
# make setup check
* make½Ã ¾Æ·¡¿Í °°Àº ¿¡·¯°¡ ¹ß»ýÇϸé libdomainkeysÀÇ À§Ä¡¸¦ È®ÀÎÇÑ´Ù. makeÇÏ´Â Æú´õÀÇ ÇÏÀ§ Æú´õ¿¡ ¡°libdomainkeys¡± À̸§À̾î¾ß ÇÑ´Ù. ±×¾È¿¡ domainkeys.h ÆÄÀÏÀÌ ÀÖ´ÂÁö ¾øÀ¸¸é ÄÄÆÄÀÏÇß´ÂÁö üũÇÑ´Ù.
qmail-dk.c:23:41: error: ../libdomainkeys/domainkeys.h: No such file or directory
qmail-dk.c: In function â?˜maybe_die_dkâ?¢â:
¼³Á¤Çϱâ
±âº»ÀûÀ¸·Î ¼³Ä¡ÇÒ ÇÁ·Î±×·¥µéÀº ¸ðµÎ ¼³Ä¡µÇ¾ú´Ù. ÀÌÁ¦ºÎÅÍ´Â ±¸µ¿À» À§ÇÑ ½ºÅ©¸³Æ® ¼³Á¤À» ÇØ¾ß µÇ´Âµ¥ ´ÙÀ½°ú °°ÀÌ Å©°Ô 3°³ÀÌ´Ù.
- qmail-smtpd
- qmail-send
- qmail-vpop
qmail-smtpd´Â ¸ÞÀÏÀ» ¼Û½ÅÇÏ´Â ÇÁ·Î¼¼½ºÀÌ°í qmail-send´Â ¸ÞÀÏÀ» ¼ö½ÅÇÏ´Â ÇÁ·Î¼¼½ºÀÌ´Ù. qmail-vpopÀº vpopmail°ú °ü·ÃµÈ ÇÁ·Î¼¼½ºÀÌ´Ù. ÀÌ ÃÑ 3°³ÀÇ ÇÁ·Î¼¼½º¿¡ ´ëÇؼ daemontools·Î °ü¸®Çϱâ À§ÇÑ run ½ºÅ©¸³Æ®¸¦ ÀÛ¼ºÇØ¾ß ÇÏ°í ±×¸®°í °¢°¢ log¸¦ ³²±â±â À§ÇÑ ½ºÅ©¸³Æ®µµ ¸¸µé¾î¾ß ÇÑ´Ù.
1. /var/qmail/rc ½ºÅ©¸³Æ® ÀÛ¼º
qmailÀ» ±¸µ¿ÇÏ´Â ½ºÅ©¸³Æ®·Î /var/qmail/boot¿¡ º¸¸é ´Ù¾çÇÑ ½ºÅ©¸³Æ® ¿¹Á¦°¡ Á¸ÀçÇÑ´Ù. qmailÀº ¸ÞÀÏÀ» Àü¼ÛÇϰųª ¼ö½ÅÇÏ´Â ¿ªÇÒÀ» ÇÏ´Â MTA·Î ¼ö½ÅÇÑ ¸ÞÀÏÀ» ÀúÀåÇÏ´Â ¹æ¹ý°ú À§Ä¡¿¡ µû¶ó ±¸¼ºÀÌ ´Þ¶óÁø´Ù. ÀϹÝÀûÀ¸·Î mailÀÌ ÀúÀåµÇ´Â Æ÷¸Ë¿¡ µû¶ó mbox¿Í maildir·Î ³ª´©¾îÁö°í, ´Ù½Ã mbox´Â ÀüÅëÀûÀÎ ¹æ½ÄÀÎ vsmÇü½Ä(/var/spool/mail/useridÆÄÀÏ·Î ÀúÀå)°ú qmailÀÇ ±âº» ±¸¼ºÀÎ MailboxÇü½Ä($HOME/Mailbox ÆÄÀÏ¿¡ ÀúÀå)À¸·Î ³ª´©¾îÁø´Ù.
ÀÚ¼¼ÇÑ ¼³¸íÀº qmailÀÌ ¼³Ä¡µÈ Æú´õ(var/qmail)ÀÇ docÆú´õ¿¡ INSTALL.mbox, INSTALL.vsm, INSTALL.maildir¿¡ ÀÖ´Ù.
´ëºÎºÐ ¹®¼°¡ ¡°Maildir¡±·Î µÇ¾î ÀÖ¾î ¿©±â¼µµ Maildir ¹æ½ÄÀ¸·Î rc ½ºÅ©¸³Æ®¸¦ ±¸¼ºÇÑ´Ù.
vi /var/qmail/rc
#!/bin/sh
# Using splogger to send the log through syslog.
# Using qmail-local to deliver messages to ~/Mailbox by default.
exec env - PATH="/var/qmail/bin:$PATH"
qmail-start ./Maildir splogger qmail
#rc ½ºÅ©¸³Æ®¿¡ ½ÇÇà ±ÇÇÑ ºÎ¿©.
chmod 755 /var/qmail/rc
¡°splogger qmail¡± ¼³Á¤Àº syslog¿¡ log¸¦ ±â·Ï(/var/log/maillog ¶Ç´Â /var/log/messages)ÇÑ´Ù´Â ¿É¼ÇÀε¥, ´ÙÀ½¿¡ ¼³¸íÇÒ ½ºÅ©¸³Æ®¿¡¼ daemon tools¸¦ ÀÌ¿ëÇØ log¸¦ ³²±â±â¶§¹®¿¡ ºÒÇÊ¿äÇÑ ºÎºÐÀ̱ä Çѵ¥, °³ÀÎÀûÀ¸·Î ÇÑ°÷¿¡¼ qmail-smtpd, qmail-send, qmail-vpop log¸¦ º¼¼ö°¡ ÀÖ¾î °³ÀÎÀûÀ¸·Î´Â ³Ö°í »ç¿ëÁßÀÌ´Ù.
2. qmail-smtpd, qmail-send, qmail-vpop Æú´õ¹× ±ÇÇÑ ¼³Á¤.
//daemon tool Service¸¦ À§ÇÑ Æú´õ
mkdir -p /var/qmail/supervise/qmail-send
mkdir -p /var/qmail/supervise/qmail-send/log
mkdir -p /var/qmail/supervise/qmail-smtpd
mkdir -p /var/qmail/supervise/qmail-smtpd/log
mkdir -p /var/qmail/supervise/qmail-vpop
mkdir -p /var/qmail/supervise/qmail-vpop/log
//±ÇÇѼ³Á¤ – ¼ÒÀ¯ÀÚ¸¸ »èÁ¦ ÇÒ¼ö ÀÖ°Ô ¼³Á¤.
chmod 1755 /var/qmail/supervise/qmail-send
chmod 1755 /var/qmail/supervise/qmail-smtpd
chmod 1755 /var/qmail/supervise/qmail-vpop
//log°¡ ÀúÀåµÉ Æú´õ
mkdir -p /var/log/qmail/qmail-send
mkdir -p /var/log/qmail/qmail-smtpd
mkdir -p /var/log/qmail/qmail-vpop
chown qmaill /var/log/qmail
chown qmaill /var/log/qmail/qmail-send
chown qmaill /var/log/qmail/qmail-smtpd
chown qmaill /var/log/qmail/qmail-vpop
3. run ½ºÅ©¸³Æ® ÀÛ¼º.
À§¿¡¼ ¸¸µç 4°³ÀÇ Æú´õ¿¡ ´ëÇؼ °¢°¢ run ½ºÅ©¸³Æ®¸¦ ¸¸µç´Ù.
vi /var/qmail/supervise/qmail-send/run
#!/bin/sh
exec /var/qmail/rc
- qmail-send/log/run ½ºÅ©¸³Æ®
vi /var/qmail/supervise/qmail-send/log/run
#!/bin/sh
exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t /var/log/qmail/qmail-send
vi /var/qmail/supervise/qmail-smtpd/run
#!/bin/sh
VPOP_UID=`id -u vpopmail`
VPOP_GID=`id -g vpopmail`
exec /usr/local/bin/softlimit -m 90000000
/usr/local/bin/tcpserver -vRHl 0 -x /etc/tcp.smtp.cdb
-u $VPOP_UID -g $VPOP_GID 0 25
/var/qmail/bin/qmail-smtpd /home/vpopmail/bin/vchkpw /bin/true 2>&1
- qmail-smtpd/log/run ½ºÅ©¸³Æ®
vi /var/qmail/supervise/qmail-smtpd/log/run
#!/bin/sh
exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t /var/log/qmail/qmail-smtpd
vi /var/qmail/supervise/qmail-vpop/run
#!/bin/sh
VPOP_UID=`id -u vpopmail`
VPOP_GID=`id -g vpopmail`
exec /usr/local/bin/softlimit -m 90000000
/usr/local/bin/tcpserver -H -R -l 0 -u $VPOP_UID -g $VPOP_GID 0 110
/var/qmail/bin/qmail-popup hostname
/home/vpopmail/bin/vchkpw /var/qmail/bin/qmail-pop3d Maildir 2>&1
- qmail-vpop/log/run ½ºÅ©¸³Æ®
vi /var/qmail/supervise/qmail-vpop/log/run
#!/bin/sh
exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t /var/log/qmail/qmail-vpop
¸¸µç 6°³ÀÇ run ÆÄÀÏ¿¡ ´ëÇؼ ½ÇÇà ±ÇÇÑÀ» ¼³Á¤ÇÑ´Ù.
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
chmod 755 /var/qmail/supervise/qmail-vpop/run
chmod 755 /var/qmail/supervise/qmail-vpop/log/run
4. /etc/tcp.smtp ÀÛ¼º
/var/qmail/supervise/qmail-smtpd/run ½ºÅ©¸³Æ®¸¦ º¸¸é, tcpserver –> qmail-smtpd ¼ø¼·Î µÇ¾î ÀÖ´Ù. MUA(Mail User Agent; Outlook, IBM Lotus Notes°°Àº ..)¿¡¼ ¸ÞÀÏÀ» ¹ß¼ÛÇϱâ À§ÇØ ¼¹ö·Î ¿äûÀ» ÇÏ°Ô µÇ´Âµ¥, ¸Ç óÀ½ tcpserver°¡ ¿äûÀ» ¹Þ°Ô µÇ°í, tcpserver¿¡¼´Â tcp.smtp¿¡ µî·ÏµÈ Á¤º¸¸¦ º¸°í Á¢¼ÓÇã¿ë¿©ºÎ, relayÇã¿ë¿©ºÎ¸¦ ÆÇ´Ü(Á¢±ÙÁ¦ÇѱÔÄ¢)Çؼ qmail-smtpd·Î ¿äûÀ» ³Ñ±â°Ô µÈ´Ù. Áï smtpÁ¢¼Ó¸¸ Çã¿ëÇÏ°í relay Çã¿ë¿©ºÎ´Â qmail-smtpdÇÏ°Ô ÇҰųÄ, relay±îÁö Çã¿ëÇҰųĿ¡ ´ëÇÑ Á¢±Ù ±ÔÄ¢À» ¡°tcp.smtp¡±¿¡ Á¤ÀÇÇÑ´Ù.
tcp.smtp ¼³Á¤ÈÄ tcprules¸¦ ÀÌ¿ëÇØ cdbÇüÅ·Πº¯È¯À» ÇØÁÖ¾î¾ß ÇÑ´Ù.
vi /etc/tcp.smtp
127.0.0.1:allow,RELAYCLIENT=""
:allow
►¡®127.0.0.1:allow,RELAYCLIENT=¡±"¡¯Àº localhost(127.0.0.1)¿¡¼´Â Á¢¼ÓÀ» Çã¿ë(allow)ÇÏ°í relayµµ Çã¿ë(RELAYCLIENT=¡±")ÇÑ´Ù´Â Á¤Ã¥.
►¡®:allow¡¯´Â ¸ðµç IP¿¡ ´ëÇؼ Á¢¼ÓÀº Çã¿ëÇϴµ¥, relay¿©ºÎ´Â qmail-smtp·Î ³Ñ±ä´Ù´Â Á¤Ã¥.
►Á¢¼Ó °ÅºÎ´Â ¡°IP-Address:deny¡¯ ½ÄÀ¸·Î Ç¥±â.
ÀÛ¼º ÈÄ, cdb·Î º¯È¯¸í·É ¼öÇà.
/usr/local/bin/tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
5. System alias ¼³Á¤.
qmail¿¡¼´Â »óȲ¿¡ µû¶ó postmaster, mailer-daemon, root alias·Î ¸ÞÀÏ º¸³½´Ù. alias·Î º¸³½´Ù´Â°ÍÀº /var/qmail/alias/.qmail-*¿¡ ¼ÓÇÑ ¸ÞÀÏ°èÁ¤À¸·Î º¸³½´Ù´Â °ÍÀÌ°í ±×·¸±â ¶§¹®¿¡ À§ 3°³ÀÇ alias¸¦ ¸¸µé¾î ÁÖ¾î¾ß ÇÑ´Ù.
Alias |
¼³¸í |
Alias ÆÄÀϸí |
postmaster |
qmail systemÀÌ º¸³»´Â mailÀÇ ½ÇÁ¦ ¼öÄ¡Àο¡ ÇØ´çµÇ´Â °èÁ¤À¸·Î smtp¿¡ ´ëÇÑ ¾îµå¹Î. |
/var/qmail/alias/.qmail-postmaster |
mailer-daemon |
º¸³½ ¸á¿¡ ¼öÃëÀÎÀÌ ¾ø´Â °æ¿ì(¹Ù¿î½º ¸ÞÀÏ)¿¡ ¹ÞÀ» ¸ÞÀÏ°èÁ¤. |
/var/qmail/alias/.qmail-mailer-daemon |
root |
OS ½Ã½ºÅÛ´Ü¿¡¼ root¿¡ ÅëÁöÇØÁÖ´Â ¸ÞÀÏÀ» ¹ÞÀ» °èÁ¤. |
/var/qmail/alias/.qmail-root |
¹æ¹ýÀº Alias ÆÄÀϸíÀ¸·Î ÆÄÀÏÀ» ¸¸µé°í, ±× ¾È¿¡ ½ÇÁ¦·Î ¹ÞÀ» ¸ÞÀÏÁÖ¼Ò¸¦ ³Ö¾îÁÖ¸é µÈ´Ù.
6. Sendmail ´ëü
sendmailÀº À§¿¡¼µµ ¼³¸íÇßµí ¿À·£±â°£ À¯´Ð½º¿¡¼ »ç¿ëÇØ ¿Â ´ëÇ¥ÀûÀº MTA·Î, ¼¹ö¼³Ä¡½Ã ±âº»À¸·Î ¼³Ä¡µÇ´Â ÇÁ·Î±×·¥(?)ÀÌ´Ù. ±×·¡¼ ÀϺΠÇÁ·Î±×·¥µéÀº ÇÁ·Î±×·¥»ó¿¡¼ sendmailÀ» Á÷Á¢ È£ÃâÇÏ¿© »ç¿ëÇÏ´Â ÇÁ·Î±×·¥µéµµ ÀÖ´Ù. ±×·¸±â ¶§¹®¿¡ sendmail¿¡¼ qmail·Î ´ëüÇϱâ À§Çؼ´Â sendmail ¼ºñ½º¸¦ Á×ÀÌ°í ÀçºÎÆõǾ ½ÇÇàµÇÁö ¸øÇÏ°Ô Çϴ°ͻӸ¸ ¾Æ´Ï¶ó Á÷Á¢ È£ÃâÇÏ´Â ÇÁ·Î±×·¥µéÀ» À§ÇØ qmail¿¡¼ ¹èÆ÷ÇÏ´Â sendmail·Î ´ëüÇØ ÁÖ¾î¾ß ÇÕ´Ï´Ù.
/etc/init.d/sendmail stop
- qmail¿¡¼ ¹èÆ÷ÇÏ´Â sendmail·Î ´ëü.
sendmail libÀÎ ¡°/usr/lib/sendmail¡±°ú ½ÇÇàÆÄÀÏÀÎ ¡°/usr/sbin/sendmail¡±¿¡ ´ëÇؼ À̸§À» º¯°æÇÏ°í (.old) ¸ðµç ±ÇÇÑÀ» ¾ø¾Ö°í, qmail¿¡¼ ¹èÆ÷ÇÏ´Â ¸ðµâ·Î º¯°æÇÑ´Ù.
* senmailÀ» ÂüÁ¶ÇÏ´Â ÇÁ·Î±×·¥µéÀÌ ¸¹±â ¶§¹®¿¡ ¼³Ä¡°¡ ¾ÈµÇ¾î ÀÖ´õ¶óµµ ¿¬°á½ÃÄÑ ³õ´Â°ÍÀÌ ÁÁ´Ù.
mv /usr/lib/sendmail /usr/lib/sendmail.old
mv /usr/sbin/sendmail /usr/sbin/sendmail.old
chmod 0 /usr/lib/sendmail.old
chmod 0 /usr/sbin/sendmail.old
ln -s /var/qmail/bin/sendmail /usr/lib
ln -s /var/qmail/bin/sendmail /usr/sbin
7. qmail start/stop ½ºÅ©¸³Æ®(qmail) ÀÛ¼º.
¸¶Áö¸·À¸·Î qmailÀ» ½ÃÀÛÇÏ°í ÁßÁöÇϰųª ±âŸ »óÅ ȮÀεîÀ» À§ÇÑ ½ºÅ©¸³Æ®¸¦ ¸¸µé¾î¾ß ÇÑ´Ù. ½Ã½ºÅÛÀÌ ½ÃÀÛÇÒ¶§ ÀÚµ¿ÀûÀ¸·Î ¼ºñ½ºµéÀÌ ½ÃÀ۵DZâ À§ÇØ /serivce Æú´õ¿¡ /var/qmail/supervise/qmail-smtpd, /var/qmail/supervise/qmail-send, /var/qmail/supervise/qmail-vpop¿¡ ´ëÇؼ ¸µÅ©¸¦ °É¾îÁØ´Ù.
ln -s /var/qmail/supervise/qmail-send /service/
ln -s /var/qmail/supervise/qmail-smtpd /service/
ln -s /var/qmail/supervise/qmail-vpop /service/
chkconfig –add /etc/init.d/qmail
[qmail-vpop Ãß°¡ÇÑ ½ºÅ©¸³Æ®]
#!/bin/sh
# For Red Hat chkconfig
# chkconfig: - 80 30
# description: the qmail MTA
PATH=/var/qmail/bin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin
export PATH
QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`
case "$1" in
start)
echo "Starting qmail"
if svok /service/qmail-send ; then
svc -u /service/qmail-send /service/qmail-send/log
else
echo "qmail-send supervise not running"
fi
if svok /service/qmail-smtpd ; then
svc -u /service/qmail-smtpd /service/qmail-smtpd/log
else
echo "qmail-smtpd supervise not running"
fi
if svok /service/qmail-vpop ; then
svc -u /service/qmail-vpop /service/qmail-vpop/log
else
echo "qmail-vpop supervise not running"
fi
if [ -d /var/lock/subsys ]; then
touch /var/lock/subsys/qmail
fi
;;
stop)
echo "Stopping qmail..."
echo " qmail-smtpd"
svc -d /service/qmail-smtpd /service/qmail-smtpd/log
echo " qmail-send"
svc -d /service/qmail-send /service/qmail-send/log
echo " qmail-vpop"
svc -d /service/qmail-vpop /service/qmail-vpop/log
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
svstat /service/qmail-vpop
svstat /service/qmail-vpop/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
echo "Pausing qmail-vpop"
svc -p /service/qmail-vpop
;;
cont)
echo "Continuing qmail-send"
svc -c /service/qmail-send
echo "Continuing qmail-smtpd"
svc -c /service/qmail-smtpd
echo "Continuing qmail-vpop"
svc -c /service/qmail-vpop
;;
restart)
echo "Restarting qmail:"
echo "* Stopping qmail-smtpd."
svc -d /service/qmail-smtpd /service/qmail-smtpd/log
echo "* Sending qmail-send SIGTERM and restarting."
svc -t /service/qmail-send /service/qmail-send/log
echo "* Restarting qmail-smtpd."
svc -u /service/qmail-smtpd /service/qmail-smtpd/log
echo "* Stopping qmail-vpop."
svc -d /service/qmail-vpop /service/qmail-vpop/log
echo "* Restarting qmail-vpop."
svc -u /service/qmail-vpop /service/qmail-vpop/log
;;
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
domain¹× user µî·Ï
domainÀ» µî·ÏÇÑ´Ù.
#cd /home/vpopmail/bin
# vadddomain domain.name
Please enter password for postmaster: ********
enter password again: ********
#
»ç¿ëÀÚµéÀ» µî·ÏÇÑ´Ù.
# vadduser emailid@domain.name
Please enter password for emailid@domain.name : **********
enter password again : **********
#
qmail ½ÃÀÛ ¹× °ËÁõ
Áö±Ý±îÁö Á¦´ë·Î ¼³Ä¡°¡ µÇ¾úÀ¸¸é qmailÀ» ½ÃÀÛÇÑ´Ù.
# service qmail start
Starting qmail
#
pstree ¸í·É¾î¸¦ ÅëÇØ process¸¦ È®ÀÎÇØ º»´Ù. ¾Æ·¡¿Í °°ÀÌ ³ª¿À¸é Á¤»óÀÌ´Ù.
pstree
¦§¦¡svscanboot¦¡¦¨¦¡readproctitle
¦¢ ¦¦¦¡svscan¦¡¦¨¦¡2*[supervise¦¡¦¡¦¡tcpserver]
¦¢ ¦§¦¡3*[supervise¦¡¦¡¦¡multilog]
¦¢ ¦¦¦¡supervise¦¡¦¡¦¡qmail-send¦¡¦¨¦¡qmail-clean
¦¢ ¦§¦¡qmail-lspawn
¦¢ ¦§¦¡qmail-rspawn
¦¢ ¦¦¦¡splogger
smtp, pop3¿¡ ´ëÇؼ LISTEN°¡ Àß ¶° ÀÖ´ÂÁö È®ÀÎÇÑ´Ù.
# netstat –ltp
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:pop3 *:* LISTEN 21291/tcpserver
tcp 0 0 *:smtp *:* LISTEN 21283/tcpserver
TelnetÀ¸·Î smtp Å×½ºÆ®
qmail ¼³Ä¡½Ã /etc/tcp.smtpÀÇ ¼³Á¤¿¡ µû¶ó relay Çã¿ë ¿©ºÎ°¡ ´Þ¶óÁö´Âµ¥, À§¿Í °°ÀÌ ¼³Á¤ÇßÀ» °æ¿ì, ·ÎÄÿ¡¼´Â stmpÀÎÁõ ¾øÀÌ ¹ß¼ÛÀÌ °¡´ÉÇÏ°í ¿ÜºÎ¿¡¼´Â ÀÎÁõÀ» °ÅÃÄ¾ß µÈ´Ù.
·ÎÄÿ¡¼´Â ÀÎÁõÀÌ ÇÊ¿ä¾ø±â ¶§¹®¿¡ ¾Æ·¡¿Í °°ÀÌ ¹Ù·Î smtp¸¦ ÅëÇØ ¹ß¼ÛÇÒ ¼ö°¡ ÀÖ´Ù.
# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 domain.name ESMTP
ehlo domain.name
250-domain.name
250-PIPELINING
250-8BITMIME
250-SIZE 0
250 AUTH LOGIN PLAIN CRAM-MD5 <— ÀÌ¿Í °°ÀÌ ³ª¿À¸é smtp auth ¼³Á¤ ok.
mail from: emailid@domain.name <— À§¿¡ ¼³Á¤ÇÑ ¸ÅÀÏ°èÁ¤À» ³Ö´Â´Ù.
250 ok
rcpt to:rcpt-emailid@rcptdoamin.name <— ¹ÞÀ» »ç¶÷ÀÇ ¸ÞÀÏ °èÁ¤À» ³Ö´Â´Ù.
250 ok
data
354 go ahead
subject:test mail <— Á¦¸ñ
this is test mail:) <— º»¹®
. <— ¡°.¡±ÀÔ·ÂÇÏ¸é ¹ß¼ÛÀÌ µÊ.
250 ok 1349759394 qp 983
quit
221 domain.name
Connection closed by foreign host.
#
¸®¸ðÆ®¿¡¼ ¸ÞÀÏÀ» ·ÎÄðú ¶È°°Àº ¹æ¹ýÀ¸·Î ¹ß¼Û ÇÒ °æ¿ì
ÀÎÁõ ¾øÀÌ ¸ÞÀÏÀ» ¹ß¼ÛÇÏ·Á°í ÇÒ °æ¿ì ¾Æ·¡¿Í °°ÀÌ ¡°553 5.7.1 sorry, that domain isn¡¯t in my list of allowed rcpthosts (chkuser) ¡° ¿¡·¯°¡ ¹ß»ýÇÑ´Ù.
# telnet domain.name 25
Trying 118.222.222.222...
Connected to domain.name (118.219.234.222).
Escape character is '^]'.
220 domain.name ESMTP
ehlo domain.name
250-domain.name
250-PIPELINING
250-8BITMIME
250-SIZE 0
250 AUTH LOGIN PLAIN CRAM-MD5
mail from:emailid@domain.name
250 ok
rcpt to:rcpt-emailid@rcptdoamin.name
553 5.7.1 sorry, that domain isn't in my list of allowed rcpthosts (chkuser)
¸®¸ðÆ®¿¡¼ ÀÎÁõÈÄ ¸ÞÀÏ ¹ß¼Û
¡°AUTH LOGIN¡± command¸¦ ÅëÇØ ÀÎÁõÀ» ÇÒ ¼ö Àִµ¥, ÀÌ ¶§ base64·Î encodingÇؼ ÀÔ·ÂÇØ¾ß µÈ´Ù. ù¹ø°´Â ¡°
emailid@domain.name¡±, µÎ¹ø°´Â ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÑ´Ù.
# telnet domain.name 25
Trying 118.222.222.222...
Connected to domain.name (118.219.234.222).
Escape character is '^]'.
220 domain.name ESMTP
ehlo domain.name
250-domain.name
250-PIPELINING
250-8BITMIME
250-SIZE 0
250 AUTH LOGIN PLAIN CRAM-MD5
AUTH LOGIN <— AUTH LOGIN
334 VXNlcm5hbWU6 <- ¡°Username:¡±
bW9udGVhcHBzQGYdsXBwcy5jb2dss0= <- base64·Î encodingµÈ ¡°emailid@domain.name¡±.
334 UGFzc3dvcmQ6 <- ¡°Password:¡±
aXRmczAfdsdsffsdfxMjk= <- base64·Î encodingµÈ ºñ¹Ð¹øÈ£
235 ok, go ahead (#2.0.0) <- ÀÎÁõ ¼º°ø ¸Þ½ÃÁö.
mail from:emailid@domain.name
250 ok
rcpt to:rcpt-emailid@rcptdoamin.name
250 ok
data
354 go ahead
subject:test mail
this is test mail:)
.
250 ok 1349760277 qp 1007
quit
221 domain.name
Connection closed by foreign host.
#