Nmail PHP Guide

- Unix/Linux -

Version 2.3.1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

http://passkorea.net


 

- ¸ñ  Â÷ -

 

I.   ¼³Ä¡ Áغñ. - 3 -

1.   ¼³Ä¡½Ã ÇÊ¿äÇÑ ÇÁ·Î±×·¥ ¹öÀü. - 3 -

2.   ¸®´ª½º ¹èÆ÷ÆÇ ¼±ÅÃ. - 3 -

3.   ¸Þ´º¾ó³»ÀÇ ¿¹Á¦ ½ÇÇà ¾È³». - 4 -

4.   Apache + PHP + MysQL RPM ¼³Ä¡. - 4 -

5.   ÀÚü ³×ÀÓ¼­¹ö(DNS) ¿î¿µ. - 5 -

6.   ¼­¹ö¿¡¼­ »ç¿ëÁßÀÎ ³×ÀÓ¼­¹ö È®ÀÎ. - 5 -

7.   hostname È®ÀÎ. - 6 -

II.        ¼³Ä¡. - 7 -

1.   PHP °æ·Î È®ÀÎ. - 7 -

2.   PHP È®Àå¸ðµâ È®ÀÎ. - 7 -

3.   ±âÁ¸ ¸ÞÀϼ­ºñ½º(SMTP/POP3) ÁßÁö. - 9 -

4.   ÀϺΠ¸®´ª½º ¹èÆ÷ÆÇÀÇ SELinux ÁßÁö. - 10 -

5.   ¼³Ä¡ ÇÁ·Î±×·¥ ½ÇÇà. - 10 -

6.   Apache °¡»óÈ£½ºÆ® ¼³Á¤. - 11 -

7.   Apache ¾Ë¸®¾Æ½º ¼³Á¤. - 12 -

8.   À¥¸ÞÀÏ Á¢¼Ó. - 13 -

9.   ¸ÖƼ µµ¸ÞÀÎ, ȸ¿ø Ãß°¡. - 13 -

III.      ¼³Ä¡½Ã ¹®Á¦ ÇØ°á. - 15 -

1.   PHP mailparse ¸ðµâÀÌ ÀÚµ¿À¸·Î ¼³Ä¡µÇÁö ¾Ê´Â °æ¿ì. - 15 -

2.   ¸ÞÀÏ¿£Áø ¼Ò½º ÄÄÆÄÀÏÀÌ ÇÊ¿äÇÑ °æ¿ì. - 16 -

3.   À¥¸ÞÀÏ¿¡¼­ ¹ÞÀº ¸ÞÀÏÀÌ º¸ÀÌÁö ¾Ê´Â °æ¿ì. - 17 -

IV.        ¸ÞÀϼ­¹ö °ü¸® ¾È³». - 19 -

V.   POP3(¾Æ¿ô·è µî) ÀÌ¿ë¾È³». - 20 -

VI.        ¸®ÅϸÞÀÏ ºÐ¼® ¾È³». - 21 -

 


 

 

 

I.                    ¼³Ä¡ Áغñ

 

 

 

1.      ¼³Ä¡½Ã ÇÊ¿äÇÑ ÇÁ·Î±×·¥ ¹öÀü

¿£¸ÞÀÏÀº APM(Apache + PHP + MySQL) µ¥¸óÀ» ±â¹ÝÀ¸·Î Unix/Linux ȯ°æ¿¡¼­ »ç¿ëÇϵµ·Ï Á¦À۵Ǿú½À´Ï´Ù¿£¸ÞÀÏ µ¿ÀÛ¿¡ ÇÊ¿äÇÑ ÃÖ¼Ò»ç¾çÀº ´ÙÀ½°ú °°½À´Ï´Ù.

 

[OS] Linux, FreeBSD, Solaris

[Apache] 1.3.X ÀÌ»ó, Apache 2 Áö¿ø.

[PHP] 4.3.0 ÀÌ»ó, PHP 5 Áö¿ø.  (mbstring, iconv ¸ðµâ ÇÊ¿ä)

[MySQL] 3.23.6 ÀÌ»ó, MySQL 4, MySQL 5 Áö¿ø.  (MySQL 4 À̻󿡼­´Â ¼º´ÉÇâ»ó ÀÖÀ½)

 

 

2.      ¸®´ª½º ¹èÆ÷ÆÇ ¼±ÅÃ

¸®´ª½ºÀÇ °æ¿ì ±¹³»¿¡¼­ °¡Àå ¸¹ÀÌ »ç¿ëµÇ´Â ·¹µåÇÞ °è¿­ÀÇ ¸®´ª½º Áß ¾÷µ¥ÀÌÆ®°¡ Áö¼ÓÀûÀ¸·Î ÀÌ·ç¾îÁö´Â ¹èÆ÷ÆÇÀ» ±ÇÀåÇص帮°í ÀÖ½À´Ï´ÙƯÈ÷ ·¹µåÇÞ 9ÀÇ °æ¿ì °ø½Ä ¾÷µ¥ÀÌÆ®°¡ Áß´ÜµÈ Á¦Ç°À̱⠶§¹®¿¡ º°µµÀÇ º¸¾ÈÁ¶Ä¡°¡ ¾øÀ» °æ¿ì Â÷ÈÄ º¸¾È»ó ¹®Á¦°¡ »ý±æ °¡´É¼ºÀÌ ³ôÀ¸¹Ç·Î »ç¿ëÇÏÁö ¾Ê´Â °ÍÀÌ ÁÁ½À´Ï´Ù.

 

