vi /var/qmail/supervise/qmail-send/run
#!/bin/sh
exec env - PATH="/var/qmail/bin:$PATH" qmail-start ./Maildir/
vi /var/qmail/supervise/qmail-send/log/run
#!/bin/sh
# Keep 30 logs of max 10Mb each
#
# They will get rotated when they reach 10Mb in size,
# or at midnight when our crontab script fires (whichever event comes 1st)
exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t s10000000 n30 /var/log/qmail/send
vi /var/qmail/supervise/qmail-smtpd/run
#!/bin/sh
QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`
exec /usr/local/bin/softlimit -m 2000000
/usr/local/bin/tcpserver
-v -x /home/vpopmail/etc/tcp.smtp.cdb
-c 20 -R -u "$QMAILDUID" -g "$NOFILESGID" 0 smtp
/usr/local/bin/rblsmtpd -b -C
-r 'relays.ordb.org:Your message was rejected because the mail server you use is configured to allow OPEN RELAY - More detailed information regarding this problem is available from http://www.ordb.org/lookup/?%IP% - Please forward this error through to your email server support staff for easy resolution.'
-r 'inputs.relays.osirusoft.com:Your message was rejected because the mail server you use is either configured to allow OPEN RELAY - More information regarding this problems is available at http://relays.osirusoft.com/cgi-bin/rbcheck.cgi?addr=%IP% - Please forward this error to your email server support staff for resolution.'
-r 'proxies.relays.monkeys.com:Your message was rejected because the message was sent from an OPEN PROXY - More information regarding this problems is available at http://www.monkeys.com/upl/listed-ip-0.cgi?ip=%IP% - Please forward this error to your email server support staff for resolution.'
/var/qmail/bin/qmail-smtpd 2>&1
vi /var/qmail/supervise/qmail-smtpd/log/run
#!/bin/sh
# Keep 30 logs of max 10Mb each
#
# They will get rotated when they reach 10Mb in size,
# or at midnight when our crontab script fires (whichever event comes 1st)
exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t s10000000 n30 /var/log/qmail/smtpd
vi /var/qmail/supervise/qmail-pop3d/log/run
#!/bin/sh
# Keep 30 logs of max 10Mb each
# They will get rotated when they reach 10Mb in size,
# or at midnight when our crontab script fires (whichever event comes 1st)
exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t s10000000 n30 /var/log/qmail/pop3d
修改 crontab ,使之每天转储 qmail 的日志文件。
crontab -e
0 0 * * * /usr/local/bin/svc -a /service/qmail-smtpd/log
0 0 * * * /usr/local/bin/svc -a /service/qmail-send/log
0 0 * * * /usr/local/bin/svc -a /service/qmail-pop3d/log
vi /home/vpopmail/etc/tcp.smtp
#------------------------------------------------------
# DESCRIPTION OF THE RULES TO REMIND ME OF HOW THIS FILE WORKS
#
# If you set 'allow', this means that our mail server will allow
# the specified ip range to make a TCP connection to our server
#
# If you set 'deny', this means that our mail server will not allow
# the specified ip range to make a TCP connection to our server
#
# If you set RELAYCLIENT="", this means that the listed IP range is
# allowed to relay mail through our server
#
# If you dont set RELAYCLIENT="", this means that the listed IP range
# will not be able to relay mail through our server
#
# If you set RBLSMTPD="", this means that the listed IP ranges will
# not be checked against any of the RBL databases
#
# If you set RBLSMTPD="some text here", this means that an RBL lookup
# wont be performed, but the mail will be rejected with the specified
# text as a 4xx temp error message
#
# If you set RBLSMTPD="-some text here", this means that an RBL lookup
# wont be performed, but the mail will be rejected with the specified
# text as a 5xx perm error message
#
# If you do not set RBLSMTPD="" or ="some text", then an RBL lookup
# will be performed. If the lookup is successful, then RBLSMTPD will
# return your custom error message (as specified in the -r parameter
# in smtpd supervise script)
#-----------------------------------------------------
# HERE ARE THE RULES :
#----------------------------------------------------------------
# local class-c's allowed to relay WITHOUT RBL checking
123.123.123.:allow,RELAYCLIENT="",RBLSMTPD=""
123.111.111.:allow,RELAYCLIENT="",RBLSMTPD=""
#----------------------------------------------------------------
# these ips are ones that we have setup so that they arent RBL checked
# usually because we have spoken with the owners of the mail server
# in question and for one reason or another they cannot update their
# config, and we still want to be able to receive mail from them.
#
# reminder text goes here for this entry so we know the story...
111.111.111.:allow,RBLSMTPD=""
# reminder text goes here for this entry so we know the story...
222.222.222.222:allow,RBLSMTPD=""
#-----------------------------------------------------------------
# mailXX.offermail.net connecting regularly and sending invalid
# format messages causing exit with status 256 (bare linefeed normally)
# entry added 15/12/2001
# after looking at the mail coming from these servers it was found to be spam
216.242.75.100-116:allow,RBLSMTPD="-Connections from this IP have been banned."
#
#-----------------------------------------------------------------
# heaps of spam from replyto of *@freeamateurhotties.com dec2001
64.228.127.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"
154.20.94.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"
154.20.96.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"
154.20.97.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"
154.20.98.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"
209.151.132.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"
209.151.131.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"
216.18.85.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"
#-----------------------------------------------------------------
# himailer spam 15/7/02
61.230.72-75.:allow,RBLSMTPD="-Connections refused due to spam from HiMailer.com"
#
#-----------------------------------------------------------------
# Allow connections from localhost,
# allow relay (cause the WebMail server runs on localhost),
# and dont do RBL lookup
127.0.0.1:allow,RELAYCLIENT="",RBLSMTPD=""
#-----------------------------------------------------------------
# Everyone else can make connections to our server, but not allowed to relay
# RBL lookups are performed
:allow
接下来配置 /home/vpopmail/etc/tcp.pop3 文件,这个文件控制允许存取 pop3
服务的机器,在有人攻击 pop3 服务器的时候,可以用这个文件阻止攻击者的 IP 地址。
vi /home/vpopmail/etc/tcp.pop3
# Allow any client to connect to us via POP3
# If people are abusing POP3 such as denial-of-service on POP3,
# you can add their ips here to block them out
:allow
vi /usr/lib/courier-imap/libexec/imapd.rc
修改:
/usr/lib/courier-imap/libexec/couriertcpd -address=$ADDRESS
为:
/usr/lib/courier-imap/libexec/couriertcpd -address=$ADDRESS
-user=vpopmail -group=vchkpw
六、测试
测试 POP3 服务:
telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
+OK Hello there.
user user@abc.com
+OK Password required.
pass [password]
+OK logged in.
quit
+OK Bye-bye.
Connection closed by foreign host.
测试 IMAP 服务:
telnet localhost 143
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
* OK Courier-IMAP ready. Copyright 1998-2001 Double Precision, Inc. See COPYING for distribution information.
a001 login user@abc.com [password]
a001 OK LOGIN Ok.
a001 logout
* BYE Courier-IMAP server shutting down
a001 OK LOGOUT completed
Connection closed by foreign host.
如果不能退出用 Ctrl-] 退出到 telnet> 状态,然后 quit 退出。
七、安装 Squirrelmail
cd /usr/local/apache/htdocs
tar -xzf $QM_GZDIR/squirrelmail-1.4.0.tar.gz
mv squirrelmail-1.4.0 webmail
cd webmail
mkdir attachment
chown -R www.www data
chown -R www.www attachment
chmod 733 attachment
./configure
< Solaris 9 上面安装 Zope 2.6.1 | MySQL 从 3.23 升级到 4.0 四部曲 >
相关连接
# 有关Tutorial 的文章
# 作者徐永久的所有文章
# 联系作者
下面的点评文字版权归点评者所有。
( 点评 )
Solaris 9 上安装 qmail + vpopmail + squirrelmail
by 徐永久 on 07月14日 11:31
由于 MySQL 4.0.13 tarball 版本在 Solaris 9 上一直不能编译成功,而使用 MySQL 官方网上 64Bit 的版本则导致以后的 vpopmail 编译失败。