vpopmail

mkdir /usr/home
ln -s /usr/home/ /home
ln -s /usr/local/vpopmail/ /home/vpopmail

# smtp-auth の為に権限変更
chown root /home/vpopmail/bin/vchkpw
chmod 4755 /home/vpopmail/bin/vchkpw
#### MySQL用の設定
#For VPOPMAIL

cd /home/vpopmail/etc/
echo "localhost|0|USER|PASS|vpopmail" > vpopmail.mysql
chown vpopmail:vchkpw vpopmail.mysql

mysql -u root -pPASS

CREATE DATABASE vpopmail;
GRANT select,insert,update,delete,create,drop ON vpopmail.*
TO USER@localhost IDENTIFIED BY 'PASS';

#For MGWからの参照用

GRANT USAGE ON *.* TO 'kenji'@'192.168.0.%' \
IDENTIFIED BY PASSWORD '*2125BD01A0D3975526DD857804F6DF74660F96DB';
GRANT SELECT ON `vpopmail`.* TO 'kenji'@'192.168.0.%';

#For wwwからの操作
GRANT USAGE ON *.* TO 'mailadmin'@'192.168.0.%' \
IDENTIFIED BY PASSWORD '*60A146645167B9A27ECF19852485742BA7D61B6D';
GRANT ALL PRIVILEGES ON `vpopmail`.* TO 'mailadmin'@'192.168.0.%'\
WITH GRANT OPTION;

quit
echo '*/5 * * * * /usr/local/vpopmail/bin/clearopensmtp' >> /var/cron/tabs/root

mount akari:/back /mnt
patch -p0 < /mnt/src/vlimits.patch
chown vpopmail:vchkpw vlimits.default
  • ==> vlimits.patch <==
    --- vlimits.default.orig        2010-09-17 15:38:51.000000000 +0900
    +++ vlimits.default     2010-09-17 15:39:05.000000000 +0900
    @@ -14,7 +14,7 @@
    
     # default quota for newly created users (in bytes)
     # example shows a user with a 10MB quota and a limit of 1000 messages
    -#default_quota         10485760
    +default_quota          31457280
     #default_maxmsgcount   1000
    
     # uncomment the following lines to disable certain features
    
patch -p0 < /mnt/src/tcp_smtp.patch
chown vpopmail:vchkpw tcp.smtp

cp -p /mnt/src/.quotawarn.msg /home/vpopmail/domains/
### tcp_smtp

# tcp.smtp pop before smtp

この上にvpopmailがRELAYCLIENTを自動追加する
####
SPAM HOST:deny をいっぱい書く
##### for mail-gateway ######
192.168.0.146:allow,ALLOWEDHOST=""
192.168.0.147:allow,ALLOWEDHOST=""
192.168.0.148:allow,ALLOWEDHOST=""
192.168.0.149:allow,ALLOWEDHOST=""
##### for squirrelmail ######
192.168.0.:allow,RELAYCLIENT=""
######## for localuser #######
127.:allow,RELAYCLIENT=""
######## the others ##########
:allow

# tcp.smtp3 はSMTP認証用 vpopmailは触らない
cp tcp.smtp tcp.smtp3
tcprules ./tcp.smtp3.cdb ./tcp.smtp3.tmp < ./tcp.smtp3

# tcp.smtp0 をMGWからの受け取り用に

##### for mail-gateway ######
192.168.0.146:allow,ALLOWEDHOST=""
192.168.0.147:allow,ALLOWEDHOST=""
192.168.0.148:allow,ALLOWEDHOST=""
192.168.0.149:allow,ALLOWEDHOST=""
##### for squirrelmail ######
192.168.0.:allow,RELAYCLIENT=""
######## for localuser #######
127.:allow,RELAYCLIENT=""
######## the others ##########
:allow

tcprules ./tcp.smtp0.cdb ./tcp.smtp0.tmp < ./tcp.smtp0 

chown vpopmail:vchkpw *

qmailmrtg

# echo 'mrtg_daemon_enable="YES"' >> /etc/rc.conf  無し