µû¶ó¼­ ´ÙÀ½Ã³·³ ·¹µåÇÞ °è¿­ÀÇ ´Ù¸¥ ¹èÆ÷ÆÇÀ» ±ÇÀåÇص帮°í ÀÖ½À´Ï´Ù.

- CentOS - http://www.centos.org

     => ±¹³» Âü°í»çÀÌÆ® - http://centos.pe.kr

     => ·¹µåÇÞ ¿£ÅÍÇÁ¶óÀÌÁî ¹öÁ¯À» ±â¹ÝÀ¸·Î ¸¸µé¾îÁø ¹èÆ÷ÆÇÀÔ´Ï´Ù. (±ÇÀå)

- Fedora Core - http://fedora.redhat.com

     => ·¹µåÇ޻翡¼­ ¿£ÅÍÇÁ¶óÀÌÁî ¹öÁ¯°ú´Â º°°³·Î Áö¿øÇÏ´Â ¹«·á ¹èÆ÷ÆÇÀÔ´Ï´Ù.

 

 

 

 

3.      ¸Þ´º¾ó³»ÀÇ ¿¹Á¦ ½ÇÇà ¾È³»

¾Æ·¡Ã³·³ »ç°¢¹Ú½º¾È¿¡ µé¾î°¡´Â ³»¿ëÀº ¼­¹ö¿¡ SSL/Telnet À¸·Î Á¢¼ÓÇÑÈÄ Å͹̳ÎÈ­¸é¿¡¼­ ÀÔ·ÂÇØ¾ßµÉ ½© ¸í·É¾îÀÔ´Ï´ÙÀ̶§ ˜Þ(#)À¸·Î ½ÃÀ۵Ǵ ¶óÀÎÀº ÁÖ¼®Ç¥½Ã·Î ¾È³»¹®±¸À̹ǷΠÀÔ·ÂÇÒ ÇÊ¿ä°¡ ¾øÀ¸¸ç ÀÔ·ÂÇÏ´õ¶óµµ ½ÇÇàµÇÁö ¾Ê½À´Ï´Ù.

# PHP ½ÇÇàÆÄÀÏÀÌ Á¸ÀçÇÏ´ÂÁö È®ÀÎÇÕ´Ï´Ù.

    => ÁÖ¼®Ç¥½Ã·Î ´ÙÀ½¿¡ ³ª¿Ã ¸í·É¿¡ ´ëÇÑ ¾È³»ÀÔ´Ï´Ù.

ls /usr/bin/php

    => Å͹̳ÎÈ­¸é¿¡ º¹»çÈÄ ºÙ¿©³Ö±â³ª Á÷Á¢ ÀÔ·ÂÇؾßÇÏ´Â ½© ¸í·ÉÀÔ´Ï´Ù.

#result# /usr/bin/php

=> ½©¸í·É ½ÇÇàÈÄ È­¸é»ó¿¡ Ãâ·ÂµÇ´Â °á°ú¹°ÀÔ´Ï´Ù.

 

 

4.      Apache + PHP + MysQL RPM ¼³Ä¡

CentOS, Fedora Core µîÀÇ ·¹µåÇÞ °è¿­ÀÇ ÃֽŠ¹èÆ÷ÆÇÀ» »ç¿ëÇÒ °æ¿ì ¡°yum¡±ÇÁ·Î±×·¥À» ÅëÇØ ¾Æ·¡ 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 php-pecl-mailparse

# Apache, MySQL µ¥¸ó ½ÃÀÛ

/etc/init.d/httpd start

/etc/init.d/mysqld start

# mysql root ºñ¹Ð¹øÈ£ ÁöÁ¤

mysqladmin password ºñ¹Ð¹øÈ£ÁöÁ¤

¿¹Á¦) AnNyung

# Apache + PHP + MySQL ¼³Ä¡

pkgadd -u apache mysql mysql-client php php-pear php-devel php-binary php-mysql php-mbstring php-iconv php-gd

# Apache, MySQL µ¥¸ó ½ÃÀÛ

/etc/init.d/httpd start

/etc/init.d/mysqld start

# mysql root ºñ¹Ð¹øÈ£ ÁöÁ¤

mysqladmin password ºñ¹Ð¹øÈ£ÁöÁ¤

 

 

5.      ÀÚü ³×ÀÓ¼­¹ö(DNS) ¿î¿µ

