Tip & Tech

qmail(큐메일) 서버 구축 05

event2017-09-14 244 views

06-3. 큐메일 데몬을 위한 디렉토리 및 스크립트 생성
[root@localhost]# mkdir -p /var/qmail/supervise
[root@localhost]# for i in send smtp pop3 submission; do mkdir -p /var/qmail/supervise/$i/log; done


[root@localhost]# vi /var/qmail/rc
#!/bin/sh

exec env - PATH="/var/qmail/bin:$PATH" \
        qmail-start "`cat /var/qmail/control/defaultdelivery`"


[root@localhost]# vi /var/qmail/supervise/send/run
#!/bin/sh

exec /var/qmail/rc


[root@localhost]# vi /var/qmail/supervise/send/log/run
#!/bin/sh

exec /usr/local/bin/setuidgid qmaill \
        /usr/local/bin/multilog t /var/log/qmail/send 2>&1


[root@localhost]# vi /var/qmail/supervise/smtp/run
#!/bin/sh

VPOP_UID=`id -u vpopmail`
VPOP_GID=`id -g vpopmail`

MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`

exec /usr/local/bin/softlimit -m 200000000 \
        /usr/local/bin/tcpserver -vRHl0 \
        -x /etc/tcprules.d/tcp.smtp.cdb \
        -c ${MAXSMTPD} \
        -u ${VPOP_UID} -g ${VPOP_GID} 0 25 \
        /var/qmail/bin/qmail-smtpd \
        /home/vpopmail/bin/vchkpw /bin/true 2>&1

[root@localhost]# vi /var/qmail/supervise/smtp/log/run
#!/bin/sh

exec /usr/local/bin/setuidgid qmaill \
        /usr/local/bin/multilog t /var/log/qmail/smtp 2>&1


[root@localhost]# vi /var/qmail/supervise/pop3/run
#!/bin/sh

VPOP_UID=`id -u vpopmail`
VPOP_GID=`id -g vpopmail`

HOSTNAME=`hostname -f`

exec /usr/local/bin/softlimit -m 200000000 \
        /usr/local/bin/tcpserver -vRHl0 \
        -u ${VPOP_UID} -g ${VPOP_GID} 0 110 \
        /var/qmail/bin/qmail-popup ${HOSTNAME} \
        /home/vpopmail/bin/vchkpw \
        /var/qmail/bin/qmail-pop3d Maildir 2>&1


[root@localhost]# vi /var/qmail/supervise/pop3/log/run
#!/bin/sh

exec /usr/local/bin/setuidgid qmaill \
        /usr/local/bin/multilog t /var/log/qmail/pop3 2>&1


[root@localhost]# vi /var/qmail/supervise/submission/run
#!/bin/sh

VPOP_UID=`id -u vpopmail`
VPOP_GID=`id -g vpopmail`

MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`

exec /usr/local/bin/softlimit -m 200000000 \
        /usr/local/bin/tcpserver -vRHl0 \
        -x /etc/tcprules.d/tcp.smtp.cdb \
        -c ${MAXSMTPD} \
        -u ${VPOP_UID} -g ${VPOP_GID} 0 587 \
        /var/qmail/bin/qmail-smtpd \
        /home/vpopmail/bin/vchkpw /bin/true 2>&1

[root@localhost]# vi /var/qmail/supervise/submission/log/run
#!/bin/sh

exec /usr/local/bin/setuidgid qmaill \
        /usr/local/bin/multilog t /var/log/qmail/submission 2>&1


[root@localhost]# chmod 755 /var/qmail/rc
[root@localhost]# chown root:qmail /var/qmail/rc

[root@localhost]# chmod 700 /var/qmail/supervise
[root@localhost]# chown -R qmaill:qmail /var/qmail/supervise
[root@localhost]# for i in send smtp pop3 submission; do chmod 1700 /var/qmail/supervise/$i; done
[root@localhost]# for i in send smtp pop3 submission; do chmod 700 /var/qmail/supervise/$i/log; done
[root@localhost]# for i in send smtp pop3 submission; do chmod 751 /var/qmail/supervise/$i/run; done
[root@localhost]# for i in send smtp pop3 submission; do chmod 751 /var/qmail/supervise/$i/log/run; done


06-4. tcp.smtp 설정

[root@localhost]# mkdir -p /etc/tcprules.d
[root@localhost]# vi /etc/tcprules.d/tcp.smtp
127.0.0.1:allow,RELAYCLIENT="",CHKUSER_RCPTLIMIT="50",CHKUSER_WRONGRCPTLIMIT="10"
:allow,CHKUSER_RCPTLIMIT="50",CHKUSER_WRONGRCPTLIMIT="10"
[root@localhost]# tcprules /etc/tcprules.d/tcp.smtp.cdb /etc/tcprules.d/tcp.smtp.tmp < /etc/tcprules.d/tcp.smtp

06-5. qmail log 디렉토리 생성
[root@localhost]# for i in send smtp pop3 submission; do mkdir -p /var/log/qmail/$i; done
[root@localhost]# chmod -R 750 /var/log/qmail
[root@localhost]# chown -R qmaill:qmail /var/log/qmail
 

클립보드에 복사되었습니다.