Nmail PHP Guide
- Windows -
Version 2.6.12
http://passkorea.net
- -
APM(Apache + PHP + MySQL) Windows/Unix/Linux ȯ濡 ϵ ۵Ǿϴ. ۿ ʿ ּһ ϴ.
[OS] Windows 2000/2003/2008/2012, Windows XP/7 (Linux/Unix ǰ )
[Apache] 1.3.X ̻, Apache 2.0 / 2.2 / 2.4 , IIS
[PHP] PHP 5.0 ~ 5.3 . (mbstring, iconv ʿ) / PHP 5.4 ̻ ġҰ
[MySQL] 3.23.6 ̻, MySQL 4, MySQL 5.6 .
Ʒó 簢ڽȿ [ - ] cmd Է â ¿ Էϴ ɾԴϴ. ̶ (#) ۵Ǵ ȳ̹Ƿ Է ʿ䰡 ϴ.
# PHP ϴ Ȯմϴ. => ּǥ÷ ɿ ȳԴϴ. php -v => ̳ȭ鿡 ٿֱ⳪ Էؾϴ Դϴ. #result# PHP 5.1.4 (cgi-fcgi) (built: May 4 2006 10:35:07) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies => ȭ µǴ Դϴ. |
- APM Ű Ʒ ġ Ѱ Ͻø ˴ϴ.
* PHP 5.0 ~ 5.3 ˴ϴ. PHP 5.4 Ұ.
* ġ ذϱ , ݵ ֽ Windows update ϷϽñ ٶϴ.
Apache, PHP, MySQL ġϱ. ()
Ʈ)
Apache - http://httpd.apache.org/
PHP - http://kr.php.net/
MySQL - http://dev.mysql.com
ٿε) 2013-12-03 ֽŹ
Apache - http://mirror.apache-kr.org//httpd/binaries/win32/
http://mirror.apache-kr.org//httpd/binaries/win32/httpd-2.2.25-win32-x86-openssl-0.9.8y.msi
PHP - http://windows.php.net/download/
http://windows.php.net/downloads/releases/php-5.3.27-Win32-VC9-x86.msi
* Apache ġ , VC9 x86 Thread Safe ƾ մϴ.
MySQL - http://dev.mysql.com/downloads/mysql/
http://cdn.mysql.com/Downloads/MySQLInstaller/mysql-installer-web-community-5.6.14.0.msi
Tip) ġ ϵ C:\NmailPHP_install\ صμž մϴ. /缳ġ ġ α ã ð ʽϴ.
Apache ġ)
a. ġ IIS ٸ Ѿ 浹 ʽϴ.
b. ġ(httpd-2.2.25-win32-x86-openssl-0.9.8y.msi) ̼ մϴ.
c. [Server Infomation] ΰ ּҸ Էմϴ.
d. [Setup Type] Custom մϴ.
e. [Custom Setup] Install to: C:\Program Files\Apache Software Foundation\Apache2.2\ Changeư Ŭϰ, ġ C:\NmailPHP\Apache ϰ, ư Ŭϸ ġ ۵˴ϴ.
f. ġ Ϸ [Windows ] ȭ Ŭմϴ.
g. (C:\NmailPHP\Apache\conf\httpd.conf) ó ɼ մϴ.
DirectoryIndex index.html => DirectoryIndex index.php index.htm index.html |
h. http://localhost/ (Ȥ IP)ּҸ ԷϿ,Apache ⺻ ȭ ġ Ϸ Դϴ.
PHP ġ)
a. ġ(php-5.3.27-Win32-VC9-x86.msi) ̼ մϴ.
b. [Destination Folder] ġ ̹Ƿ C:\NmailPHP\PHP մϴ.
c. [Web Server Setup] ġ Apache 2.2.x Module մϴ.
d. [Apache Configuration Directory] ġߴ Apache C:\NmailPHP\Apache\conf\ Էմϴ.
e. [Choose Items to Install] Ʒ ŬϿ Will be installed on local hard drive մϴ.
- Extensions
- Multi-Byte String
f. ġ Ϸ C:\NmailPHP\Apache\conf\httpd.conf LoadModule php5_module Ʒ ߰մϴ.
AddHandler application/x-httpd-php .php .htm .html |
g. ġ Ϸ C:\NmailPHP\PHP\php.ini Ʒ ɼ On մϴ.
short_open_tag = Off => short_open_tag = On |
h. [ – ] Apache 2.2 ٽ մϴ.
i. ġ (C:\NmailPHP\Apache\htdocs\) ڵ带 test.php ϴ.
<?php phpinfo(); ?> |
j. http://localhost/test.php ҷ鿩 PHP ´ٸ ġ Դϴ. PHP ʴ´ٸ ġ ̹Ƿ Apache, PHP 缳ġϽðų Ʒ غñ ٶϴ.
http://kr.php.net/manual/kr/install.apache2.php
MySQL ġ)
a. ġ(mysql-installer-web-community-5.6.14.0.msi) մϴ.
b. .NET Framework 4.0 ġ ʾҴٰ , .NET Framework 4.0 ġּž մϴ.
http://www.microsoft.com/ko-KR/download/details.aspx?id=17113
c. [Welcome]ȭ鿡 Install MySQL Products Ŭմϴ.
d. ̼ ϰ, ֽ Ȯ â (excute) Ŭմϴ.
e. [Coosing a Setup Type] Server Only üũϰ, Installation Path: Data Path: C:\NmailPHP\MySQL Էϰ, ġ մϴ.
f. [MySQL.com Sign-Up] ʿ Ƿ Skip Sign-Up մϴ.
g. ġ Ϸ [MySQL Server Instance Configuration Wizard ڵ ˴ϴ.
h. [Server Configuration type] Development Machineſ Server Machine ϰ, ܺο MySQL ʿ䰡 ٸ Open Firewall port for network access üũ մϴ.
i. [Root Account Password] MySQL root йȣ Էմϴ.
j. ⺻ ϸ ġ Ϸ˴ϴ.
k. ġ Ϸ C:\NmailPHP\MySQL\my.ini Ʒó ɼ մϴ.
[mysqld] max_allowed_packet=4M => [mysqld] max_allowed_packet=32M |
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" => sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" |
default-storage-engine=INNODB => default-storage-engine=MyISAM |
l. [ – ] MySQL56 ٽ մϴ.
AutoSet 6.3.1 - Apache + PHP + MySQL ġ α ()
ٿε - http://autoset.net/xe/download_autoset_6_3_1
* AutoSet 8.0.0 PHP 5.5 ̹Ƿ Ұ.
* AutoSet 6.0.0 ־ ġص ۵ Ұ.
ġ)
a. ġ ٿε Ƽ ϴ ġմϴ. (⺻ C:\AutoSet6)
b. Ȩ ̵ ġ ȳǾ ֽϴ.
c. ġϰ phpMyAdmin MySQL root йȣ ϼž մϴ. ( ʱ йȣ ؼ Ȼ ֽϴ.)
d. [ - MySQL ] max_allowed_packet 32M̻ Ȯ մϴ. ( Ŭ Ͽ ʴ ϰ ˴ϴ.)
e. [ - PHP ⺻ ] Sendmail ϰ, [ ] Ŭմϴ. (ؾ Ϲ ˴ϴ.)
f. [ - PHP – Session ] ڵ ϰ, [ ] Ŭմϴ. ( ڵ ۵Ǹ 뷮 ÷ ٿε ó α ʿ մϴ.)
g. [ – ] ġ մϴ.
h. php.exe php.ini θ ùٸ ã ȯ ߰մϴ.
1. [ - ý] [] Ŭϰ, [ȯ ]ư Ŭմϴ.
2. "ý " PHPRC ٸ, [ ]ư ŬϿ ߰մϴ.
̸ : PHPRC
: C:\AutoSet6\Server\conf\
* PHP ġ ̹Ƿ, ġ ٸ ֽϴ.
3. Path [] , ݷ(;) ؾ մϴ.
...;C:\AutoSet6\Server\bin\;
=>
...;C:\AutoSet6\Server\bin\
* ľ ġĿ â more, findstr ʴ ذ˴ϴ.
4. ϰ, [ - ] cmd ԷϿ â php Ȯغ ˴ϴ.
php -v
php -i|findstr ini
) Loaded Configuration File => C:\AutoSet6\Server\conf\php.ini
) Ŀ´Ƽ ġ ȭĸĿ Բ ϵǾ Ƿ Ͻø ġ ˴ϴ.
Խù ) ϱ - NMail PHP
Խù ũ) http://cafe.naver.com/autoset/2440
APMSETUP 7 - Apache + PHP + MySQL ġ α
ġ)
a. ġ ٿε Ƽ ϴ ġմϴ.
b. APMSETUP Ȩ ġϱ ġ ȳǾ ֽϴ.
c. APMSETUP ġϰ, phpMyAdmin(http://127.0.0.1/myadmin/) ID root н apmsetup αϿ MySQL root йȣ ϼž մϴ. ( ʱ йȣ ؼ Ȼ ֽϴ.)
d. APMSETUP ġ my.ini max_allowed_packet 32M̻ ϰ, MySQL մϴ.
ġ ) C:\APM_Setup\my.ini
max_allowed_packet = 1M => max_allowed_packet = 32M |
) 2009 6 29 my.ini ٹٲ Ͻø ϴ. ݵ Ʒó ⸦ ž մϴ.
- EditPlus / / http://editplus.co.kr/
- NOTEPAD++ / (GPL) / http://notepad-plus.sourceforge.net/
Ӽ â ó Ȯ մϴ.
ipconfig/all #result# Ethernet adapter : ...()... DNS Servers . . . . . . . . . . . : 211.170.106.66 164.124.101.2 |
ϵ DNS ù ° Ӽ ϴٰ ° Ӽ ϰ ˴ϴ. ù ° Ӽ üӼ ġؼ ش IP νô ϴ. üӼ DNS ʴ Windows Server OS ⺻ Ǵ DNS Ű ߰صνø ܺγӼ ϴ 캸 ó մϴ. üӼ 츦 Ͽ ȣ/ISP ü Ӽ 2, 3 صνô ϴ.
ϵ Ӽ ϴ ó Ȯغø ˴ϴ.
ex) nslookup ּ ӼIP
nslookup nbuilder.net ӼIP #result# Server: passkorea.net Address: 211.170.106.66
Name: nbuilder.net Address: 211.170.106.96 |
ġ ο SMTP/POP3 ϰ ˴ϴ. ̴ SMTP/POP3 ִٸ [ - ] Ű ڵ ʵ ġϼž մϴ. Windows Server ǰ ⺻ SMTP ǰ Ƿ ݵ Ѿ մϴ.
# ϼ SMTP(25), POP3(110)Ʈ Ȯ. telnet 127.0.0.1 25 telnet 127.0.0.1 110
# 25, 110 Ʈ ִٸ ϼ ƴϹǷ Ȯϼž մϴ. |
1. ٿ ġ α Ǯ ɴϴ.
UTF-8 ǰ - nmail-php-2.6.12_utf8.exe
EUC-KR ǰ - nmail-php-2.6.12.exe
2. Ǯ ġ C:\ ϸ ⺻ ġ C:\NmailPHP Ǯϴ. ٸ ص C:\Program Files ó Ͻø ȵ˴ϴ.
â php -v ǰ, php.ini εϴ Ȯϸ ˴ϴ.
php -v #result# PHP 5.3.27 (cli) (built: Jul 10 2013 20:56:24) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
php -i|findstr php.ini #result# PHP ġ Loaded Configuration File => C:\NmailPHP\PHP\php.ini
#result# AutoSet 6.3.1 ġ Loaded Configuration File => C:\AutoSet6\Server\conf\php.ini |
php ۴´ٸ, ý ( C:\WINDOWS / C:\WINNT ) ȣȯ php.bat ġ մϴ.
C:\NmailPHP\_php.bat_sample ȿ ˸ php_????.bat , PHP php.ini ° ϰ, php.bat մϴ. php.bat ý ( C:\WINDOWS / C:\WINNT ) ϰ, ٽ php -v" ؼ Ȯϸ ˴ϴ.
ex) php.bat - PHP ġ
@ECHO OFF C:\NmailPHP\PHP\php.exe -q -c C:\NmailPHP\PHP\php.ini %* |
ex) php.bat - PHP ġ 2
@ECHO OFF C:\PHP\php.exe -q -c C:\PHP\php.ini %* |
ex) php.bat -
@ECHO OFF C:\AutoSet6\Server\php5\php.exe -q -c C:\AutoSet6\Server\conf\php.ini %* |
ex) php.bat - APM_SETUP 7 version
@ECHO OFF C:\APM_Setup\Server\PHP5\php.exe -q -c C:\APM_Setup\php.ini %* |
ex) php.bat - RWAPM
@ECHO OFF C:\RWAPM\RTM20040531\bin\php-cgi.exe -q %* |
â Ʒó mbstring ġǾ ִ Ȯմϴ.
php -m|findstr mbstring #result# mbstring |
mbstring ġǾ ó php.ini θ Ȯϰ,
php -i|findstr php.ini #result# Configuration File (php.ini) Path </td><td class="v">C:\RWAPM\RTM20040531\bin\php.ini |
php.ini mbstring εϴ κ ּ մϴ.
;extension=php_mbstring.dll => extension=php_mbstring.dll |
) Windows 2008 ̻ bat Ͽ 콺 ߸ Ŭؼ ؾ մϴ.
1. [ Ž] ؼ ġ ̵ϼż nmail_dir_set.bat մϴ. Ʈ Ȯ ø ˴ϴ.
2. ġ ȿ nmail_install.bat ؼ ȳ ʿ ԷϽø ġ Ϸ˴ϴ. ġ Ϸ ȭ鿡 ġ ȣƮ ˴ϴ. ߰ 쿡 пο ġ ġ ũƮ ٽ Ͻø ˴ϴ. ġ ũƮ ߺ ص ʵ Ǿ ֽϴ.
1. Windows Server ǰ ġ '' Ӽ 'everyone' οֽñ ٶϴ.
2. α ġǾ ǽð ߴŰų, 丮 صμž մϴ. ͳ (POP3)ɵ ߴؾ մϴ. ϼ Ư ڵ鸵 α 浹 ϴ ֿ ˴ϴ.
Windows 2003)
1. [ – – ۾] ۾ ߰Ŭ.
2. []ư Ŭϰ, [ãƺ] Ʒ ȭ ũƮ .
l C:\NmailPHP\tools\mail_box_dbsync_all_auto.bat
3. ۾ üũϰ []ư Ŭ.
4. ð(02~04) ϰ []ư Ŭ.
5. ڰ йȣ Է []ư Ŭ.
6. [ħ]ư Ŭϸ Ϸ˴ϴ.
Windows 2008)
[ - ۾ ٷ]
1. ۾
Ϲ )
̸ - NmailDbSync
ɼ - α ο
.
Ʈ )
- 4:30
)
- α
α/ũƮ –
C:\NmailPHP\tools\mail_box_dbsync_all_auto.bat
ġ(ɼ) - C:\NmailPHP\tools\
2. [Ȯ], йȣ Է.
) Ʈ
Apache ȣƮ ù° ȣƮ ϴ. ̷ Ʈ(www.YourDomain.com) ȣƮ ¿ Ͽ ȣƮ ߰ϰ ֽϴ. ʵ ̸ Ʈ ´ ȣƮ Ȯ ߰Ͻô° ϴ.
- ڽ Apache ȯ濡 ´ Ѱ ؼ Ͻø ˴ϴ.
PHP ġ)
ġ ڵ C:\NmailPHP\upload\config\httpd_virtualhost.¥ C:\NmailPHP\Apache\conf\httpd.conf ߰մϴ.
# VirtualHost Enabled NameVirtualHost *:80
# Nmail PHP - http://mail.YourDomain.com/ <VirtualHost *:80> ServerAdmin postmaster@YourDomain.com DocumentRoot "C:\NmailPHP\nmail" ServerName mail.YourDomain.com ServerAlias mail.* #ServerAlias mail.MultiDomain1.com mail.MultiDomain2.com ErrorLog logs\nmail2.error_log CustomLog logs\nmail2.access_log combined <Directory "C:\NmailPHP\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 2.2 ٽ մϴ.
)
[ - - ȣƮ ] ϰ, Apache Ͻø ˴ϴ.
- : mail.YourDomain.com (ּ)
- : mail.* ( ʼ)
- Ȩ 丮 : c:\NmailPHP\nmail
) ġ Ʒ nmail( ҽ) ؾ մϴ. ġ (c:\NmailPHP) ɰ 迡 ˴ϴ.
- E-mail :
- Access Log ϴ. üũ
- Error Log ϴ. üũ
)
============================================================================== = ġ ۾ ϷǾϴ. ============================================================================== Apache httpd.conf ȣƮ(Ȥ ˸ƽ) ߰ϰ Apache ϸ Ͻ ְ ˴ϴ. httpd.conf ߰ؾ ) ) NameVirtualHost, VIrtualHost ٸ Ȯϼ. ) ServerName DNS 'mail'̶ 2 DNS ڿ Ͻñ ٶϴ. httpd.conf Ϲ ) RWAPM ġ) C:\RWAPM\RTM20040531\conf\httpd.conf ġ) C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf
NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin postmaster@YourDomain.com DocumentRoot "C:\NmailPHP\nmail" ServerName mail.YourDomain.com ServerAlias mail.* # mail. ϴ ο Ѵٴ ǹ. #ServerAlias mail.MultiDomain1.com mail.MultiDomain2.com ErrorLog logs/nmail2.error_log CustomLog logs\nmail2.access_log combined <Directory "C:\NmailPHP\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 ִٸ ؾ մϴ. Ͽ ѱ ɼ ֽϴ.
AddDefaultCharset UTF-8 |
Ϲ ó http://mail.YourDomain.com ּҸ 쿡 ˸ƽ ʿ䰡 ϴ. ȣƮ ʰ http://YourDomain.com/mail/ · Ϸ ˸ƽ ̿Ͻø ˴ϴ.
Apache httpd.conf Alias ɼ Ʒ Alias ߰ ϸ ˴ϴ.
# Alias Alias /icons/ "C:/RWAPM/RTM20040531/icons/"
# Alias ( ߰ؾ κ) Alias /mail "C:\NmailPHP\nmail" <Directory "C:\NmailPHP\nmail"> Options None AllowOverride All Order allow,deny Allow from all </Directory> |
ġ ּ( http://mail.YourDomain.com ) Ͻø ˴ϴ. [] ̵ postmaster ̸, йȣ ġ Է йȣԴϴ.
Ƽ postmaster α [ϼ - ΰ] ߰ ϰ [ϼ - ȸ] ߰ ֽϴ. Ƽ ڰ ּ(http://) Ͽ ο ڵ νĵ˴ϴ.
Ƽ ߰ ۾ )
b. [ϼ] ȸ ߰.
c. ġ Ȯ.
- ռ ص ȣƮ, ˸ƽ ο ǹǷ ۾ Ͻ ʿ䰡 ϴ.
d. DNS MX ڵ IP ϼ .
ϼ ʿ سҽϴ. ġϽ [ϼ >> ϼ 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