ÀÚü³×ÀÓ¼­¹ö(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

 

# ù¹ø° ³×ÀÓ¼­¹ö¸¦ ÀÚü³×ÀÓ¼­¹ö·Î ÁöÁ¤.(ù¹ø° ¶óÀο¡ ¾Æ·¡ ³»¿ëÃß°¡)

vi /etc/resolv.conf

nameserver 127.0.0.1

 

 

6.      ¼­¹ö¿¡¼­ »ç¿ëÁßÀÎ ³×ÀÓ¼­¹ö È®ÀÎ

  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 nbuilder.net 211.170.106.66

#result# Server:  passkorea.net

#result# Address:  211.170.106.66

 

#result# Name: nbuilder.net

#result# Address:  211.170.106.96

 

 

7.      hostname È®ÀÎ

hostname Àº FQDN(Fully Qualified Domain Name) Çü½Ä¿¡ ¾Ë¸Âµµ·Ï ½ÇÁ¦ Á¸ÀçÇÏ´Â µµ¸ÞÀÎ(È£½ºÆ®)¸íÀ» »ç¿ëÇØ¾ß ÇÕ´Ï´ÙÀÌ ¼³Á¤ÀÌ À߸øµÈ °æ¿ì ¿£¸ÞÀÏ¿¡¼­´Â ¹®Á¦°¡ µÇÁö ¾ÊÀ¸³ª ¼­¹ö³»ÀÇ ´Ù¸¥ À¥ÆäÀÌÁö¿¡¼­ ±âº» ¸ÞÀϹ߼ÛÇÔ¼ö(sendmail wrapper)¸¦ »ç¿ëÇØ ¸ÞÀÏÀ» ¹ß¼ÛÇÒ ¶§ ¹®Á¦°¡ ¹ß»ýÇÒ °¡´É¼ºÀÌ ÀÖ½À´Ï´Ù.

# ÇöÀç hostname ¼³Á¤ È®ÀÎÈÄ, localhostó·³ ½ÇÁ¦ Á¸ÀçÇϴ ȣ½ºÆ®(µµ¸ÞÀÎ)°¡ ¾Æ´Ò °æ¿ì º¯°æÇØ¾ß ÇÔ.

hostname

#result# localhost.localdomain

 

# º¯°æÇÒ È£½ºÆ®(µµ¸ÞÀÎ)ÀÇ IP°¡ ÇöÀç ¼­¹ö IP·Î ¿Ã¹Ù¸£°Ô ¼³Á¤µÇ¾î ÀÖ´ÂÁö È®ÀÎ.

ping mail.YourDomain.com

 

# IP°¡ ¿Ã¹Ù¸£°Ô ¼³Á¤µÈ °æ¿ì º¯°æ.

hostname mail.YourDomain.com

vi /etc/sysconfig/network

HOSTNAME=localhost.localdomain

=>

HOSTNAME=mail.YourDomain.com

 

 

 

 

II.                ¼³Ä¡

 

 

 

1.      PHP °æ·Î È®ÀÎ

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
php -i|grep ini

 

 

2.      PHP È®Àå¸ðµâ È®ÀÎ

¾Õ¼± ¡°¼³Ä¡ Áغñ¡±´Ü°è¿¡¼­ ¾ð±ÞµÇ¾î ÀÖ´Â 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 ¸¦ ã¾Æ¼­ ¼³Ä¡ÇÏ½Ã¸é µË´Ï´Ù.

php-pecl-mailparse °¡ ¾ø´Â ½Ã½ºÅÛÀº Â÷ÈÄ Á÷Á¢ ¼³Ä¡ÇÏ´Â ¹æ¹ýÀÌ µû·Î ¼³¸íµÇ¾î ÀÖ½À´Ï´Ù.

¿¹Á¦) Fedora Core ÀÇ °æ¿ì yum À¸·Î °£´ÜÇÏ°Ô ¼³Ä¡°¡´É.

yum -y install php-mbstring php-iconv php-pecl-mailparse

 

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

 

 

3.      ±âÁ¸ ¸ÞÀϼ­ºñ½º(SMTP/POP3) ÁßÁö

¼³Ä¡½Ã »õ·Î¿î SMTP/POP3 ¼­ºñ½º¸¦ ½ÇÇàÇÏ°Ô µË´Ï´Ùµû¶ó¼­ ±âÁ¸¿¡ ¿î¿µÁßÀÌ´ø SMTP/POP3 ¼­ºñ½º´Â Á¾·á½ÃÅ°°í ºÎÆýà ÀÚµ¿ ½ÇÇàµÇÁö ¾Êµµ·Ï Á¶Ä¡ÇÏ¼Å¾ß ÇÕ´Ï´Ù´ÙÀ½Àº Linux ¿¡¼­ ÀϹÝÀûÀ¸·Î ¸¹ÀÌ »ç¿ëµÇ´Â sendmail, ipop3 µ¥¸óÀ» ±âÁØÀ¸·Î ÇÑ °ÍÀÌ¸ç ½Ã½ºÅÛ¿¡ µû¶ó postfix, qmail, courier-imap µî ´Ù¸¥ ¼­ºñ½º°¡ »ç¿ëÇÏ°í ÀÖÀ» ¼ö µµ ÀÖÀ¸´Ï ¹Ì¸® È®ÀÎÇغ¸½Ã±â ¹Ù¶ø´Ï´Ù.

