본문 바로가기

Compute™/Linux

[Linux] CentOS + Qmail + vpopmail + mysql + imap + squirrelmail -2- (mysql 연동편)

반응형
SMALL

[선행 작업]
mysql 구동 확인
 [root@mail /]# service mysqld start
 [root@mail /]#
ps -ef |grep mysql
root      3042     1  0 16:01 pts/1    00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --user=root --datadir=/home/mysqldata --pid-file=/home/mysqldata/mail.pid
root      3151  3042  0 16:01 pts/1    00:00:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/home/mysqldata --user=root --log-error=/home/mysqldata/mail.err --pid-file=/home/mysqldata/mail.pid --socket=/tmp/mysql.sock --port=3306

[vpopmail DB 생성]

 [root@mail /]# /usr/local/mysql/bin/mysqladmin -u root -p create vpopmail
 [root@mail /]# /usr/local/mysql/bin/mysql -u root -p

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 38
Server version: 5.1.41-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database                |
+--------------------+
| information_schema |
| mysql                    |
| test                        |
| vpopmail              |   (생성 확인)
+--------------------+
4 rows in set (0.00 sec)

mysql>

* vpopmail db 를 관리할 관리자 계정 생성 및 패스워드 설정

mysql> grant create,insert,select,delete,update on vpopmail.* to admin;
mysql> grant create,insert,select,delete,update on vpopmail.* to admin@localhost;
mysql> set password for 'admin'@'%'=password('dnflskfk');
mysql> set password for 'admin'@'localhost'=password('dnflskfk');
mysql> flush privileges;
mysql> exit

* 깔끔한 적용을 위해 mysql 재시작 해준다
service mysqld restart  or /etc/init.d/myslqd restart

* vi /home/vpopmail/etc/vpopmail.mysql  (중요) vpopmail 과 mysql 연동을 위해 수정
형식 localhost|0|root|secret|vpopmail
localhost|3306|admin|123456|vpopmail

Toad 와 같은 프리웨어나 Orange 등으로 접속테스트를 해본다.



[도메인 생성 및 계정 생성]
[root@mail /]#  vi ~/.bash_profile
:/home/vpopmail/bin  (패스 추가)

[root@mail /]#  vadddomain trend.com  (도메인 지정)
[root@mail /]#  vadduser kkarijoo@trend.com


* 도메인 및 계정 생성 확인

[root@mail /]# cd /home/vpopmail/domains/
[root@mail domains]# ls
trend.com
[root@mail domains]# cd trend.com/
[root@mail trend.com]# ls
kkarijoo  postmaster
[root@mail trend.com]# pwd
/home/vpopmail/domains/trend.com

* 도메인 적용을 위해 qmail 을 재시작 한다.
[root@mail /]# service qmaild restart
Restarting qmail:
* Stopping smtp.
* Stopping pop3.
* Stopping submission.
* Sending send SIGTERM and restarting.
* Restarting smtp.
* Restarting pop3.
* Restarting submission.

[pop 계정 테스트]
 [root@mail /]# telnet localhost 110
Trying 127.0.0.1...
Connected to trend.com (127.0.0.1).
Escape character is '^]'.
+OK <3705.1329466835@mail>
user kkarijoo@trend.com    (user 이름을 @까지 풀네임을 적어준다)
+OK
pass dnflskfk    
+OK
quit
+OK
Connection closed by foreign host.
모두 OK 이면 OK ㅎㅎ

[Thunderbird 에 e-메일 연동 테스트]


반응형
LIST