HOME | LINUX | CISCO NETWORKING |   
PosgreSQL | Nginx | MariaDB | Bash Shell | GlusterFS | XEN | Cluster | VIM | Iptables | Nagios | Qmail  


Qmail 설치하기



 # 설치방식은 qmailrocks의 방식을 따른다. 
 # 리눅스 32비트에 설치해야한다. 64비트에서 정상적으로 설치가 안된다. 
 
 # 현재 시스템의 sendmail 또는 postfix, exim을 지워준다. 
 wget -P /usr/local/src http://www.qmailrocks.org/downloads/qmailrocks.tar.gz
 
 mkdir /downloads 
 cd /downloads 
 tar xzvfp /usr/local/src/qmailrocks.tar.gz 
 
 # 
 cd /downloads/qmailrocks 
 mkdir -p /var/qmail /usr/src/qmail 
 
 # 
 groupadd nofiles 
 useradd -g nofiles -d /var/qmail/alias -s /sbin/nologin -p'*' alias
 useradd -g nofiles -d /var/qmail -s /sbin/nologin -p'*' qmaild 
 useradd -g nofiles -d /var/qmail -s /sbin/nologin -p'*' qmaill
 useradd -g nofiles -d /var/qmail -s /sbin/nologin -p'*' qmailp
 
 groupadd qmail 
  
 useradd -g qmail -d /var/qmail -s /sbin/nologin -p'*' qmailq
 useradd -g qmail -d /var/qmail -s /sbin/nologin -p'*' qmailr 
 useradd -g qmail -d /var/qmail -s /sbin/nologin -p'*' qmails  
 
 groupadd vchkpw 
 
 cd /usr/src/qmail 
 tar xzvfp /downloads/qmailrocks/qmail-1.03.tar.gz 
 tar xzvfp /downloads/qmailrocks/ucspi-tcp-0.88.tar.gz 
 
 mkdir -p /package 
 chmod 1755 /package 
 cd /package 
 tar xzvfp /downloads/qmailrocks/daemontools-0.76.tar.gz 
 mkdir /var/log/qmail 
 cd /var/log/qmail 
 
 mkdir qmail-send qmail-smtpd qmail-pop3d 
 
 chown -R qmaill:root /var/log/qmail 
 chmod -R 750 /var/log/qmail 
 
 mkdir /var/qmail/supervise 
 cd /var/qmail/supervise 
 
 mkdir -p qmail-smtpd/log qmail-send/log qmail-pop3d/log
 
 chmod -t qmail-smtpd qmail-send qmail-pop3d 
 
 echo 211 /usr/src/qmail/qmail-1.03/conf-split 
 echo 255 /usr/src/qmail/qmail-1.03/conf-spawn 

 
 # 모든 패치를 적용한다. 
 # 패치 내용 :  maxrcpt, mfcheck, quota, date-localtime, qmailqueue, jms1-antispam, errno , smtp-auth, STARTTLS/AUTH, forcetls, SPF, qmail-0.0.0.0, qmail_local, sendmail-flagf, bind-interface, 8k-buffer path 
 
 patch < /downloads/qmailrocks/patches/qmail-1.03-jms1.5.patch
 patch < /downloads/qmailrocks/patches/qmail-1.03-forcetls-20040703.patch

 cd /usr/src/qmail/qmail-1.03
 make man && make setup check 
 ./config-fast mail.mydomain.com 
 make cert 
 
 Country Name (2 letter code) [GB]: KR
 State or Province Name (full name) [Berkshire]: Seoul
 Locality Name (eg, city) [Newbury]: Seoul
 Organization Name (eg, company) [My Company Ltd]: Internet Team 
 Organizational Unit Name (eg, section) []: mail
 Common Name (eg, your name or your server's hostname) []: mail.mydomain.com
 Email Address []: webmaster@mydomain.com 
 
 chown -R vpopmail:qmail /var/qmail/control/clientcert.pem /var/qmail/control/servercert.pem
 
 cd /usr/src/qmail/ucspi-tcp-0.88 
 
 patch < /downloads/qmailrocks/patches/ucspi-tcp-0.88.errno.patch

 make && make setup check 

 cd /package/admin/daemontools-0.76 
 package/install 
 
 # 
 # 
 cd /downloads/qmailrocks/
 tar xzvfp ezmllm-0.53-idx-0.41.tar.gz 
 cd ezmlm-0.53-idx-0.41
 make && make setup 
 
 
 # 
 # 
 cd /downloads/qmailrocks 
 tar xzvfp autorespond-2.0.5.tar.gz 
 
 cd autorespond-2.0.5
 make && make install 
 
 
 # 
 # Vpopmail 설치 MySQL과 연동 
 mkdir ~vpopmail/etc 
 chown vpopmail:vchkpw ~vpopmail/etc 
 
 echo "localhost|0|vpopmailuser|password|vpopmail" > ~vpopmail/etc/vpopmail.mysql 
 
 chown vpopmail:vchkpw ~vpopmail/etc/vpopmail.mysql
 chmod 640 ~vpopmail/etc/vpopmail.mysql
 
 mysql -u root -p 
 
 MYSQL> create database vpopmail;
 MYSQL> grant all provileges on vpopmail.* to vpopmail@localhost identified by 'vpopmailpass';
 MYSQL> flush privileges;
 
 cd /downloads/qmailrocks

 tar zxvf vpopmail-5.4.13.tar.gz
 cd vpopmail-5.4.13

 patch < /downloads/qmailrocks/patches/vmysql.patch

 ./configure --enable-logging=p --enable-auth-module=mysql --disable-passwd --enable-clear-passwd --disable-many-domains --enable-auth-logging --enable-sql-logging --enable-valias --disable-mysql-limits

 make && make install-strip

 
 # Vqadmin 설치하기 
 cd /downloads/qmailrocks
 tar xzvfp vqadmin-2.3.6.tar.gz 
 cd vqadmin-2.3.6
 ./configure --enable-cgibindir=/usr/local/vqadmin/cgi-bin --enable-htmldir=/usr/local/vqadmin/html 
 
 make && make install-strip 
 
 <Directory "/usr/local/vqadmin/cgi-bin">
 	Deny from all
 	Options ExecCGI
 	AllowOverride AuthConfig 
 	Order deny,allow
 <Directory>
 
 # 인증 설정파일 만들기 	
 vi /usr/local/vqadmin/.htaccess 
 AuthType		Basic
 AuthUserFile	/usr/local/vqadmin/.htpasswd
 AuthName		vQadmin
 require		valid-user
 satisfy		any
  
 # 웹페이지 인증사용자 만들기 
 htpasswd -c /usr/local/vqadmin/.htpasswd admin
 chmod 644 /usr/local/vqadmin/.htpasswd 
 
 service httpd restart 
 
 # Maildrop 설치하기 
 cd /downloads/qmailrocks 
 tar xzvfp mailrop-1.6.3.tar.gz 
 cd maildrop-1.6.3
 ./configure --prefix=/usr/local --exec-prefix=/usr/local --enable-maildrop-uid=root --enable-maildrop-gid=vchkpw --enable-maildirquota
 
 make && make install-strip && make install-man 
 
 # 마지막 config 
 cp /downloads/qmailrocks/scripts/finalize/linux/pop3d_run 	/var/qmail/supervise/qmail-pop3d/run 
 cp /downloads/qmailrocks/scripts/finalize/linux/pop3d_log 	/var/qmail/supervise/qmail-pop3d/log/run 
 cp /downloads/qmailrocks/scripts/finalize/linux/smtpd_run 	/var/qmail/supervise/qmail-smtpd/run 
 cp /downloads/qmailrocks/scripts/finalize/linux/smtpd_log 	/var/qmail/supervise/qmail-smtpd/log/run 
 cp /downloads/qmailrocks/scripts/finalize/linux/send_run 	/var/qmail/supervise/qmail-send/run 
 cp /downloads/qmailrocks/scripts/finalize/linux/send_log 	/var/qmail/supervise/qmail-send/log/run 
 
 cp /downloads/qmailrocks/scripts/finalize/rc /var/qmail/ 
 cp /downloads/qmailrocks/scripts/finalize/qmailctl /var/qmail/bin
 
 chmod 755 /var/qmail/rc /var/qmail/bin/qmailctl 
 
 chmod 751 /var/qmail/supervise/qmail-pop3/run 
 chmod 751 /var/qmail/supervise/qmail-pop3/log/run 

 chmod 751 /var/qmail/supervise/qmail-smtpd/run 
 chmod 751 /var/qmail/supervise/qmail-smtpd/log/run 

 chmod 751 /var/qmail/supervise/qmail-send/run 
 chmod 751 /var/qmail/supervise/qmail-send/log/run 

 echo ./Maildir > /var/qmail/control/defaultdelivery
 
 echo 255 > /var/qmail/control/concurrencyremote 
 chmod 644 /var/qmail/control/concurrencyremote 
 echo 30 > /var/qmail/control/concurrencyincoming 
 chmod 644 /var/qmail/control/concurrencyincoming 
 
 ln -s /var/qmail/bin/qmailctl /usr/bin 
 ln -s /var/qmail/supervise/qmail-send /var/qmal/supervise/qmail-smtpd /var/qmail/supervise/qmail-pop3d /service

 
 # 아래 파일을 열어서 당신의 메일 MX를 적어넣는다. 
 vi /var/qmail/supervise/qmail-pop3d/run 
 vi /var/qmail/supervise/qmail-smtpd/run 

 qmailctl stop 
 echo '127.:allow,RELAYCLIENT=""' >> /etc/tcp.smtp 
 qmailctl cdb 
 
 echo "postmaster@mydomain.com" > /var/qmail/alias/.qmail-root 
 echo "postmaster@mydomain.com" > /var/qmail/alias/.qmail-postmaster
 echo "postmaster@mydomain.com" > /var/qmail/alias/.qmail-mailer-daemon
 
 ln -s /var/qmail/alias/.qmail-root /var/qmail/alias/.qmail-anonymous 
 
 chmod 644 /var/qmail/alias/.qmail* 
 
 /etc/init.d/qmailctl start 
 
 telnet localhost 25 
 
 # 테스트 해보라 
 


Home | Linux | Network | About Me |