# ºÎÆýà ÀÚµ¿½ÇÇà ¹æÁö.

/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 Æ÷Æ®¿¡¼­ ÀÀ´äÀÌ ÀÖ´Ù¸é ±âÁ¸ ¸ÞÀϼ­ºñ½º°¡ Á¾·áµÈ °ÍÀÌ ¾Æ´Ï¹Ç·Î ÀçÈ®ÀÎÇÏ¼Å¾ß ÇÕ´Ï´Ù.

 

 

4.      ÀϺΠ¸®´ª½º ¹èÆ÷ÆÇÀÇ SELinux ÁßÁö

fedora, redhat enterprise µî SELinux °¡ ¼³Ä¡µÈ ¸®´ª½º¿¡¼­´Â ¾Æ·¡Ã³·³ ÀÌ ±â´ÉÀ» ¼³Ä¡½Ã ¾Ë ¼ö ¾ø´Â ¹®Á¦°¡ ¹ß»ýÇÏÁö ¾Ê½À´Ï´Ù.

# ¼³Á¤ÆÄÀÏ¿¡¼­ ¿É¼ÇÀ» enforcing ¿¡¼­ disabled ·Î ¼öÁ¤.

vi /etc/selinux/config

        SELINUX=enforcing

        =>

        SELINUX=disabled

 

# SELinux ¸¦ ÀçºÎÆÃÇÏÁö ¾Ê°í Áï½Ã ÁßÁö

/usr/sbin/setenforce 0

 

# ¸¸¾à setenforce °¡ ¾ø´Ù¸é ¼­¹ö¸¦ ÀçºÎÆÃÇØ¾ß ÇÕ´Ï´Ù.

 

 

5.      ¼³Ä¡ ÇÁ·Î±×·¥ ½ÇÇà

¼³Ä¡ ÇÁ·Î±×·¥À» ´Ù¿î¹Þ¾Æ¼­ ¿øÇÏ´Â µð·ºÅ丮¿¡ ³Ö¾îµÎ°í ½ÇÇàÇÕ´Ï´ÙÀ̶§ ¾ÆÆÄÄ¡ À¥¼­¹ö¸¦ ¹Ì¸® ½ÇÇàÇصξî¾ß ¼³Ä¡ ÇÁ·Î±×·¥¿¡¼­ ¾ÆÆÄÄ¡ À¥¼­¹öÀÇ Á¤º¸¸¦ ÀÚµ¿ÀνÄÇÒ ¼ö ÀÖ°Ô µË´Ï´ÙÀÚ¼¼ÇÑ ³»¿ëÀº ¼³Ä¡ ÇÁ·Î±×·¥¿¡¼­ ³ª¿À´Â ¾È³»¹®±¸¸¦ º¸°í µû¶ó¼­ ÁøÇàÇÏ½Ã¸é µË´Ï´Ù.

¿¹Á¦) /tmp µð·ºÅ丮¿¡ ³Ö¾îµÎ¾úÀ» °æ¿ìÀÇ ¿¹Á¦.

# ÇÁ·Î±×·¥°ú ¼³Ä¡ÆÄÀÏÀ» ´Ù¿î¹Þ¾Æ¼­ FTP·Î ¿Ã·ÁµÎ°Å³ª wget À¸·Î ¹Þ½À´Ï´Ù.

#wget http://passkorea.net/nmailphp/nmail-php-linux.tgz

 

# ¾ÐÃàÀ» ÇØÁ¦ÇÕ´Ï´Ù.

tar zxvf nmail-php-linux.tgz

 

# ¼³Ä¡ ½ºÅ©¸³Æ®¸¦ ½ÇÇàÇÑ ÈÄ ¡®¼³Ä¡ ¿Ï·á¡¯°¡ ³ª¿Ã¶§±îÁö Áö½Ã´ë·Î ÁøÇàÇÏ½Ã¸é µË´Ï´Ù.

php nmail-php-2.3.1_install.php

 

Âü°í) ¼³Ä¡ ÇÁ·Î±×·¥¿¡¼­ ÇѱÛÀÌ ±úÁ® º¸ÀÏ °æ¿ì ¾Æ·¡Ã³·³ ÇѱÛÄڵ带 ÁöÁ¤ÈÄ Àç½ÇÇàÇÔ.

# Linux

export LANG=ko_KR.eucKR

 

# Solaris

#export LANG=ko

 

# FreeBSD

#export ko_KR.EUC

 

php nmail-php-2.3.1_install.php

 

 

6.      Apache °¡»óÈ£½ºÆ® ¼³Á¤

¼³Ä¡ ¿Ï·á½Ã ¸¶Áö¸· È­¸é¿¡ ¾Æ·¡Ã³·³ Apache °¡»óÈ£½ºÆ® ¼³Á¤¹æ¹ý¿¡ ´ëÇÑ ³»¿ëÀÌ ³ª¿É´Ï´ÙÇØ´ç ³»¿ëÀ» Âü°íÇϼż­ ¼³Á¤ÆÄÀÏÀ» ÀûÀýÈ÷ ¼öÁ¤ÈÄ Apache ¸¦ Àç½ÃÀÛÇÏ½Ã¸é µË´Ï´Ù.

