Nmail PHP Guide
- Linux/Unix -
Version 2.6.12
http://passkorea.net
- ¸ñ Â÷ -
1. ¼³Ä¡½Ã ÇÊ¿äÇÑ ÇÁ·Î±×·¥ ¹öÀü
4. Apache + PHP + MySQL RPM ¼³Ä¡
5. ÆíÁöÇÔ ¹é¾÷/º¹±¸ ¹× °ü¸®¿¡ ÇÊ¿äÇÑ À¯Æ¿ ¼³Ä¡
7. ¼¹ö¿¡¼ »ç¿ëÁßÀÎ ³×ÀÓ¼¹ö È®ÀÎ
4. ±âÁ¸ ¸ÞÀϼºñ½º(SMTP/POP3) ÁßÁö
5. ÀϺΠ¸®´ª½º ¹èÆ÷ÆÇÀÇ SELinux ÁßÁö
6. ¼³Ä¡ ÇÁ·Î±×·¥ ½ÇÇà (UTF-8 Á¦Ç°)
7. ¼³Ä¡ ÇÁ·Î±×·¥ ½ÇÇà (EUC-KR Á¦Ç°)
8. ¼³Ä¡°¡ ¿Ï·áµÇ¸é, ¼³Ä¡ ÇÁ·Î±×·¥ º¸°ü
1. PHP mailparse ¸ðµâÀÌ ÀÚµ¿À¸·Î ¼³Ä¡µÇÁö ¾Ê´Â °æ¿ì. (ÄÄÆÄÀÏ ¼³Ä¡)
2. ¸ÞÀÏ¿£Áø ¼Ò½º ÄÄÆÄÀÏÀÌ ÇÊ¿äÇÑ °æ¿ì
3. À¥¸ÞÀÏ¿¡¼ ¹ÞÀº ¸ÞÀÏÀÌ º¸ÀÌÁö ¾Ê´Â °æ¿ì
¿£¸ÞÀÏÀº APM(Apache + PHP + MySQL) µ¥¸óÀ» ±â¹ÝÀ¸·Î Linux/Unix ȯ°æ¿¡¼ »ç¿ëÇϵµ·Ï Á¦À۵Ǿú½À´Ï´Ù. ¿£¸ÞÀÏ µ¿ÀÛ¿¡ ÇÊ¿äÇÑ ÃÖ¼Ò»ç¾çÀº ´ÙÀ½°ú °°½À´Ï´Ù.
[OS] Linux, FreeBSD, Solaris
[Apache] 1.3.X ÀÌ»ó, Apache 2.0 / 2.2 / 2.4 Áö¿ø.
[PHP] 4.3.0 ÀÌ»ó, PHP 5.3 Áö¿ø. (mbstring, iconv ¸ðµâ ÇÊ¿ä) / PHP 5.4 ÀÌ»ó ¼³Ä¡ºÒ°¡
[MySQL] 3.23.6 ÀÌ»ó, MySQL 4, MySQL 5.6 Áö¿ø.
¸®´ª½ºÀÇ °æ¿ì ±¹³»¿¡¼ °¡Àå ¸¹ÀÌ »ç¿ëµÇ´Â ·¹µåÇÞ °è¿ÀÇ ¸®´ª½º Áß ¾÷µ¥ÀÌÆ®°¡ Áö¼ÓÀûÀ¸·Î ÀÌ·ç¾îÁö´Â ¹èÆ÷ÆÇÀ» ±ÇÀåÇص帮°í ÀÖ½À´Ï´Ù. °ø½Ä ¾÷µ¥ÀÌÆ®°¡ Áß´ÜµÈ Á¦Ç°µéÀº º¸¾È»ó ¹®Á¦°¡ »ý±æ °¡´É¼ºÀÌ ³ôÀ¸¹Ç·Î »ç¿ëÇÏÁö ¾Ê´Â °ÍÀÌ ÁÁ½À´Ï´Ù.
- CentOS : http://www.centos.org
=> ÃֽŹöÀüÀÎ CentOS 6.4 64bit ¿¡¼µµ ¼³Ä¡ °¡´ÉÇÕ´Ï´Ù.
=> ·¹µåÇÞ ¿£ÅÍÇÁ¶óÀÌÁî ¹öÁ¯À» ±â¹ÝÀ¸·Î ¸¸µé¾îÁø ¹èÆ÷ÆÇÀÔ´Ï´Ù. (±ÇÀå)
¾Æ·¡Ã³·³ »ç°¢¹Ú½º¾È¿¡ µé¾î°¡´Â ³»¿ëÀº ¼¹ö¿¡ SSL/Telnet À¸·Î Á¢¼ÓÇÑÈÄ Å͹̳Îȸ鿡¼ ÀÔ·ÂÇØ¾ßµÉ ½© ¸í·É¾îÀÔ´Ï´Ù. À̶§ ˜Þ(#)À¸·Î ½ÃÀ۵Ǵ ¶óÀÎÀº ÁÖ¼®Ç¥½Ã·Î ¾È³»¹®±¸À̹ǷΠÀÔ·ÂÇÒ ÇÊ¿ä°¡ ¾øÀ¸¸ç ÀÔ·ÂÇÏ´õ¶óµµ ½ÇÇàµÇÁö ¾Ê½À´Ï´Ù.
# PHP ½ÇÇàÆÄÀÏÀÌ Á¸ÀçÇÏ´ÂÁö È®ÀÎÇÕ´Ï´Ù. => ÁÖ¼®Ç¥½Ã·Î ´ÙÀ½¿¡ ³ª¿Ã ¸í·É¿¡ ´ëÇÑ ¾È³»ÀÔ´Ï´Ù. ls /usr/bin/php => Å͹̳Îȸ鿡 º¹»çÈÄ ºÙ¿©³Ö±â³ª Á÷Á¢ ÀÔ·ÂÇؾßÇÏ´Â ½© ¸í·ÉÀÔ´Ï´Ù. #result# /usr/bin/php => ½©¸í·É ½ÇÇàÈÄ È¸é»ó¿¡ Ãâ·ÂµÇ´Â °á°ú¹°ÀÔ´Ï´Ù. |
CentOS, Fedora Core µîÀÇ ·¹µåÇÞ °è¿ÀÇ ÃֽŠ¹èÆ÷ÆÇÀ» »ç¿ëÇÒ °æ¿ì ¡°yum¡±ÇÁ·Î±×·¥À» ÅëÇØ ¾Æ·¡ RPM ÆÐÅ°Áöµé¸¸ ¼³Ä¡Çصνøé ÀúÈñ ¿£¸ÞÀϸ¸ÀÌ ¾Æ´Ï¶ó ÇâÈÄ ´Ù¸¥ À¥ÇÁ·Î±×·¥À» »ç¿ëÇÒ ¶§µµ º°´Ù¸¥ ¹®Á¦°¡ ¾øÀ¸½Ç °Ì´Ï´Ù. ÁÖÀÇ) ¼¹ö³»¿¡ APMÀÌ ÀÌ¹Ì ¼Ò½º ÄÄÆÄÀÏ·Î ¼³Ä¡µÇ¾î ÀÖ´Ù¸é, RPMÀ¸·Î Áߺ¹ ¼³Ä¡ÇÏ½Ã¸é ¾ÈµË´Ï´Ù.
¿¹Á¦) CentOS, Fedora Core
# Apache + PHP + MySQL ¼³Ä¡ yum -y install httpd mysql-server mysql php php-devel php-gd php-mbstring php-mysql php-pear
# Apache, MySQL µ¥¸ó ½ÃÀÛ /etc/init.d/httpd start /etc/init.d/mysqld start
# Apache, MySQL µ¥¸ó ºÎÆýà ÀÚµ¿ ½ÇÇà /sbin/chkconfig httpd on /sbin/chkconfig mysqld on
# mysql root ºñ¹Ð¹øÈ£ ÁöÁ¤ mysqladmin password ºñ¹Ð¹øÈ£ÁöÁ¤
# php.ini ÆÄÀÏ °æ·Î È®ÀÎ php -i|grep ini
# php.ini ¿¡¼ short_open_tag °ªÀ» On À¸·Î º¯°æ. vi /etc/php.ini short_open_tag = Off => short_open_tag = On |
# PHP È®ÀåÀÚ¿¡ .htm, .html Ãß°¡ vi /etc/httpd/conf.d/php.conf AddHandler php5-script .php => AddHandler php5-script .php .htm .html |
¿¹Á¦) CentOS, Fedora Core
# ÆíÁöÇÔ ¹é¾÷/º¹±¸, DNS Å×½ºÆ®, SMTP ÀÀ´ä Å×½ºÆ®¿¡ »ç¿ëµÇ´Â À¯Æ¿ ¼³Ä¡ yum -y install zip unzip rdate bind-utils telnet |
ÀÚü ³×ÀÓ¼¹ö(127.0.0.1)ÀÇ °æ¿ì ¡®¼³Ä¡¡¯¸¸ Çصξ ij½Ì³×ÀÓ¼¹ö·Î »ç¿ëÇÒ ¼ö ÀÖ¾î ¸ÞÀÏ ¼Û¼ö½Å ¼ÓµµÇâ»ó¿¡ µµ¿òÀÌ µË´Ï´Ù. ¼¹ö³»ºÎ¿¡ ³×ÀÓ¼¹ö°¡ ¼³Ä¡µÇ¾î ÀÖÁö ¾Ê°í ¿ÜºÎÀÇ ³×ÀÓ¼¹ö°¡ ÁöÁ¤µÇ¾î ÀÖÀ» °æ¿ì DNS ÁúÀǸ¦ ¿ÜºÎ¼¹ö·Î ´øÁö°Ô µÇ¾î ±×¸¸Å ¼Óµµ°¡ ´À·ÁÁö°Ô µË´Ï´Ù. ƯÈ÷ µ¥ÀÌÄÞ(164.124.101.2), ÄÚ³Ý(168.126.63.1)ó·³ ¸¹Àº »ç¿ëÀÚ°¡ ¸ô¸®´Â ¿ÜºÎ¼¹ö·Î ÁöÁ¤ÇÒ °æ¿ì ÇØ´ç ³×ÀÓ¼¹öÀÇ ¼ÓµµÀúÇÏ/Àå¾Ö¿¡ µû¸¥ ¿µÇâÀ» ±×´ë·Î ¹Þ°Ô µË´Ï´Ù. µû¶ó¼ ¾Æ·¡Ã³·³ ³×ÀÓ¼¹ö ÇÁ·Î±×·¥(bind)À» ¼³Ä¡Çؼ ù¹ø° ³×ÀÓ¼¹ö·Î ÁöÁ¤ÇÏ´Â °ÍÀ» ±ÇÀåÇÕ´Ï´Ù.
¿¹Á¦) CentOS, Fedora Core
# bind ¼³Ä¡¿©ºÎ, ½ÇÇà¿©ºÎ¸¦ È®ÀÎÇÔ. rpm -qa|grep bind #result# bind-9.3.2-2 /etc/init.d/named restart
# bind °¡ ¾øÀ» °æ¿ì ¼³Ä¡, ½ÃÀÛ, ºÎÆýà ÀÚµ¿ ½ÃÀÛ ¼³Á¤ yum -y install bind caching-nameserver /etc/init.d/named start /sbin/chkconfig named on
# ù¹ø° ³×ÀÓ¼¹ö¸¦ ÀÚü³×ÀÓ¼¹ö·Î ÁöÁ¤.(ù¹ø° ¶óÀο¡ ¾Æ·¡ ³»¿ëÃß°¡) vi /etc/resolv.conf nameserver 127.0.0.1 |
Linux/Unix ¿¡¼ »ç¿ëµÇ´Â ³×ÀÓ¼¹ö´Â º¸Åë ¾Æ·¡Ã³·³ ¼³Á¤µÇ¾î ÀÖ½À´Ï´Ù. ù ¹ø° ³×ÀÓ¼¹ö¸¦ ¸ÕÀú »ç¿ëÇÏ´Ù°¡ ÀÀ´äÀÌ ¾øÀ» ¶§ µÎ ¹ø° ³×ÀÓ¼¹ö¸¦ »ç¿ëÇÏ°Ô µË´Ï´Ù. µû¶ó¼ ù ¹ø° ³×ÀÓ¼¹ö´Â °¡±ÞÀû ÀÚü ³×ÀÓ¼¹ö(127.0.0.1), ÇØ´ç È£½ºÆÃ/ISP ¾÷üÀÇ ³×ÀÓ¼¹ö¸¦ µî·ÏÇÏ´Â °ÍÀÌ ÁÁ½À´Ï´Ù.
cat /etc/resolv.conf #result# nameserver 127.0.0.1 #result# nameserver 164.124.101.2 #result# nameserver 168.126.63.1 |
µî·ÏµÈ ³×ÀÓ¼¹ö°¡ Á¦´ë·Î ÀÀ´äÇÏ´ÂÁö ´ÙÀ½Ã³·³ È®ÀÎÇغ¸½Ã¸é µË´Ï´Ù.
ex) nslookup µµ¸ÞÀÎÁÖ¼Ò ³×ÀÓ¼¹öIP
nslookup passkorea.net 127.0.0.1 #result# Server: 127.0.0.1 #result# Address: 127.0.0.1#53
#result# Name: passkorea.net #result# Address: 211.170.106.66 |
¸ÞÀÏ ¼¹ö´Â ¸ÞÀÏÀ» º¸³½½Ã°£/¹Þ´Â½Ã°£ÀÌ ¼¹öÀÇ ½Ã°£¿¡ µû¶ó ±â·ÏµÇ¹Ç·Î, Ç×»ó Ç¥ÁØ ½Ã°£¿¡ µ¿±âÈ µÇ¾î¾ß ÇÕ´Ï´Ù.
- CentOS 5/6 ¹öÀüÀÏ °æ¿ì, ntpd ¸¦ ¼³Ä¡Çصθé ÀÚµ¿À¸·Î °è¼Ó µ¿±âÈ µÇ¾î µû·Î ½Å°æ¾µ ÇÊ¿ä°¡ ¾ø¾îÁý´Ï´Ù.
yum -y install ntp /etc/init.d/ntpd start /sbin/chkconfig ntpd on ntpdate -d 0.centos.pool.ntp.org date |
- ´Ù¸¥ OS ÀÏ °æ¿ì, rdate ³ª ntpdate ·Î µ¿±âȽÃŵ´Ï´Ù.
rdate -s time.bora.net ntpdate -u time.bora.net [root@nbuilder tools]# /usr/sbin/hwclock --systohc |
php, pear, pecl µîÀÇ ½ÇÇàÆÄÀÏÀÌ /usr/bin/ ¾Æ·¡¿¡ Á¸ÀçÇϰųª ¸µÅ©µÇ¾î ÀÖ´ÂÁö È®ÀÎÇØ¾ß ÇÕ´Ï´Ù. Apache+PHP ¸¦ RPM À¸·Î ¼³Ä¡Çß´Ù¸é ÇØ´ç À§Ä¡¿¡ Á¸ÀçÇÏÁö¸¸ ÄÄÆÄÀÏ·Î ¼³Ä¡ÇßÀ» °æ¿ì ´ÙÀ½Ã³·³ /usr/bin/ ¾Æ·¡·Î ¸µÅ©¸¦ °É¾îÁÖ¾î¾ß ÇÕ´Ï´Ù.
# ÆÄÀÏÀÌ Á¸ÀçÇÏ´ÂÁö È®ÀÎ ls /usr/bin/php /usr/bin/pear /usr/bin/pecl /usr/bin/phpize #result# ls: **** ±×·± ÆÄÀÏÀ̳ª µð·ºÅ丮°¡ ¾øÀ½
# /usr/bin/php °¡ Á¸ÀçÇÏÁö ¾ÊÀ» °æ¿ì PHP°¡ ¼³Ä¡µÈ µð·ºÅ丮¸¦ ±âÁØÀ¸·Î ½Éº¼¸¯¸µÅ© »ý¼º. ln -s /PHP_¼³Ä¡°æ·Î_Á÷Á¢ÀÔ·Â/bin/* /usr/bin/ # sample) ln -s /usr/local/php/bin/* /usr/bin/
# ¸µÅ©µÈ ÆÄÀÏÀÇ ½ÇÇà Å×½ºÆ® /usr/bin/php -v /usr/bin/pear config-show |
ÁÖÀÇ) ÄÄÆÄÀÏ·Î ¼³Ä¡µÈ PHP¿Í RPMÀ¸·Î ¼³Ä¡µÈ PHP°¡ ÇÔ²² ¼³Ä¡µÇ¾î ÀÖÀ» °æ¿ì PHP Ãæµ¹·Î ÀÎÇØ ¼³Ä¡½Ã ¿¹±âÄ¡ ¸øÇÑ ¹®Á¦°¡ ¹ß»ýÇÒ ¼ö ÀÖ½À´Ï´Ù. µû¶ó¼ ¹Ýµå½Ã 2°³ Áß Çϳª¸¦ »èÁ¦ÇØ¾ß ÇÕ´Ï´Ù.
# RPMÀ¸·Î ¼³Ä¡µÈ PHP°¡ ÀÖ´ÂÁö È®ÀÎ. rpm -qa|grep php
# À¥ÆäÀÌÁöÀÇ phpinfo() Á¤º¸¿¡¼ º¸¿©Áö´Â PHP ¹öÁ¯, php.ini °æ·Î°¡ # ´ÙÀ½Ã³·³ ½©¸ðµå¿¡¼¿Í ÀÏÄ¡ÇÏ´ÂÁö È®ÀÎ. php -v |
¾Õ¼± ¡°¼³Ä¡ Áغñ¡±´Ü°è¿¡¼ ¾ð±ÞµÇ¾î ÀÖ´Â Apache + PHP + MySQL µ¥¸óÀÇ ¼³Ä¡°¡ ¿Ï·áµÈ »óÅ¿¡¼ ¼³Ä¡¸¦ ½ÃÀÛÇÏ¼Å¾ß ÇÕ´Ï´Ù.
ÇöÀç ¿î¿µÁßÀÎ ¸®´ª½º¿¡ ¿£¸ÞÀÏÀ» ¼³Ä¡ÇÏ·Á¸é PHPÀÇ °æ¿ì¿¡´Â ¹öÀüÀÌ 4.3.X ÀÌ»óÀ̾î¾ß ÇÏ°í mbstring, iconv ¸ðµâÀÌ ÇÊ¿äÇÕ´Ï´Ù. ÇØ´ç ¸ðµâÀÇ ¼³Ä¡¿©ºÎ´Â phpinfo() Á¤º¸¸¦ Ãâ·ÂÇÏ´Â ¼Ò½º¸¦ µû·Î ¸¸µé¾î¼ È®ÀÎÇϰųª ¾Æ·¡Ã³·³ ½©½ºÅ©¸³Æ®·Î È®ÀÎÀÌ °¡´ÉÇÕ´Ï´Ù.
php -m|grep mbstring #result# mbstring php -m|grep iconv #result# iconv
# ÇØ´ç ¸ðµâÀÌ ¼³Ä¡µÇ¾î ÀÖÀ» °æ¿ì¿¡¸¸ Ãâ·Â°á°ú°¡ ³ª¿É´Ï´Ù. |
¸ðµâÀÌ ¼³Ä¡µÇ¾î ÀÖÁö ¾ÊÀ» °æ¿ì Ãß°¡ÇÏ´Â ¹æ¹ýÀº ´ÙÀ½°ú °°½À´Ï´Ù.
1. PHP¸¦ RPMÀ¸·Î ¼³Ä¡ÇÒ °æ¿ì.(ÀÌ¹Ì ¼³Ä¡µÈ °æ¿ìµµ µ¿ÀÏ)
rpm ÆÐÅ°ÁöÁß php-mbstring, php-iconv ¸¦ ã¾Æ¼ ¼³Ä¡ÇÏ½Ã¸é µË´Ï´Ù.
php-pecl-mailparse °¡ ¾ø´Â ½Ã½ºÅÛÀº Â÷ÈÄ Á÷Á¢ ¼³Ä¡ÇÏ´Â ¹æ¹ýÀÌ µû·Î ¼³¸íµÇ¾î ÀÖ½À´Ï´Ù.
¿¹Á¦) CentOS, Fedora Core ÀÇ °æ¿ì yum À¸·Î °£´ÜÇÏ°Ô ¼³Ä¡°¡´É.
yum -y install php-mbstring php-iconv |
2. PHP¸¦ ¼Ò½º ÄÄÆÄÀÏ·Î ¼³Ä¡ÇÒ °æ¿ì.
configure ¿É¼Ç¿¡ ´ÙÀ½ ³»¿ëÀ» Ãß°¡ÇÏ¸é µË´Ï´Ù.
--with-iconv --enable-mbstring --enable-mbregex
ÁÖÀÇ) PHP¸¦ Ä¿¸Çµå¶óÀο¡¼ ½ÇÇàÇϱâ À§Çؼ´Â ÄÄÆÄÀϽà --disable-cli ¿É¼ÇÀ» ³ÖÁö ¾Ê¾Æ¾ß ÇÕ´Ï´Ù.
3. PHP¸¦ ¼Ò½º ÄÄÆÄÀÏ·Î ÀÌ¹Ì ¼³Ä¡ÇصР°æ¿ì.
ÄÄÆÄÀϽà »ç¿ëÇÑ ¼Ò½º µð·ºÅ丮·Î À̵¿Çؼ ÇØ´ç ¸ðµâ¸¸ Ãß°¡ ¼³Ä¡ÇÏ°í, php.ini ÀÇ extensionÇ׸ñ¿¡ µî·ÏÇÏ¸é µË´Ï´Ù.
¿¹Á¦) ÄÄÆÄÀÏÇÑ ¼Ò½º°¡ /usr/src/php-4.4.1 ¿¡ ÀÖÀ» °æ¿ì.(¼¹ö¸¶´Ù °æ·Î°¡ ´Ù¸§)
# install iconv cd /usr/src/php-4.4.1/ext/iconv phpize ./configure make make install
# install mbstring cd /usr/src/php-4.4.1/ext/mbstring phpize ./configure make make install
# php.ini °æ·Î È®ÀÎ php -i|grep ini
# modify php.ini vi /usr/local/php/lib/php.ini extension=iconv.so extension=mbstring.so
# ¼³Ä¡µÈ ¸ðµâ È®ÀÎ php -m |
MySQL ¼³Á¤ ÆÄÀÏÀÎ my.cnf ¿¡¼ [mysqld] ¹®±¸ ´ÙÀ½¿¡ max_allowed_packet=32M °ªÀÌ ¼±¾ðµÇ¾î¾ß ÇÕ´Ï´Ù. ¸¸¾à 1M·Î ¼±¾ðµÇ¾î ÀÖ´Ù¸é 32M·Î ¼öÁ¤ÇØÁÖ½Ã¸é µË´Ï´Ù.
### CentOS 6 ¿¡¼ MySQL 5 °¡ RPMÀ¸·Î ¼³Ä¡µÈ °æ¿ì. vi /etc/my.cnf [mysqld] max_allowed_packet=32M /etc/init.d/mysqld restart |
ÁÖÀÇ) MySQL 3.X ¹öÀüÀÏ °æ¿ì, ´ÙÀ½Ã³·³ ¼³Á¤°ªÀÌ ´Ù¸¨´Ï´Ù. [mysqld] set-variable = max_allowed_packet=32M |
°ü·Ã ±â¼úÀÚ·á) http://dev.mysql.com/doc/refman/5.1/en/packet-too-large.html
¼³Ä¡½Ã ¿£¸ÞÀÏ¿ë SMTP/POP3 ¼ºñ½º¸¦ ½ÇÇàÇÏ°Ô µË´Ï´Ù. µû¶ó¼ ±âÁ¸¿¡ ¿î¿µÁßÀÌ´ø SMTP/POP3 ¼ºñ½º´Â Á¾·á½ÃÅ°°í ºÎÆýà ÀÚµ¿ ½ÇÇàµÇÁö ¾Êµµ·Ï Á¶Ä¡ÇÏ¼Å¾ß ÇÕ´Ï´Ù. ±×·¸Áö ¾ÊÀ» °æ¿ì ¼³Ä¡°¡ ¿Ï·áµÇ¾îµµ ¿£¸ÞÀÏ¿¡¼ ¸ÞÀÏÀ» ¹ÞÁö ¸øÇÏ°Ô µË´Ï´Ù.
´ÙÀ½Àº Linux ¿¡¼ ÀϹÝÀûÀ¸·Î ¸¹ÀÌ »ç¿ëµÇ´Â sendmail, ipop3 µ¥¸óÀ» ±âÁØÀ¸·Î ÇÑ °ÍÀÌ¸ç ½Ã½ºÅÛ¿¡ µû¶ó postfix, qmail, courier-imap µî ´Ù¸¥ ¼ºñ½º°¡ »ç¿ëÇÏ°í ÀÖÀ» ¼ö µµ ÀÖÀ¸´Ï ¹Ì¸® È®ÀÎÇغ¸½Ã±â ¹Ù¶ø´Ï´Ù.
### CentOS 6 ÀÏ °æ¿ì. /sbin/chkconfig postfix off /etc/init.d/postfix stop
### ³ª¸ÓÁö OS ÀÏ°æ¿ì, °¢°¢ÀÇ ½ÇÇàÁßÀÎ ¸ÞÀϼºñ½º¸¦ ã¾Æ Á¤Áö½ÃÄÑ¾ß ÇÕ´Ï´Ù. # ºÎÆýà ÀÚµ¿½ÇÇà ¹æÁö. /sbin/chkconfig sendmail off /sbin/chkconfig ipop3 off #/sbin/chkconfig postfix off #/sbin/chkconfig courier-imap off
# ±âÁ¸ ¸ÞÀϼºñ½º¿ë µ¥¸ó Á¾·á. /etc/init.d/sendmail stop /etc/init.d/xinetd reload #/etc/init.d/postfix stop #/etc/init.d/courier-imap stop
# ¸ÞÀϼºñ½º Á¾·áÈÄ SMTP(25), POP3(110)Æ÷Æ®¿¡¼ ÀÀ´äÀÌ ¾ø´ÂÁö È®ÀÎ. telnet 127.0.0.1 25 telnet 127.0.0.1 110
# ¸¸¾à 25, 110 Æ÷Æ®¿¡¼ ÀÀ´äÀÌ ÀÖ´Ù¸é ±âÁ¸ ¸ÞÀϼºñ½º°¡ Á¾·áµÈ °ÍÀÌ ¾Æ´Ï¹Ç·Î ÀçÈ®ÀÎÇÏ¼Å¾ß ÇÕ´Ï´Ù. |
fedora, redhat enterprise µî SELinux °¡ ¼³Ä¡µÈ ¸®´ª½º¿¡¼´Â ¾Æ·¡Ã³·³ ÀÌ ±â´ÉÀ» ¼³Ä¡½Ã ¾Ë ¼ö ¾ø´Â ¹®Á¦°¡ ¹ß»ýÇÏÁö ¾Ê½À´Ï´Ù.
# ¼³Á¤ÆÄÀÏ¿¡¼ ¿É¼ÇÀ» enforcing ¿¡¼ disabled ·Î ¼öÁ¤. vi /etc/selinux/config SELINUX=enforcing => SELINUX=disabled
# SELinux ¸¦ ÀçºÎÆÃÇÏÁö ¾Ê°í Áï½Ã ÁßÁö /usr/sbin/setenforce 0
# ¸¸¾à setenforce °¡ ¾ø´Ù¸é ¼¹ö¸¦ ÀçºÎÆÃÇØ¾ß ÇÕ´Ï´Ù. |
¼³Ä¡ ÇÁ·Î±×·¥À» ´Ù¿î¹Þ¾Æ¼ ¿øÇÏ´Â µð·ºÅ丮¿¡ ³Ö¾îµÎ°í ½ÇÇàÇÕ´Ï´Ù. À̶§ ¾ÆÆÄÄ¡ À¥¼¹ö¸¦ ¹Ì¸® ½ÇÇàÇصξî¾ß ¼³Ä¡ ÇÁ·Î±×·¥¿¡¼ ¾ÆÆÄÄ¡ À¥¼¹öÀÇ Á¤º¸¸¦ ÀÚµ¿ÀνÄÇÒ ¼ö ÀÖ°Ô µË´Ï´Ù. ÀÚ¼¼ÇÑ ³»¿ëÀº ¼³Ä¡ ÇÁ·Î±×·¥¿¡¼ ³ª¿À´Â ¾È³»¹®±¸¸¦ º¸°í µû¶ó¼ ÁøÇàÇÏ½Ã¸é µË´Ï´Ù.
¿¹Á¦) /tmp µð·ºÅ丮¿¡ ³Ö¾îµÎ¾úÀ» °æ¿ìÀÇ ¿¹Á¦.
# ¼³Ä¡ ÇÁ·Î±×·¥À» ¼¹ö¿¡ FTP µîÀ¸·Î ¾÷·ÎµåÇÕ´Ï´Ù. wget http://passkorea.net/nmailphp/nmail-php-linux-utf8.tgz
# ¾ÐÃàÀ» ÇØÁ¦ÇÕ´Ï´Ù. tar zxvf nmail-php-linux-utf8.tgz
# ¼³Ä¡ ½ºÅ©¸³Æ®¸¦ ½ÇÇàÇÑ ÈÄ ¡®¼³Ä¡ ¿Ï·á¡¯°¡ ³ª¿Ã¶§±îÁö Áö½Ã´ë·Î ÁøÇàÇÏ½Ã¸é µË´Ï´Ù. # ÁÖÀÇ) ¹Ýµå½Ã /usr/bin/php À§Ä¡¿¡ php ½ÇÇàÆÄÀÏÀÌ Á¸ÀçÇØ¾ß ÇÕ´Ï´Ù.
/usr/bin/php nmail-php-2.6.12_utf8_install.php |
Âü°í) ¼³Ä¡ ÇÁ·Î±×·¥¿¡¼ ÇѱÛÀÌ ±úÁ® º¸ÀÏ °æ¿ì ¾Æ·¡Ã³·³ ÇѱÛÄڵ带 ÁöÁ¤ÈÄ Àç½ÇÇàÇÔ.
# Linux export LANG=ko_KR.utf8
# Solaris #export LANG=ko
# FreeBSD #export ko_KR.utf-8
/usr/bin/php nmail-php-2.6.12_utf8_install.php |
¼³Ä¡ ÇÁ·Î±×·¥À» ´Ù¿î¹Þ¾Æ¼ ¿øÇÏ´Â µð·ºÅ丮¿¡ ³Ö¾îµÎ°í ½ÇÇàÇÕ´Ï´Ù. À̶§ ¾ÆÆÄÄ¡ À¥¼¹ö¸¦ ¹Ì¸® ½ÇÇàÇصξî¾ß ¼³Ä¡ ÇÁ·Î±×·¥¿¡¼ ¾ÆÆÄÄ¡ À¥¼¹öÀÇ Á¤º¸¸¦ ÀÚµ¿ÀνÄÇÒ ¼ö ÀÖ°Ô µË´Ï´Ù. ÀÚ¼¼ÇÑ ³»¿ëÀº ¼³Ä¡ ÇÁ·Î±×·¥¿¡¼ ³ª¿À´Â ¾È³»¹®±¸¸¦ º¸°í µû¶ó¼ ÁøÇàÇÏ½Ã¸é µË´Ï´Ù.
¿¹Á¦) /tmp µð·ºÅ丮¿¡ ³Ö¾îµÎ¾úÀ» °æ¿ìÀÇ ¿¹Á¦.
# ¼³Ä¡ ÇÁ·Î±×·¥À» ¼¹ö¿¡ FTP µîÀ¸·Î ¾÷·ÎµåÇÕ´Ï´Ù. wget http://passkorea.net/nmailphp/nmail-php-linux.tgz
# ¾ÐÃàÀ» ÇØÁ¦ÇÕ´Ï´Ù. tar zxvf nmail-php-linux.tgz
# ¼³Ä¡ ½ºÅ©¸³Æ®¸¦ ½ÇÇàÇÑ ÈÄ ¡®¼³Ä¡ ¿Ï·á¡¯°¡ ³ª¿Ã¶§±îÁö Áö½Ã´ë·Î ÁøÇàÇÏ½Ã¸é µË´Ï´Ù. # ÁÖÀÇ) ¹Ýµå½Ã /usr/bin/php À§Ä¡¿¡ php ½ÇÇàÆÄÀÏÀÌ Á¸ÀçÇØ¾ß ÇÕ´Ï´Ù.
/usr/bin/php nmail-php-2.6.12_install.php |
Âü°í) ¼³Ä¡ ÇÁ·Î±×·¥¿¡¼ ÇѱÛÀÌ ±úÁ® º¸ÀÏ °æ¿ì ¾Æ·¡Ã³·³ ÇѱÛÄڵ带 ÁöÁ¤ÈÄ Àç½ÇÇàÇÔ.
# Linux export LANG=ko_KR.eucKR
# Solaris #export LANG=ko
# FreeBSD #export ko_KR.EUC
/usr/bin/php nmail-php-2.6.12_install.php |
¼³Ä¡ ÇÁ·Î±×·¥Àº ¹Ýµå½Ã /home/nmail2/ ¾Æ·¡¿¡ º¸°üÇصνñ⠹ٶø´Ï´Ù. ±×·¡¾ß ¼¹ö ÀÌÀü/À缳ġ ÀÛ¾÷½Ã ¾Ë¸ÂÀº ¼³Ä¡ ÇÁ·Î±×·¥À» ãÁö ¸øÇØ ½Ã°£À» ³¶ºñÇÏ´Â ÀÏÀÌ ¾ø½À´Ï´Ù.
# ÇöÀç µð·ºÅ丮¿¡ ¼³Ä¡ ÇÁ·Î±×·¥ÀÌ Á¸ÀçÇÏ´ÂÁö È®ÀÎÇÕ´Ï´Ù. ls -l nmail-php-* nmail_dir.ini nmail_license_agree.ini
# ¼³Ä¡ ÇÁ·Î±×·¥À» /home/nmail2 ·Î À̵¿ÇÕ´Ï´Ù. mv nmail-php-* nmail_dir.ini nmail_license_agree.ini /home/nmail2/ |
¼³Ä¡ ¿Ï·á½Ã ¸¶Áö¸· ȸ鿡 ¾Æ·¡Ã³·³ Apache °¡»óÈ£½ºÆ® ¼³Á¤¹æ¹ý¿¡ ´ëÇÑ ³»¿ëÀÌ ³ª¿É´Ï´Ù. ÇØ´ç ³»¿ëÀ» Âü°íÇϼż ¼³Á¤ÆÄÀÏÀ» ÀûÀýÈ÷ ¼öÁ¤ÈÄ Apache ¸¦ Àç½ÃÀÛÇÏ½Ã¸é µË´Ï´Ù.
============================================================================== = ¿£¸ÞÀÏ ¼³Ä¡ ÀÛ¾÷ÀÌ ¿Ï·áµÇ¾ú½À´Ï´Ù. ============================================================================== ÀÌÁ¦ Apache À¥¼¹öÀÇ ¼³Á¤ÆÄÀÏÀÎ httpd.conf ¿¡ °¡»óÈ£½ºÆ®(ȤÀº ¾Ù¸®¾î½º) ¼³Á¤À» Ãß°¡ÇÏ°í Apache À¥¼¹ö¸¦ Àç½ÃÀÛÇϸé À¥¸ÞÀÏÀ» »ç¿ëÇÏ½Ç ¼ö ÀÖ°Ô µË´Ï´Ù. httpd.conf ¿¡ Ãß°¡ÇؾßÇÒ ³»¿ë) ÁÖÀÇ1) ¼¹ö¿¡ µû¶ó NameVirtualHost, VIrtualHost Ç׸ñÀº ´Ù¸¦ ¼ö ÀÖÀ¸´Ï ±âÁ¸ ¼³Á¤À» È®ÀÎÇϼ¼¿ä. ÁÖÀÇ2) ServerName Àº DNS ¼³Á¤¿¡ µû¶ó 'mail'À̶ó´Â 2Â÷µµ¸ÞÀÎÀÌ ºÙÁö ¾ÊÀ» ¼ö µµ ÀÖÀ¸´Ï DNS ¼¹ö°ü¸®ÀÚ¿¡°Ô ¹®ÀÇÇϽñ⠹ٶø´Ï´Ù. ÁÖÀÇ3) VIrtualHost °¡ ¾ø´ø »çÀÌÆ®¿¡¼ VIrtualHost ¸¦ Ãß°¡ÇÒ °æ¿ì ±âÁ¸ ȨÆäÀÌÁö±îÁö ¿£¸ÞÀÏ·Î Á¢±ÙµÉ ¼ö ÀÖ½À´Ï´Ù. µû¶ó¼ ±âÁ¸ ȨÆäÀÌÁöÀÇ VIrtualHost ´Â µû·Î ¸¸µé¾îÁÖ¼Å¾ß ÇÕ´Ï´Ù.
vi /etc/httpd/conf/httpd.conf
### °¡»óÈ£½ºÆ® ###
# VirtualHost Enabled NameVirtualHost *:80
# Nmail PHP - http://mail.YourDomain.com/ <VirtualHost *:80> ServerAdmin postmaster@YourDomain.com DocumentRoot "/home/nmail2/nmail" ServerName mail.YourDomain.com ServerAlias mail.* #ServerAlias mail.MultiDomain1.com mail.MultiDomain2.com ErrorLog logs/nmail2.error_log TransferLog logs/nmail2.access_log <Directory "/home/nmail2/nmail"> Options None AllowOverride All AddDefaultCharset Off <IfModule mod_authz_core.c> Require all granted </IfModule> <IfModule !mod_authz_core.c> Order allow,deny Allow from all </IfModule> </Directory> </VirtualHost> |
ÁÖÀÇ) ¼¹ö³»¿¡ ±âÁ¸¿¡ ¿î¿µÁßÀÎ À¥»çÀÌÆ®°¡ ÀÖÀ» °æ¿ì
Apache °¡»óÈ£½ºÆ®¿¡ ¼±¾ðµÇÁö ¾ÊÀº µµ¸ÞÀÎÀ¸·Î Á¢¼ÓÇÒ °æ¿ì ù¹ø° °¡»óÈ£½ºÆ® ¼³Á¤À» µû¸£°Ô µË´Ï´Ù. ÀÌ·Î ÀÎÇØ ±âÁ¸ À¥»çÀÌÆ®(www.YourDomain.com)¿ë °¡»óÈ£½ºÆ®°¡ µû·Î ¼±¾ðµÇÁö ¾ÊÀº »óÅ¿¡¼ ¿£¸ÞÀÏ¿ë °¡»óÈ£½ºÆ®¸¦ Ãß°¡ÇÏ°Ô ¹®Á¦°¡ ¹ß»ýÇÒ ¼ö ÀÖ½À´Ï´Ù. ¹®Á¦°¡ »ý±âÁö ¾Êµµ·Ï ¹Ì¸® ±âÁ¸ À¥»çÀÌÆ®¿¡ ¸Â´Â °¡»óÈ£½ºÆ®°¡ ¼³Á¤À» È®ÀÎ ÈÄ Ãß°¡ÇÏ½Ã´Â°Ô ÁÁ½À´Ï´Ù.
ÁÖÀÇ) Apache ¼³Á¤ Áß ´ÙÀ½ Ç׸ñÀÌ ÀÖ´Ù¸é »èÁ¦ ÈÄ Àç½ÃÀÛÇØ¾ß ÇÕ´Ï´Ù. ±×·¸Áö ¾ÊÀ¸¸é À¥¸ÞÀÏ¿¡¼ ÇѱÛÀÌ ±úÁú °¡´É¼ºÀÌ ÀÖ½À´Ï´Ù.
AddDefaultCharset UTF-8 => #AddDefaultCharset UTF-8 |
ÀϹÝÀûÀÎ °æ¿ìó·³ http://mail.YourDomain.com ÇüÅÂÀÇ À¥¸ÞÀÏ ÁÖ¼Ò¸¦ »ç¿ëÇÒ °æ¿ì¿¡´Â ¡®¾Ù¸®¾î½º¡¯¼³Á¤À» µû·Î Àâ¾ÆÁÙ ÇÊ¿ä°¡ ¾ø½À´Ï´Ù. ÇÏÁö¸¸ ¡®°¡»óÈ£½ºÆ®¡¯¼³Á¤À» »ç¿ëÇÏÁö ¾Ê°í http://YourDomain.com/webmail/ ÇüÅ·Π»ç¿ëÇÏ·Á¸é ¡®¾Ù¸®¾î½º¡¯¼³Á¤À» ÀÌ¿ëÇÏ½Ã¸é µË´Ï´Ù.
Apache À¥¼¹öÀÇ ¼³Á¤ÆÄÀÏÀÎ httpd.conf ¿¡¼ ±âÁ¸ Alias ¿É¼Ç ¾Æ·¡¿¡ ¿£¸ÞÀÏ °ü·Ã Alias ¸¦ Ãß°¡ÈÄ À¥¼¹ö¸¦ Àç½ÃÀÛÇÏ¸é µË´Ï´Ù.
# ±âÁ¸ Alias ¼³Á¤ ´ÙÀ½¿¡ Ãß°¡ Alias /icons/ "/usr/local/apache/icons/"
# Nmail PHP - http://www.YourDomain.com/webmail/ Alias /webmail "/home/nmail2/nmail" <Directory "/home/nmail2/nmail"> Options None AllowOverride All AddDefaultCharset Off <IfModule mod_authz_core.c> Require all granted </IfModule> <IfModule !mod_authz_core.c> Order allow,deny Allow from all </IfModule> </Directory> |
¼¹ö OSÀÇ ±âº» ¹æȺ®À̳ª ¼¹ö ¾Õ ´Ü¿¡ ¹æȺ®ÀÌ ÀÖÀ» °æ¿ì, ´ÙÀ½ Æ÷Æ®µéÀ» ¿ÀÇ ÇØÁÖ¼Å¾ß ÇÕ´Ï´Ù.
TCP 25 – ¸ÞÀÏ ¼Û¼ö½Å¿ë (Çʼö)
TCP 80 – À¥¸ÞÀÏ Á¢¼Ó¿ë
TCP 110 – ¾Æ¿ô·è µîÀÇ ¸ÞÀÏ Å¬¶óÀ̾ðÆ®¿¡¼ ¡®¸ÞÀÏ ¹Þ±â¡¯½Ã »ç¿ëµÊ.
TCP 587 – ¾Æ¿ô·è µîÀÇ ¸ÞÀÏ Å¬¶óÀ̾ðÆ®¿¡¼ ¡®¸ÞÀÏ º¸³»±â¡¯½Ã »ç¿ëµÊ.
* ¸ÞÀÏ Å¬¶óÀ̾ðÆ®¿¡¼ 25 Æ÷Æ®¿¡ Á¢±ÙÇÏ´Â °Íµµ °¡´ÉÇÑ, ÀϺΠ¹«¼±/ÇØ¿Ü ÀÎÅͳݿ¡¼ 25 Æ÷Æ®°¡ Â÷´ÜµÈ °æ¿ì¿¡ »ç¿ëµË´Ï´Ù. À̶§ ¸ÞÀÏ Å¬¶óÀ̾ðÆ®ÀÇ ¼³Á¤¿¡¼ SMTP Æ÷Æ®¸¦ 25¿¡¼ 587 ·Î º¯°æÇؼ º¸³»±â°¡ °¡´ÉÇÕ´Ï´Ù.
# CentOS 6 ÀÏ °æ¿ì. vi /etc/sysconfig/iptables # ±âÁ¸ tcp 22 Çã¿ë ¶óÀÎ ´ÙÀ½¿¡ Ãß°¡ÇÏ¸é µË´Ï´Ù. -A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 110 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 587 -j ACCEPT /etc/init.d/iptables restart |
À¥ºê¶ó¿ìÀú¿¡¼ ¼³Ä¡ÇÑ ÁÖ¼Ò( http://mail.YourDomain.com ) ·Î Á¢¼ÓÇÏ½Ã¸é µË´Ï´Ù. [¼¹ö°ü¸®ÀÚ]°èÁ¤Àº ¾ÆÀ̵ð´Â postmaster À̸ç, ºñ¹Ð¹øÈ£´Â ¼³Ä¡½Ã ÀÔ·ÂÇÑ ºñ¹Ð¹øÈ£ÀÔ´Ï´Ù.
¸ÖƼ µµ¸ÞÀÎÀº [¼¹ö°ü¸®ÀÚ]·Î ·Î±×ÀÎÈÄ [¸ÞÀϼ¹ö°ü¸® - µµ¸ÞÀΰü¸®]¿¡¼ Ãß°¡ÇÒ ¼ö ÀÖÀ¸¸ç ¸ÞÀÏ°èÁ¤µµ [¸ÞÀϼ¹ö°ü¸® - ȸ¿ø°ü¸®]¿¡¼ Ãß°¡ÇÒ ¼ö ÀÖ½À´Ï´Ù. ¸ÖƼ µµ¸ÞÀÎÀÇ °æ¿ì »ç¿ëÀÚ°¡ Á¢¼ÓÇÑ À¥ÆäÀÌÁö ÁÖ¼Ò(http://)¿¡ µû¶ó ±¸ºÐÇÏ¿© ¿£¸ÞÀÏ ³»ºÎ¿¡¼ ÀÚµ¿ Àνĵ˴ϴÙ.
¸ÖƼ µµ¸ÞÀÎ Ãß°¡ ÀÛ¾÷ ¼ø¼)
a. À¥¸ÞÀÏ [¸ÞÀϼ¹ö°ü¸®]¿¡¼ µµ¸ÞÀÎ ¹× ȸ¿ø Ãß°¡.
b. ¾ÆÆÄÄ¡ À¥¼¹ö ¼³Á¤ È®ÀÎ.
- ¾Õ¼ ¼³Á¤ÇصР°¡»óÈ£½ºÆ®, ¾Ù¸®¾î½ºÀÇ °æ¿ì ¸ðµç µµ¸ÞÀο¡ Àû¿ëµÇ¹Ç·Î µû·Î ÀÛ¾÷ ÇÏ½Ç ÇÊ¿ä°¡ ¾ø½À´Ï´Ù.
c. µµ¸ÞÀÎÀÇ DNS ¼¹ö¿¡¼ MX ·¹ÄÚµåÀÇ IP ¸¦ ¸ÞÀϼ¹ö·Î º¯°æ.
±âÁ¸ »ç¿ëÀÚÀÇ ÀÏ°ý Ãß°¡ ¹× È£½ºÆþ÷ü¸¦ À§ÇÑ µµ¸ÞÀÎ,ȸ¿øÃß°¡¿ë ½© ½ºÅ©¸³Æ®°¡ Á¦°øµË´Ï´Ù.
cd /home/nmail2/tools/ ./domain_add.php ¸ÞÀϼ¹ö¿¡ µµ¸ÞÀÎÀ» Ãß°¡ÇÏ´Â ¸í·ÉÀÔ´Ï´Ù. À¥¸ÞÀÏÀÇ [¸ÞÀϼ¹ö°ü¸®-µµ¸ÞÀΰü¸®]¿¡¼ Ãß°¡ÇÏ´Â °Í°ú µ¿ÀÏÇÕ´Ï´Ù. »ç¿ë¹æ¹ý) ./domain_add.php "DOMAIN" ./mbr_add.php ¸ÞÀϼ¹ö¿¡ ¸ÞÀÏ°èÁ¤À» Ãß°¡ÇÏ´Â ¸í·ÉÀÔ´Ï´Ù. ÀϹݻç¿ëÀÚ Ãß°¡½Ã) ./mbr_add.php "DOMAIN" "NAME" "USERID" "PASSWORD" °ü¸®ÀÚ Ãß°¡½Ã ) ./mbr_add.php "DOMAIN" "NAME" "USERID" "PASSWORD" "ADMIN" |
¼Ò½º ÄÄÆÄÀÏÀ» Çϱâ À§Çؼ´Â ¡®gcc-c++¡¯µîÀÇ °³¹ßÆÐÅ°Áö°¡ ÇÊ¿äÇÏ°Ô µË´Ï´Ù. °³¹ßÆÐÅ°Áö°¡ ¾øÀ»°æ¿ì CentOS µî¿¡¼´Â ¾Æ·¡Ã³·³ ÆÐÅ°Áö°ü¸®ÀÚ¸¦ ÅëÇØ Ãß°¡ÇÏ½Ã¸é µË´Ï´Ù.
yum install glibc-devel gcc-c++ make |
¼Ò½º¸¦ ´Ù¿î¹Þ¾Æ Á÷Á¢ ÄÄÆÄÀÏÇؼ ¸ðµâÀ» ¼³Ä¡ÇÏ¸é µË´Ï´Ù.
## PHP 5 ÀÏ °æ¿ì wget http://www.passkorea.net/nmailphp/betapatch/mailparse-2.1.6.tgz tar zxvfp mailparse-2.1.6.tgz cd mailparse-2.1.6 phpize ./configure make make install
# PHP 4 ÀÏ °æ¿ì wget http://www.passkorea.net/nmailphp/betapatch/mailparse-2.1.4.tgz tar zxvfp mailparse-2.1.4.tgz cd mailparse-2.1.4 phpize ./configure make make install |
¸¸¾à make ½Ã ¿¡·¯°¡ ¹ß»ýÇÑ´Ù¸é ¾Æ·¡Ã³·³ À¯Çü¿¡ µû¶ó ´ëÀÀÇÏ½Ã¸é µË´Ï´Ù.
¿¡·¯1)
ext/mbstring/libmbfl/mbfl/mbfilter.h: No such file or directory
# ´ÙÀ½Ã³·³ ¼Ò½º¿¡ Æ÷ÇÔµÈ libmfl µð·ºÅ丮¸¦ PHP°¡ ¼³Ä¡µÈ include µð·ºÅ丮¸¦ ã¾Æ¼ # º¹»çÇسÖÀ¸½ÅÈÄ Àç½ÃµµÇÏ½Ã¸é µË´Ï´Ù. # ¾Æ·¡ °æ·Î´Â ¼¹ö¿¡ µû¶ó ´Ù¸¦ ¼ö ÀÖ½À´Ï´Ù.
# cp /usr/src/php-5.1.4/ext/mbstring/libmbfl /usr/local/php/include/php/ext/mbstring/ |
¿¡·¯2)
mailparse-2.1.1/mailparse.c:34:2: error: #error The mailparse extension requires the mbstring extension!
# PHP mbstring ¸ðµâÀ» º°µµ·Î Ãß°¡ÇϽŠ°æ¿ì¿¡ ¹ß»ýÇÏ´Â ¹®Á¦ÀÔ´Ï´Ù. # ´ÙÀ½Ã³·³ ¼Ò½º¿¡¼ ¹®Á¦ÀÇ ¶óÀεéÀ» »èÁ¦ ÈÄ Àç½ÃµµÇÏ½Ã¸é µË´Ï´Ù.
vi mailparse-2.1.1/mailparse.c 33~35 line) #if !HAVE_MBSTRING #error The mailparse extension requires the mbstring extension! #endif |
·¹µåÇÞ °è¿ÀÇ ¸®´ª½º, ¼Ö¸®¸®½º ÀϺΠ¹öÁ¯¿¡ ÇÑÇØ ¸ÞÀÏ¿£Áø ¹ÙÀ̳ʸ®¸¦ Á¦°øÇÏ°í ÀÖ½À´Ï´Ù. ÀÌ·Î ÀÎÇØ ÀϺΠOS¿¡¼´Â ¼³Ä¡ÇÁ·Î±×·¥¿¡¼ ÀÚµ¿À¸·Î ãÁö ¸øÇØ Á÷Á¢ ¼Ò½º ÄÄÆÄÀÏÀ» ÅëÇØ »ç¿ëÇÏ¼Å¾ß ÇÏ´Â °æ¿ì°¡ ÀÖÀ» ¼ö ÀÖ½À´Ï´Ù. ¶ÇÇÑ ¸ÞÀÏ¿£Áø°ü·Ã ÀÌ»ó Áõ»óÀÌ ¹ß°ßµÈ´Ù¸é ¼Ò½º ÄÄÆÄÀÏÀ» ÅëÇØ ´Ù½Ã ¼³Ä¡ÇÏ´Â °ÍÀ» ±ÇÀåÇص帳´Ï´Ù.
¼Ò½º ÄÄÆÄÀÏÀ» Çϱâ À§Çؼ´Â ¡®gcc-c++¡¯µîÀÇ °³¹ßÆÐÅ°Áö°¡ ÇÊ¿äÇÏ°Ô µË´Ï´Ù. °³¹ßÆÐÅ°Áö°¡ ¾øÀ»°æ¿ì CentOS µî¿¡¼´Â ¾Æ·¡Ã³·³ ÆÐÅ°Áö°ü¸®ÀÚ¸¦ ÅëÇØ Ãß°¡ÇÏ½Ã¸é µË´Ï´Ù.
yum install glibc-devel gcc-c++ make |
¼Ò½º ÄÄÆÄÀÏ ¹æ¹ý)
cd /home/nmail2/tools/mailserver/ tar zxvf xmail-1.22_20120228.tgz cd xmail-1.22
# OSº° ÄÄÆÄÀÏ.(Linux ¸¦ »ç¿ëÁßÀ϶§´Â Makefile.lnx À» »ç¿ëÇÏ¸é µÊ) make -f Makefile.lnx #make -f Makefile.bsd #make -f Makefile.sso
# ¸ÞÀÏ¿£Áø Á¾·áÈÄ 25¹ø Æ÷Æ®°¡ ÀÀ´äÀÌ ¾ø´Â °ÍÀ» È®ÀÎÇÔ. /etc/init.d/xmail stop telnet 127.0.0.1 25
# ½ÇÇàÆÄÀÏÀ» µ¤¾î¾º¿ò. /bin/cp bin/* /var/MailRoot/bin/
# ¸ÞÀÏ¿£ÁøÀ» ½ÃÀÛÈÄ ¸ÞÀÏ¿£Áø ¹öÁ¯ÀÌ "XMail 1.22 PassKorea120228"ÀÎ °ÍÀ» È®ÀÎÇÔ. /etc/init.d/xmail start telnet 127.0.0.1 25 |
¿£¸ÞÀÏÀÇ °æ¿ì ºü¸¥ 󸮸¦ À§ÇØ ¸ÞÀÏÁ¤º¸¸¦ µðºñ¿¡ ÀúÀåÇÏ°Ô µË´Ï´Ù. ±×·¯³ª ¼³Ä¡½Ã ¹®Á¦°¡ ÀÖÀ» °æ¿ì µðºñ¿¡ ÀúÀåÇÏ´Â °úÁ¤¿¡¼ ¿À·ù°¡ ¹ß»ýÇÒ ¼ö ÀÖ½À´Ï´Ù. ÀÌ °æ¿ì ¸ÞÀÏÀº ½ÇÁ¦·Î ¹Þ¾ÒÀ¸¹Ç·Î ¾Æ¿ô·è¿¡¼ °¡Á®°¥ ¼ö ÀÖÁö¸¸ À¥¸ÞÀÏ¿¡¼¸¸ º¸ÀÌÁö ¾Ê´Â Çö»óÀÌ ¹ß»ýÇÏ°Ô µË´Ï´Ù.
´ÙÀ½ °¢ ´Ü°èº°·Î ¼ø¼´ë·Î Å×½ºÆ®¸¦ ÁøÇàÇغ¸½Ã¸é µË´Ï´Ù. ¸¸¾à ¿¡·¯°¡ ³ª¿Â´Ù¸é ¿¡·¯¸Þ¼¼Áö¿Í ÇÔ²² ÀúÈñ ȨÆäÀÌÁö( http://passkorea.net )·Î ¹®ÀǸ¦ ÁÖ½Ã¸é µË´Ï´Ù.
1. ´ÙÀ½Ã³·³ [ ¸ÞÀϵ¥ÀÌŸ¿Í µðºñ µ¿±âÈ ÀÛ¾÷ ]À» Çغ¸½Å ÈÄ À¥»ó¿¡¼ º¸¿©Áö´ÂÁö È®ÀÎÇغ¸½Ã±â ¹Ù¶ø´Ï´Ù.
cd /home/nmail2/tools/ ./mail_box_dbsync.php ALL |
2. À¥»ó¿¡¼ ¸ÞÀÏÀÌ º¸¿©Áø´Ù¸é ¸ÞÀÏÀ» ¹ÞÀº ÈÄ µðºñ¿¡ ³Ö´Â °úÁ¤¿¡¼ ¹®Á¦°¡ ¹ß»ýÇßÀ» ¼ö ÀÖÀ¸´Ï ¾Æ·¡Ã³·³ ¿À´Ã ³¯Â¥ÀÇ ·Î±×°¡ ³²¾ÆÀÖ´ÂÁö È®ÀÎÇغ¸½Ã±â ¹Ù¶ø´Ï´Ù.
tail /var/MailRoot/logs/filters-200701020000 |
3. ¾Æ·¡¿Í µ¿ÀÏÇÏ°Ô ½©½ºÅ©¸³Æ®¸¦ ½ÇÇàÇغ¸½Ã°í ¿¡·¯¸Þ¼¼Áö°¡ ³ª¿Â´Ù¸é ¾Ë·ÁÁֽñ⠹ٶø´Ï´Ù. /home/nmail2 °¡ ¾Æ´Ñ ´Ù¸¥ °÷¿¡ ¼³Ä¡ÇÏ´õ¶óµµ /home/nmail2 ·Î ½Éº¼¸¯¸µÅ©°¡ °É¸®µµ·Ï µÇ¾î ÀÖ½À´Ï´Ù. ¹Ýµå½Ã ¾Æ·¡Ã³·³ Àüü°æ·Î¸¦ ¸ðµÎ ÀÔ·ÂÇؼ ½ÇÇàÇغ¸½Ã±â ¹Ù¶ø´Ï´Ù.
Linux OS) /home/nmail2/nmail/filter.sh.php
Solairs OS) /export/home/nmail2/nmail/filter.sh.php
Á¤»óÀûÀÎ ½ÇÇà°á°ú) [root@ibin2 /]# /home/nmail2/nmail/filter.sh.php ¿Ã¹Ù¸¥ °æ·Î·Î Á¢±ÙÇÏ¿© ÁֽʽÿÀ. |
4. PHP ¹öÁ¯ È®Àνà ¾Æ·¡Ã³·³ 'ionCube PHP Loader' ¸ðµâÀÌ µî·ÏµÈ »óÅ·Π³ª¿Í¾ß ÇÕ´Ï´Ù.
/usr/bin/php -v PHP 4.4.1 (cli) (built: Dec 26 2005 15:06:08) Copyright (c) 1997-2004 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with the ionCube PHP Loader v3.1.22, Copyright (c) 2002-2006, by ionCube Ltd. |
5. 4¹ø °úÁ¤¿¡¼ ¸ðµâÀÌ µî·ÏµÇÁö ¾Ê¾Ò´Ù¸é À¥¼¹ö¿Í ½©¸ðµåÀÇ PHP ¹öÁ¯, php.ini °æ·Î¸¦ ºñ±³Çغ¸¾ß ÇÕ´Ï´Ù.
À¥¼¹ö) À¥¸ÞÀÏÀÇ [¸ÞÀϼ¹ö°ü¸® - PHPINFO]¿¡¼ È®ÀÎ.
½©¸ðµå) /usr/bin/php -v; /usr/bin/php -i|grep ini
A) PHP ¹öÁ¯ÀÌ ´Ù¸¥ °æ¿ì.
PHP°¡ 2°³ ÀÌ»ó ¼³Ä¡µÈ °æ¿ì·Î½á »ç¿ëÇÏÁö ¾Ê´Â PHP¸¦ Á¦°ÅÈÄ /usr/bin/php ¿¡ »ç¿ëÇÏ´Â PHPÀÇ ½ÇÇàÆÄÀÏÀ» º¹»çÇØ ³Ö¾î¾ß ÇÕ´Ï´Ù.
B) PHP ¹öÁ¯ÀÌ °°Áö¸¸ php.ini °æ·Î°¡ ´Ù¸¥ °æ¿ì
¾È³ç¸®´ª½º µî ÀϺΠ¹èÆ÷ÆÇ¿¡¼´Â À¥¼¹ö¿Í ½©¸ðµå¿¡¼ÀÇ php.ini °æ·Î°¡ ´ÙÀ½Ã³·³ ´Ù¸¥ °æ¿ì°¡ ÀÖ½À´Ï´Ù. ÀÌ °æ¿ì À¥¼¹ö¿¡¼ »ç¿ëµÇ´Â php.ini ÀÇ ¸¶Áö¸·¿¡ Ãß°¡µÈ ¿£¸ÞÀÏ °ü·Ã ¼³Á¤À» ±×´ë·Î º¹»çÇϼż ½©¸ðµå¿¡¼ »ç¿ëµÇ´Â php.ini ÀÇ ¸¶Áö¸·¿¡ Ãß°¡ÇϽŠÈÄ 4¹ø °úÁ¤À¸·Î È®ÀÎÇÏ½Ã¸é µË´Ï´Ù.
¡Ø ¸ÞÀϼ¹ö °ü¸®¿¡ ÇÊ¿äÇÑ µµ¿ò¸»À» Á¤¸®Çسõ¾Ò½À´Ï´Ù. ¼³Ä¡ÇϽŠÀ¥¸ÞÀÏÀÇ [¸ÞÀϼ¹ö°ü¸® >> ¸ÞÀϼ¹ö°ü¸® FAQ]¿¡ µî·ÏµÇ¾î ÀÖ½À´Ï´Ù. ¾Æ·¡ µ¥¸ð»çÀÌÆ®¿¡¼ ¹Ì¸® È®ÀÎÇغ¸½Ç ¼ö µµ ÀÖ½À´Ï´Ù.
http://nbuilder.net/nmail/help.php?id=SAFAQ
¡Ø ¸ñÂ÷ ¹Ì¸®º¸±â
¢Â ¸ÞÀϼ¹ö ½ÃÀÛ°ú Á¾·á, »ç¿ë Æ÷Æ®(¹æȺ®¼³Á¤)
¢Â ¸ÞÀϼ¹ö ¼³Á¤ ¾È³»
¢Â ¸ÖƼµµ¸ÞÀÎ Ãß°¡ ¾È³»
¢Â µ¥ÀÌŸ ¹é¾÷ ¾È³»
¢Â SMTP RELAY(¿ÜºÎ ¸ÞÀÏ¹ß¼Û ±ÇÇÑ) ¼³Á¤
¢Â ÆíÁö¾²±â½Ã ÃÖ´ë ÷ºÎÆÄÀÏ ¿ë·® Á¶Àý ¾È³»
¢Â ¸ÞÀÏŬ¶óÀ̾ðÆ®(¾Æ¿ô·è µî)»ç¿ë½Ã ÀÎÁõ¹æ¹ý¿¡ ´ëÇÑ ¾È³»
¢Â ¸ÞÀÏ ÆÄÀÏ°ú µðºñÀÇ µ¿±âÈ ¾È³»
¢Â ¹æȺ® »ç¿ë½Ã À¯ÀÇ»çÇ×
¢Â ¼¹ö ÀÌÀü½Ã À¯ÀÇ»çÇ×
¢Â µðºñ¿¡ ÀúÀåµÈ µ¥ÀÌŸ¸¦ ÀÓÀÇ·Î ¼öÁ¤ÇÏ°íÀÚ ÇÒ¶§ÀÇ À¯ÀÇ»çÇ×
¡Ø ¾Æ¿ô·è µîÀÇ ¸ÞÀÏŬ¶óÀ̾ðÆ®¿¡¼ ¸ÞÀÏÀ» º¸³»°í ¹Þ±â À§ÇÑ »ç¿ë¹æ¹ý ¹× ¹®Á¦ ¹ß»ý½Ã ÇØ°áÃ¥À» Á¤¸®Çسõ¾Ò½À´Ï´Ù. ¼³Ä¡ÇϽŠÀ¥¸ÞÀÏÀÇ [POP3 ÀÌ¿ë¾È³»]¿¡ µî·ÏµÇ¾î ÀÖ½À´Ï´Ù. ¾Æ·¡ µ¥¸ð»çÀÌÆ®¿¡¼ ¹Ì¸® È®ÀÎÇغ¸½Ç ¼ö µµ ÀÖ½À´Ï´Ù.
http://nbuilder.net/nmail/help.php?id=POP3
¡Ø ¸ñÂ÷ ¹Ì¸®º¸±â
1. POP3/SMTP ¼³Á¤¹æ¹ý ¾È³».
2. ¼³Á¤¹æ¹ý µû¶óÇϱâ - Office
Outlook
3. ¼³Á¤¹æ¹ý µû¶óÇϱâ - Outlook
Express
4. ¾Æ¿ô·è µîÀÇ ¸ÞÀÏ ÇÁ·Î±×·¥°ú À¥¸ÞÀÏÀ» µ¿½Ã¿¡ »ç¿ëÇÒ °æ¿ìÀÇ À¯ÀÇ»çÇ×.
5. ¾Æ¿ô·è µîÀÇ ¸ÞÀÏ ÇÁ·Î±×·¥¸¸ »ç¿ëÇÒ °æ¿ìÀÇ ¸ÞÀÏ ¿ë·® ÃÊ°ú °¡´É¼º.
¡Ø ¸ÞÀÏ ¼Û¼ö½Å°úÁ¤¿¡¼ ¹ß»ýÇÏ´Â ¸®ÅϸÞÀÏ(¼Û¼ö½Å ¿¡·¯¿¡ ´ëÇÑ ¸Þ¼¼Áö)¿¡ ´ëÇØ ¿¡·¯º°·Î ¿øÀÎ ¹×ÇØ°áÃ¥À» Á¤¸®Çسõ¾Ò½À´Ï´Ù. ¼³Ä¡ÇϽŠÀ¥¸ÞÀÏÀÇ »ó´Ü¸Þ´ºÁß [¸®ÅϸÞÀÏ ºÐ¼®]¿¡ µî·ÏµÇ¾î ÀÖ½À´Ï´Ù. ¾Æ·¡ µ¥¸ð»çÀÌÆ®¿¡¼ ¹Ì¸® È®ÀÎÇغ¸½Ç ¼ö µµ ÀÖ½À´Ï´Ù.
http://nbuilder.net/nmail/help.php?id=RETURNMAIL
¡Ø ¸ñÂ÷ ¹Ì¸®º¸±â
¢Â ÀϽÃÀûÀÎ Àü¼Û ½ÇÆÐ
- 417 Temporary delivery error
- The maximum number of delivery attempts has been reached
- End of socket stream data
- Invalid server address
- Bad server response
¢Â ¹Þ´Â»ç¶÷ÀÌ Á¸ÀçÇÏÁö ¾Ê´Â °æ¿ì
- 550 User unknown
- 550 Mailbox unavailable
- 550 5.1.1 No such user
- 554 delivery error: dd This user doesn't have a yahoo.co.kr account
(userid@domain.com) [-5] - mta114.mail.krs.yahoo.com
¢Â ¹Þ´Â»ç¶÷ÀÌ »ç¿ëÁßÁöµÈ °æ¿ì
- 550 Account disabled
- 550 5.1.1 Inactive mbox
- 550 5.1.1 Suspended user
- 554 delivery error: dd Sorry your message to userid@domain.com cannot be
delivered. This account has been disabled or discontinued [#102]. -
mta115.mail.krs.yahoo.com
¢Â ¹Þ´Â»ç¶÷ÀÇ ¸ÞÀÏ¿ë·®ÀÌ ÃÊ°úµÈ °æ¿ì
- 552 Requested mail action aborted: exceeded storage allocation -
<userid@domain.com>
- The recipient's mailbox is full
¢Â ¹Þ´Â»ç¶÷ÀÇ ½ºÆÔ¼³Á¤(¼ö½Å°ÅºÎ)¿¡ ÀÇÇØ Â÷´ÜµÈ °æ¿ì
- 550 You are registered as spammer (by user's reject list)
- 554 5.0.0 Service unavailable (userid: mail is denied, by spam filter)
¢Â ¸ÞÀϹ߼۱ÇÇÑÀÌ ¾ø°Å³ª »ó´ë¹æ ¸ÞÀϼ¹ö ¼³Á¤ ¹®Á¦
- 550 Relay denied
- 554 Relay operation rejected
- 550 5.7.1 Unable to relay for userid@domain.com
¢Â ´ë·® ¸ÞÀÏ ¹ß¼ÛÀ¸·Î ÀÎÇØ ´ëÇüÆ÷ÅзκÎÅÍ IP°¡ Â÷´ÜµÈ °æ¿ì
- 550 5.7.1 <userid@domain.com>... Error.your access was denied.? Since
you sent too many e-mails,you are not allowed to send more e-mails within 24
hours.After 24 hours,you can send e-mails as usual.If you did not send any
e-mails,which is considered as a spam,you'd better register
- 421 4.3.2 Your IP(111.112.113.114) is filtered and this connection will be
closed. You must register your IP to http://realip.naver.com
- 421 4.3.1 You send too many messages.
- 5.1.0 - Unknown address error 550-'Transaction failed. (SPAM_SUSPECT:IP_CONTROL)
(http://cleanip.paran.com)'
- 451 mta113.mail.krs.yahoo.com Resources temporarily unavailable. Please try
again later [#4.16.5].
¢Â RBL¿¡ ÀÇÇØ Â÷´ÜµÈ °æ¿ì
- 421 4.3.2 Your ip is filtered by RBL
(http://realip.naver.com/rbl/rblinfo.html)(IP:111.112.113.114)(Caues:http://dsbl.org/listing?111.112.113.114)
- 553 5.3.0 ... Rejected - see http://www.mail-abuse.org/rbl/
- 553-mail rejected because your IP is in DUL. See http://www.mail-abuse.com/enduserinfo.html
¢Â »ó´ë¹æ ¸ÞÀϼ¹ö¿¡¼ ½ºÆÔÀ¸·Î ÀνÄÇؼ Â÷´ÜµÈ °æ¿ì
- 553 Blocked for spam
- 550 5.5.0 Your message was rejected.
¢Â »ó´ë¹æ ¸ÞÀϼ¹ö¿¡¼ ¹ÙÀÌ·¯½º·Î ÀνÄÇؼ Â÷´ÜµÈ °æ¿ì
- 550 Virus in your mail!!!
¢Â ÷ºÎÆÄÀÏ¿¡ ½ÇÇàÆÄÀÏÀ» ÷ºÎÇÒ ¼ö ¾ø´Â °æ¿ì - ±¸±Û
- 552 5.7.0 Illegal Attachment 36si248323nzk+I9:I15
¢Â ¹Þ´Â»ç¶÷°ú º¸³½»ç¶÷¿¡ ¹®Á¦°¡ ÀÖ¾î ¸®ÅϸÞÀÏÀÌ ¹Ýº¹µÇ´Â °æ¿ì
- Mail loop detected
¢Â ¹Þ´Â ¸ÞÀϼ¹ö¿¡¼ Çã¿ëÇÏ´Â ÃÖ´ë¸ÞÀÏÅ©±â¸¦ ÃÊ°úÇÑ °æ¿ì
- Message size excedes the server limit