mkdir /usr/local/www/qmailmrtg
cd /usr/local/www/qmailmrtg
cp /mnt/src/qmail.mrtg.cfg  qmail.mrtg.cfg
cp /mnt/src/index.html  index.html
cp /mnt/src/qmailmrtg.conf /usr/local/etc/apache24/Includes/qmailmrtg.conf

echo '*/5 * * * * /usr/local/bin/mrtg /usr/local/www/qmailmrtg/qmail.mrtg.cfg' >> /var/cron/tabs/root
  • ==> qmailmrtg.conf <==
        Alias /qmailmrtg "/usr/local/www/qmailmrtg/"
    
        <Directory "/usr/local/www/qmailmrtg/">
           DirectoryIndex index.html
           Options None
           AllowOverride Limit
    
           Require local
           Require ip 192.168.
        </Directory>
    
  • ==> index.html <==
  • ==> qmail.mrtg.cfg <==
  • zfs snap -r zroot/ROOT@31

管理用スクリプト

cp -p /mnt/src/queue* /usr/local/scripts
cp -p /mnt/src/fw2.sh /usr/local/scripts
cp -p /mnt/src/find-rm.sh /usr/local/scripts
cp -p /mnt/src/spam2.sh /usr/local/scripts
cp -p /mnt/src/send-q.sh /usr/local/scripts
 
echo '0 * * * * /usr/local/scripts/queue.sh' >> /var/cron/tabs/root
echo '0 2 * * * /usr/local/scripts/find-rm.sh' >> /var/cron/tabs/root
echo 'MAILTO="i@zenno.com"' >> /var/cron/tabs/root
echo '*/4 * * * * /usr/local/scripts/queue2.sh' >> /var/cron/tabs/root

autoconfig

mkdir -pv /usr/local/www/autoconfig/mail/
cp /mnt/src/config-v1.1.xml /usr/local/www/autoconfig/mail/
vi /usr/local/etc/apache24/Includes/autoconfig.conf
Alias /.well-known/autoconfig/ "/usr/local/www/autoconfig/"

<Directory "/usr/local/www/autoconfig/">
   Options None
   AllowOverride Limit

   Require all granted
</Directory>

sysctl チューニング

netstat -Lan
/etc/sysctl.conf
---------
kern.ipc.somaxconn=4096
postfix
default_process_limit = 500
services/pop3sd
-c 600 -b 120 

services/pop3d
-c 120 -b 120 

Mysqlチューニング

/usr/local/etc/my.cnf
---------
[mysqld]
max_connections=1000
thread_cache=100
character-set-server = utf8
skip-character-set-client-handshake
[mysqldump]
default-character-set=utf8
[mysql]
default-character-set=utf8

/usr/local/etc/rc.d/mysql-server restart
  • zfs snap -r zroot/ROOT@32

Labelのカスタマイズ

zfs create -o mountpoint=/data zroot/ROOT/data
zfs create -o mountpoint=/log zroot/ROOT/log
zfs create -o mountpoint=/back zroot/ROOT/back

mysql -u root -pPASS
DROP DATABASE vpopmail;
quit;
/usr/local/etc/rc.d/mysql-server stop
/usr/local/etc/rc.d/svscan stop

cd /data
mkdir vpopmail domains
chown mysql:mysql vpopmail
chown vpopmail:vchkpw domains
chmod 700 *
cp -p /mnt/src/.quotawarn.msg /data/domains/

cd /var/db/mysql
ln -s /data/vpopmail vpopmail

cd /home/vpopmail
rm -r domains
ln -s /data/domains domains

cd /log
mkdir qmail smtpd smtpd2 smtpd3 smtpsd pop3d pop3sd
chown qmaill:qnofiles qmail
chown qmails:qnofiles smtp*
chown qmailp:qnofiles pop3*
chmod 700 *

cd /var/log/
rm -r qmail
ln -s /log qmail
  • zfs snapshot -r zroot/ROOT@40
/usr/local/etc/rc.d/mysql-server start
/usr/local/etc/rc.d/svscan start

FreeBSD/インストール10.1


FreeBSD


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2020-01-29 (水) 17:10:24 (193d)