==============================================================================

= ¿£¸ÞÀÏ ¼³Ä¡ ÀÛ¾÷ÀÌ ¿Ï·áµÇ¾ú½À´Ï´Ù.

==============================================================================

ÀÌÁ¦ Apache À¥¼­¹öÀÇ ¼³Á¤ÆÄÀÏÀÎ httpd.conf ¿¡ °¡»óÈ£½ºÆ®(ȤÀº ¾Ë¸®¾Æ½º) ¼³Á¤À» Ãß°¡ÇÏ°í

Apache À¥¼­¹ö¸¦ Àç½ÃÀÛÇϸé À¥¸ÞÀÏÀ» »ç¿ëÇÏ½Ç ¼ö ÀÖ°Ô µË´Ï´Ù.

  httpd.conf ¿¡ Ãß°¡ÇؾßÇÒ ³»¿ë)

    ÁÖÀÇ) ¼­¹ö¿¡ µû¶ó NameVirtualHost, VIrtualHost Ç׸ñÀº ´Ù¸¦ ¼ö ÀÖÀ¸´Ï ±âÁ¸ ¼³Á¤À» È®ÀÎÇϼ¼¿ä.

    ÁÖÀÇ) ServerName Àº DNS ¼³Á¤¿¡ µû¶ó 'mail'À̶ó´Â 2Â÷µµ¸ÞÀÎÀÌ ºÙÁö ¾ÊÀ» ¼ö µµ ÀÖÀ¸´Ï

        DNS ¼­¹ö°ü¸®ÀÚ¿¡°Ô ¹®ÀÇÇϽñ⠹ٶø´Ï´Ù.

  httpd.conf ÀÇ ÀϹÝÀûÀÎ °æ·Î)

    RPM ¼³Ä¡½Ã) /etc/httpd/conf/httpd.conf

    ÄÄÆÄÀÏ ¼³Ä¡½Ã) /usr/local/apache/conf/httpd.conf

 

NameVirtualHost *:80

<VirtualHost *:80>

     ServerAdmin postmaster@YourDomain.com

     DocumentRoot /home/nmail2/nmail

     ServerName mail.YourDomain.com

ServerAlias mail.*    # mail. À¸·Î ½ÃÀÛÇÏ´Â ¸ðµç µµ¸ÞÀο¡ ÀÌ ¼³Á¤À» Àû¿ëÇÑ´Ù´Â ÀǹÌÀÓ.

     #ServerAlias mail.MultiDomain1.com mail.MultiDomain2.com

     ErrorLog logs/nmail2.error_log

     TransferLog logs/nmail2.access_log

     <Directory "/home/nmail2/nmail">

         Options MultiViews

         AllowOverride None

         Order allow,deny

         Allow from all

     </Directory>

</VirtualHost>

 

ÁÖÀÇ) ¼­¹ö³»¿¡ ±âÁ¸¿¡ ¿î¿µÁßÀÎ À¥»çÀÌÆ®°¡ ÀÖÀ» °æ¿ì

Apache °¡»óÈ£½ºÆ®¿¡ ¼±¾ðµÇÁö ¾ÊÀº µµ¸ÞÀÎÀ¸·Î Á¢¼ÓÇÒ °æ¿ì ù¹ø° °¡»óÈ£½ºÆ® ¼³Á¤À» µû¸£°Ô ´Ï´ÙÀÌ·Î ÀÎÇØ ±âÁ¸ À¥»çÀÌÆ®(www.YourDomain.com)¿ë °¡»óÈ£½ºÆ®°¡ µû·Î ¼±¾ðµÇÁö ¾ÊÀº »óÅ¿¡¼­ ¿£¸ÞÀÏ¿ë °¡»óÈ£½ºÆ®¸¦ Ãß°¡ÇÏ°Ô ¹®Á¦°¡ ¹ß»ýÇÒ ¼ö ÀÖ½À´Ï´Ù¹®Á¦°¡ »ý±âÁö ¾Êµµ·Ï ¹Ì¸® ±âÁ¸ À¥»çÀÌÆ®¿¡ ¸Â´Â °¡»óÈ£½ºÆ®°¡ ¼³Á¤À» È®ÀÎ ÈÄ Ãß°¡ÇÏ½Ã´Â°Ô ÁÁ½À´Ï´Ù.

 

ÁÖÀÇ) Apache ¼³Á¤ Áß ´ÙÀ½ Ç׸ñÀÌ ÀÖ´Ù¸é »èÁ¦ ÈÄ Àç½ÃÀÛÇØ¾ß ÇÕ´Ï´Ù±×·¸Áö ¾ÊÀ¸¸é À¥¸ÞÀÏ¿¡¼­ ÇѱÛÀÌ ±úÁú °¡´É¼ºÀÌ ÀÖ½À´Ï´Ù.

