qmail バーチャルドメイン vpopmail インストール

[root@centos ~]# cd /usr/local/src
[root@centos src]# wget http://sourceforge.net/projects/vpopmail/files/vpopmail-stable/5.4.32/vpopmail-5.4.32.tar.gz
[root@centos src]# tar zxvf vpopmail-5.4.32.tar.gz
[root@centos src]# cd vpopmail-5.4.32
[root@centos 5.4.32]# groupadd -g 89 vchkpw
[root@centos 5.4.32]# useradd -g vchkpw -u 89 -d /home/vpopmail -s /bin/false -m -k /dev/null vpopmail
[root@centos 5.4.32]# ./configure \
--enable-spamassassin \
--enable-spamc-prog=/usr/bin/spamc \
--enable-roaming-users=y \
--enable-clear-passwd=n

[root@centos 5.4.32]# make
[root@centos 5.4.32]# make install-strip
[root@centos 5.4.32]# cd
[root@centos ~]# rm -fr /usr/local/src/vpopmail-5.4.32
[root@centos ~]# rm -f /usr/local/src/vpopmail-5.4.32.tar.gz
tcp.smtp.cdb
[root@centos ~]# vi /home/vpopmail/etc/tcp.smtp
↓下記を記入
127.:allow,RELAYCLIENT=""
:allow,QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl"
[root@centos ~]# tcprules /home/vpopmail/etc/tcp.smtp.cdb /home/vpopmail/etc/tcp.smtp.tmp < /home/vpopmail/etc/tcp.smtp
vlimits.default
[root@centos ~]# vi /home/vpopmail/etc/vlimits.default
#default_quota          10485760
↓
default_quota          10485760 ←コメント解除

#default_maxmsgcount    1000
↓
default_maxmsgcount    1000 ←コメント解除
POP before SMTP
[root@centos ~]# echo "20 * * * * /home/vpopmail/bin/clearopensmtp > /dev/null 2>&1" >> /var/spool/cron/root
mail domain user
[root@centos ~]# /home/vpopmail/bin/vadddomain centos.orz

Please enter password for postmaster:user_pass ←パスワード入力
enter password again:user_pass ←パスワード再入力

[root@centos ~]# vi /home/vpopmail/domains/centos.orz/.qmail-default
| /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox
↓
| /home/vpopmail/bin/vdelivermail '' delete
[root@centos ~]# /home/vpopmail/bin/vadduser user_name@centos.orz Please enter password for user_name@centos.orz:user_pass ←パスワード入力 enter password again:user_pass ←パスワード再入力
valias追加
[root@centos ~]# /home/vpopmail/bin/valias -i 転送先メールアドレス mailer-daemon@centos.orz
[root@centos ~]# /home/vpopmail/bin/valias -i 転送先メールアドレス postmaster@centos.orz
[root@centos ~]# /home/vpopmail/bin/valias -i 転送先メールアドレス root@centos.orz
qmail-pop3d
[root@centos ~]# vi /var/qmail/service/pop3d/run
↓下記を記入
#!/bin/sh

exec env - PATH="/var/qmail/bin:$PATH" \
tcpserver -v -x /etc/tcp.pop3.cdb -R -H 0 pop3 \
qmail-popup mail.centos.orz /home/vpopmail/bin/vchkpw \
qmail-pop3d Maildir 2>&1
[root@centos ~]# vi /var/qmail/service/pop3d_ssl/run
↓下記を記入
#!/bin/sh

exec env - PATH="/var/qmail/bin:$PATH" \
tcpserver -v -s -x /etc/tcp.pop3.cdb \
-n /etc/pki/tls/certs/mail.pem -R -H 0 pop3s \
qmail-popup mail.centos.orz /home/vpopmail/bin/vchkpw \
qmail-pop3d Maildir 2>&1
qmail-smtpd
[root@centos ~]# vi /var/qmail/service/smtpd/run
↓下記を記入
#!/bin/sh

QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl"
export QMAILQUEUE
exec env - PATH="/var/qmail/bin:$PATH" \
tcpserver -v -x /home/vpopmail/etc/tcp.smtp.cdb \
-R -H -l0 -u `id -u vpopmail` -g `id -g vpopmail` 0 smtp \
qmail-smtpd mail.centos.orz /home/vpopmail/bin/vchkpw /bin/true 2>&1
[root@centos ~]# vi /var/qmail/service/smtpd_ssl/run
↓下記を記入
#!/bin/sh

QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl"
export QMAILQUEUE
exec env - PATH="/var/qmail/bin:$PATH" \
tcpserver -v -s -x /home/vpopmail/etc/tcp.smtp.cdb \
-n /etc/pki/tls/certs/mail.pem \
-R -H -l0 -u `id -u vpopmail` -g `id -g vpopmail` 0 smtps \
qmail-smtpd mail.centos.orz /home/vpopmail/bin/vchkpw /bin/true 2>&1
qmail restart
[root@centos ~]# svc -t /service/*
delete file
[root@centos ~]# rm -f /home/*/.qmail
[root@centos ~]# rm -f /etc/procmailrc
[root@centos ~]# rm -f /etc/skel/.qmail
[root@centos ~]# rm -fr /etc/skel/Maildir
Procmail
[root@centos ~]# vi /home/vpopmail/domains/centos.orz/user_name/.qmail
| /usr/bin/procmail -m ./.procmailrc
Procmail(POP)
[root@centos ~]# vi /home/vpopmail/domains/centos.orz/user_name/.procmailrc
↓下記を記入
SHELL=/bin/bash
PATH=/bin:/usr/bin:/usr/local/bin
DROPPRIVS=yes
HOME=/home/vpopmail/domains/centos.orz/user_name
MAILDIR=$HOME/Maildir
DEFAULT=$MAILDIR/
LOGFILE=$MAILDIR/procmail.log
#VERBOSE=ON # Detailed log output

# Mail including "Advertisement without consent *" ..subject.. is annulled.
:0
* ^Subject:.*=\?[Ii][Ss][Oo]-2022-[Jj][Pp]\?[Bb]\?GyRCTCQ\+NUJ6OS05cCIo
/dev/null

# Spamassassin is started when there is no "X-Spam-***" in the header.
:0fw
*!^X-Spam.*
|spamassassin
Procmail logrotation
[root@centos ~]# vi /etc/logrotate.d/procmail
↓下記を記入
/home/vpopmail/domains/*/*/Maildir/procmail.log {
    missingok
    nocreate
    notifempty
}
courier-authlib
[root@centos ~]# vi /usr/local/etc/authlib/authdaemonrc
authmodulelist="authpam"
↓
authmodulelist="authvchkpw" ←変更

authmodulelistorig="authpam"
↓
authmodulelistorig="authvchkpw" ←変更
[root@centos ~]# /etc/rc.d/init.d/courier-authlib restart
Home PageTop