AddDefaultCharset UTF-8

 

 

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

ÀϹÝÀûÀÎ °æ¿ìó·³ http://mail.YourDomain.com ÇüÅÂÀÇ À¥¸ÞÀÏ ÁÖ¼Ò¸¦ »ç¿ëÇÒ °æ¿ì¿¡´Â ¡®¾Ë¸®¾Æ½º¡¯¼³Á¤À» µû·Î Àâ¾ÆÁÙ ÇÊ¿ä°¡ ¾ø½À´Ï´Ù.   ÇÏÁö¸¸ ¡®°¡»óÈ£½ºÆ®¡¯¼³Á¤À» »ç¿ëÇÏÁö ¾Ê°í http://YourDomain.com/mail/ ÇüÅ·Π»ç¿ëÇÏ·Á¸é ¡®¾Ë¸®¾Æ½º¡¯¼³Á¤À» ÀÌ¿ëÇÏ½Ã¸é µË´Ï´Ù.

Apache À¥¼­¹öÀÇ ¼³Á¤ÆÄÀÏÀÎ httpd.conf ¿¡¼­ ±âÁ¸ Alias ¿É¼Ç ¾Æ·¡¿¡ ¿£¸ÞÀÏ °ü·Ã Alias ¸¦ Ãß°¡ÈÄ À¥¼­¹ö¸¦ Àç½ÃÀÛÇÏ¸é µË´Ï´Ù.

# ±âÁ¸ Alias ¼³Á¤

Alias /icons/ "/usr/local/apache/icons/"

 

# ¿£¸ÞÀÏ Alias ¼³Á¤(»õ·Î Ãß°¡ÇؾßÇÒ ºÎºÐ)

Alias /mail "/home/nmail2/nmail"

<Directory "/home/nmail2/nmail">

         Options None

         AllowOverride None

         Order allow,deny

         Allow from all

</Directory>

 

 

8.      À¥¸ÞÀÏ Á¢¼Ó

À¥ºê¶ó¿ìÀú¿¡¼­ ¼³Ä¡ÇÑ ÁÖ¼Ò( http://mail.YourDomain.com ) ·Î Á¢¼ÓÇÏ½Ã¸é µË´Ï´Ù.  [¼­¹ö°ü¸®ÀÚ]°èÁ¤Àº ¾ÆÀ̵ð´Â postmaster À̸ç, ºñ¹Ð¹øÈ£´Â ¼³Ä¡½Ã ÀÔ·ÂÇÑ ºñ¹Ð¹øÈ£ÀÔ´Ï´Ù.

 

 

9.      ¸ÖƼ µµ¸ÞÀÎ, ȸ¿ø Ãß°¡

¸ÖƼ µµ¸ÞÀÎÀº [¼­¹ö°ü¸®ÀÚ]·Î ·Î±×ÀÎÈÄ [¸ÞÀϼ­¹ö°ü¸® - µµ¸ÞÀΰü¸®]¿¡¼­ Ãß°¡ÇÒ ¼ö ÀÖÀ¸¸ç ¸ÞÀÏ°èÁ¤µµ [¸ÞÀϼ­¹ö°ü¸® - ȸ¿ø°ü¸®]¿¡¼­ Ãß°¡ÇÒ ¼ö ÀÖ½À´Ï´Ù¸ÖƼ µµ¸ÞÀÎÀÇ °æ¿ì »ç¿ëÀÚ°¡ Á¢¼ÓÇÑ À¥ÆäÀÌÁö ÁÖ¼Ò(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"

 


 

 

 

III.             ¼³Ä¡½Ã ¹®Á¦ ÇØ°á

 

 

 

1.      PHP mailparse ¸ðµâÀÌ ÀÚµ¿À¸·Î ¼³Ä¡µÇÁö ¾Ê´Â °æ¿ì

¼Ò½º¸¦ ´Ù¿î¹Þ¾Æ Á÷Á¢ ÄÄÆÄÀÏÇؼ­ ¸ðµâÀ» ¼³Ä¡ÇÏ¸é µË´Ï´Ù.

# pear³ª wget À» ÅëÇØ mailparse ¼Ò½º¸¦ ´Ù¿î¹Þ½À´Ï´Ù.

pear download mailparse

# pecl download mailparse

# wget http://pecl.php.net/get/mailparse-2.1.1.tgz

 

# ´Ù¿î¹ÞÀº ÆÄÀÏÀÇ ¾ÐÃàÀ» ÇØÁ¦ÇÕ´Ï´Ù.

tar zxvf mailparse-2.1.1.tgz

 

# µð·ºÅ丮·Î À̵¿ÈÄ ¼Ò½º ÄÄÆÄÀÏ

cd mailparse-2.1.1/

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

 

 

2.      ¸ÞÀÏ¿£Áø ¼Ò½º ÄÄÆÄÀÏÀÌ ÇÊ¿äÇÑ °æ¿ì

·¹µåÇÞ °è¿­ÀÇ ¸®´ª½º, ¼Ö¸®¸®½º ÀϺΠ¹öÁ¯¿¡ ÇÑÇØ ¸ÞÀÏ¿£Áø ¹ÙÀ̳ʸ®¸¦ Á¦°øÇÏ°í ÀÖ½À´Ï´ÙÀÌ·Î ÀÎÇØ ÀϺΠOS¿¡¼­´Â ¼³Ä¡ÇÁ·Î±×·¥¿¡¼­ ÀÚµ¿À¸·Î ãÁö ¸øÇØ Á÷Á¢ ¼Ò½º ÄÄÆÄÀÏÀ» ÅëÇØ »ç¿ëÇÏ¼Å¾ß ÇÏ´Â °æ¿ì°¡ ÀÖÀ» ¼ö ÀÖ½À´Ï´Ù. ¶ÇÇÑ ¸ÞÀÏ¿£Áø°ü·Ã ÀÌ»ó Áõ»óÀÌ ¹ß°ßµÈ´Ù¸é ¼Ò½º ÄÄÆÄÀÏÀ» ÅëÇØ ´Ù½Ã ¼³Ä¡ÇÏ´Â °ÍÀ» ±ÇÀåÇص帳´Ï´Ù.

 

  ¼Ò½º ÄÄÆÄÀÏÀ» Çϱâ À§Çؼ­´Â ¡®gcc-c++¡¯µîÀÇ °³¹ßÆÐÅ°Áö°¡ ÇÊ¿äÇÏ°Ô µË´Ï´Ù°³¹ßÆÐÅ°Áö°¡ ¾øÀ»°æ¿ì CentOS µî¿¡¼­´Â ¾Æ·¡Ã³·³ ÆÐÅ°Áö°ü¸®ÀÚ¸¦ ÅëÇØ Ãß°¡ÇÏ½Ã¸é µË´Ï´Ù¸¸¾à yum µîÀÇ ÀÚµ¿ÆÐÅ°Áö°ü¸®µµ±¸°¡ ¾øÀ» °æ¿ì ¸®´ª½º ¹èÆ÷ÆÇÀ» devel ¹öÁ¯À¸·Î ´Ù½Ã ¼³Ä¡ÇؾßÇÒ ¼ö µµ ÀÖ½À´Ï´Ù.

yum -y install gcc gcc-c++

 

¼Ò½º ÄÄÆÄÀÏ ¹æ¹ý)

cd /home/nmail2/tools/mailserver/

tar zxvf xmail-1.22_20061024.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 PassKorea061024"ÀÎ °ÍÀ» È®ÀÎÇÔ.

/etc/init.d/xmail start

telnet 127.0.0.1 25

 

 

3.      À¥¸ÞÀÏ¿¡¼­ ¹ÞÀº ¸ÞÀÏÀÌ º¸ÀÌÁö ¾Ê´Â °æ¿ì

¿£¸ÞÀÏÀÇ °æ¿ì ºü¸¥ 󸮸¦ À§ÇØ ¸ÞÀÏÁ¤º¸¸¦ µðºñ¿¡ ÀúÀåÇÏ°Ô µË´Ï´Ù±×·¯³ª ¼³Ä¡½Ã ¹®Á¦°¡ ÀÖÀ» °æ¿ì µðºñ¿¡ ÀúÀåÇÏ´Â °úÁ¤¿¡¼­ ¿À·ù°¡ ¹ß»ýÇÒ ¼ö ÀÖ½À´Ï´ÙÀÌ °æ¿ì ¸ÞÀÏÀº ½ÇÁ¦·Î ¹Þ¾ÒÀ¸¹Ç·Î ¾Æ¿ô·è¿¡¼­ °¡Á®°¥ ¼ö ÀÖÁö¸¸ À¥¸ÞÀÏ¿¡¼­¸¸ º¸ÀÌÁö ¾Ê´Â Çö»óÀÌ ¹ß»ýÇÏ°Ô µË´Ï´Ù

 

´ÙÀ½ °¢ ´Ü°èº°·Î ¼ø¼­´ë·Î Å×½ºÆ®¸¦ ÁøÇàÇغ¸½Ã¸é µË´Ï´Ù¸¸¾à ¿¡·¯°¡ ³ª¿Â´Ù¸é ¿¡·¯¸Þ¼¼Áö¿Í ÇÔ²² ÀúÈñ ȨÆäÀÌÁö( 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¹ø °úÁ¤À¸·Î È®ÀÎÇÏ½Ã¸é µË´Ï´Ù.


 

 

 

IV.            ¸ÞÀϼ­¹ö °ü¸® ¾È³»

 

 

 

¡Ø ¸ÞÀϼ­¹ö °ü¸®¿¡ ÇÊ¿äÇÑ µµ¿ò¸»À» Á¤¸®Çسõ¾Ò½À´Ï´Ù¼³Ä¡ÇϽŠÀ¥¸ÞÀÏÀÇ [¸ÞÀϼ­¹ö°ü¸® >> ¸ÞÀϼ­¹ö°ü¸® FAQ]¿¡ µî·ÏµÇ¾î ÀÖ½À´Ï´Ù¾Æ·¡ µ¥¸ð»çÀÌÆ®¿¡¼­ ¹Ì¸® È®ÀÎÇغ¸½Ç ¼ö µµ ÀÖ½À´Ï´Ù.

http://nbuilder.net/nmail/help.php?id=SAFAQ

 

¡Ø ¸ñÂ÷ ¹Ì¸®º¸±â

¢Â ¸ÞÀϼ­¹ö ½ÃÀÛ°ú Á¾·á
¢Â ¸ÞÀϼ­¹ö ¼³Á¤ ¾È³»
¢Â ¸ÖƼµµ¸ÞÀÎ Ãß°¡ ¾È³»
¢Â µ¥ÀÌŸ ¹é¾÷ ¾È³»
¢Â SMTP RELAY(¿ÜºÎ ¸ÞÀÏ¹ß¼Û ±ÇÇÑ) ¼³Á¤

¢Â ÆíÁö¾²±â½Ã ÃÖ´ë ÷ºÎÆÄÀÏ ¿ë·® Á¶Àý ¾È³»
¢Â ¸ÞÀÏŬ¶óÀ̾ðÆ®(¾Æ¿ô·è µî)»ç¿ë½Ã ÀÎÁõ¹æ¹ý¿¡ ´ëÇÑ ¾È³»

¢Â ¸ÞÀÏ ÆÄÀÏ°ú µðºñÀÇ µ¿±âÈ­ ¾È³»
¢Â ¹æÈ­º® »ç¿ë½Ã À¯ÀÇ»çÇ×
¢Â ¼­¹ö ÀÌÀü½Ã À¯ÀÇ»çÇ×
¢Â µðºñ¿¡ ÀúÀåµÈ µ¥ÀÌŸ¸¦ ÀÓÀÇ·Î ¼öÁ¤ÇÏ°íÀÚ ÇÒ¶§ÀÇ À¯ÀÇ»çÇ×


 

 

 

V.               POP3(¾Æ¿ô·è µî) ÀÌ¿ë¾È³»

 

 

 

¡Ø ¾Æ¿ô·è µîÀÇ ¸ÞÀÏŬ¶óÀ̾ðÆ®¿¡¼­ ¸ÞÀÏÀ» º¸³»°í ¹Þ±â À§ÇÑ »ç¿ë¹æ¹ý ¹× ¹®Á¦ ¹ß»ý½Ã ÇØ°áÃ¥À» Á¤¸®Çسõ¾Ò½À´Ï´Ù. ¼³Ä¡ÇϽŠÀ¥¸ÞÀÏÀÇ [POP3 ÀÌ¿ë¾È³»]¿¡ µî·ÏµÇ¾î ÀÖ½À´Ï´Ù¾Æ·¡ µ¥¸ð»çÀÌÆ®¿¡¼­ ¹Ì¸® È®ÀÎÇغ¸½Ç ¼ö µµ ÀÖ½À´Ï´Ù.

http://nbuilder.net/nmail/help.php?id=POP3

 

¡Ø ¸ñÂ÷ ¹Ì¸®º¸±â

1. POP3/SMTP ¼³Á¤¹æ¹ý ¾È³».

2. ¼³Á¤¹æ¹ý µû¶óÇϱâ - Office Outlook

3. ¼³Á¤¹æ¹ý µû¶óÇϱâ - Outlook Express

4. ¾Æ¿ô·è µîÀÇ ¸ÞÀÏ ÇÁ·Î±×·¥°ú À¥¸ÞÀÏÀ» µ¿½Ã¿¡ »ç¿ëÇÒ °æ¿ìÀÇ À¯ÀÇ»çÇ×.

5. ¾Æ¿ô·è µîÀÇ ¸ÞÀÏ ÇÁ·Î±×·¥¸¸ »ç¿ëÇÒ °æ¿ìÀÇ ¸ÞÀÏ ¿ë·® ÃÊ°ú °¡´É¼º.

 

 


 

 

 

VI.            ¸®ÅϸÞÀÏ ºÐ¼® ¾È³»

 

 

 

¡Ø ¸ÞÀÏ ¼Û¼ö½Å°úÁ¤¿¡¼­ ¹ß»ýÇÏ´Â ¸®ÅϸÞÀÏ(¼Û¼ö½Å ¿¡·¯¿¡ ´ëÇÑ ¸Þ¼¼Áö)¿¡ ´ëÇØ ¿¡·¯º°·Î ¿øÀÎ ¹×ÇØ°áÃ¥À» Á¤¸®Çسõ¾Ò½À´Ï´Ù. ¼³Ä¡ÇϽŠÀ¥¸ÞÀÏÀÇ »ó´Ü¸Þ´ºÁß [¸®ÅϸÞÀÏ ºÐ¼®]¿¡ µî·ÏµÇ¾î ÀÖ½À´Ï´Ù¾Æ·¡ µ¥¸ð»çÀÌÆ®¿¡¼­ ¹Ì¸® È®ÀÎÇغ¸½Ç ¼ö µµ ÀÖ½À´Ï´Ù.

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