Setting Mail Server with Qmail on Fedora 3 part6
26. Installing Qqtrap
# cd /home/vpopmail
# mkdir -p qtrap/logs
# cd qtrap
# cp /downloads/qmailrocks/scripts/qtrap/qtrap-2.0.0 ./qtrap.sh
# vi qtrap.sh
whitelist_check () {
case $WHITELIST in
address@somewhere.com|address@somewhereelse.com|*entiredomain.com)
echo $SENDER found in whitelist on `date "+%D %H:%M:%S"` >> /home/vpopmail/qtrap/logs/qtrap.log
exit 0;;
*)
;;
esac
}
checkall () {
case $BANNED_WORDS in
porn|PORN|Sex|SEX)
printout $BANNED_WORDS
echo MESSAGE DROPPED from $SENDER because of $BANNED_WORDS on `date "+%D %H:%M:%S"` >> /home/vpopmail/qtrap/logs/qtrap.log
exit 99;;
*)
;;
esac
}
# touch /home/vpopmail/qtrap/logs/qtrap.log
# chown -R vpopmail:vchkpw /home/vpopmail/qtrap
# chmod -R 755 /home/vpopmail/qtrap
# cd /home/vpopmail/domains/yourdomain.com
# vi .qmail-default
| /home/vpopmail/qtrap/qtrap.sh
| /home/vpopmail/bin/vdelivermail '' delete
27. Maintaining your qmail server
Starting Courier-imap on boot - make sure the following 2 lines exist in your server's /etc/rc.local file:
/etc/rc.d/init.d/imap start
/etc/rc.d/init.d/imaps start
Starting SpamAssassin on boot
Try running the "setup" command and check the system services area to see if SpamAssassin is listed and marked with a "*" to start on boot. If SpamAssassin is not present in the system's "setup" tool, you can start it on boot by added the following line to the server's /etc/rc.local file
/etc/rc.d/init.d/spamd start
Starting Apache on boot
Try running the "setup" command and check the system services area to see if the "httpd" service is listed and marked with a "*" to start on boot. If it is not present in the system's "setup" tool, you can start it on boot by added the following line to the server's /etc/rc.local file
/etc/rc.d/init.d/httpd start
28. Installing Isoqlog
# tar zxvf isoqlog-2.2.1.tar.gz
# cd isoqlog-2.1.1
# ./configure
# make
# make install
# make clean
# cd isoqlog
# mkdir /var/www/html/isoqlog
# cp -pr ./htmltemp/images ./htmltemp/library /var/www/html/isoqlog
# cd /usr/local/etc
# vi isoqlog.conf
#isoqlog 2.1 Configuration file
logtype = "qmail-multilog" #log type qmai-multilog, qmail-syslog, sendmail, postfix
logstore = "/var/log/qmail/qmail-send" #
domainsfile = "/usr/local/etc/isoqlog.domains" #
outputdir = "/var/www/html/isoqlog" #html outpur directory
htmldir = "/usr/local/share/isoqlog/htmltemp"
langfile = "/usr/local/share/isoqlog/lang/english"
hostname = "smiert"
maxsender = 100
maxreceiver = 100
maxtotal = 100
maxbyte = 100
# ln -s /var/qmail/control/rcpthosts isoqlog.domains
# /usr/local/bin/isoqlog
Try to open in web browser http://www.smiert.org/isoqlog
# crontab -e
58 * * * * /usr/local/bin/isoqlog 1>/dev/null 2>/dev/null
29. Installing Qmail MRTG
# tar zxvf qmailmrtg7-4.0.tar.gz
# cd qmailmrtg7-4.0
# make
# make install
# mkdir /var/www/html/qmailstats
# cp qmail.mrtg.cfg /var/www/html/qmailstats/
# cp index.html /var/www/html/qmailstats/
# cd /var/www/html/qmailstats/
# vi qmail.mrtg.cfg
WorkDir: /var/www/html/qmailstats
#############################################################
Title[msg]: smiert.org - Messages
MaxBytes[msg]: 10000
AbsMax[msg]: 20000
Options[msg]: gauge
Target[msg]: `/usr/local/bin/qmailmrtg7 m /var/log/qmail/qmail-send`
PageTop[msg]: smiert.org Messages
ShortLegend[msg]: msg
YLegend[msg]: msg
Legend1[msg]: Total Msg
LegendI[msg]: Deliveries:
LegendO[msg]: Attempts:
WithPeak[msg]: ymwd
#-------------------------------------------------------------------
Title[queue-size]: smiert.org - Queue Size
MaxBytes[queue-size]: 10000
AbsMax[queue-size]: 100000
Options[queue-size]: gauge
Target[queue-size]: `/usr/local/bin/qmailmrtg7 q /var/qmail/queue`
PageTop[queue-size]: smiert.org Queue Size
ShortLegend[queue-size]: Msg
YLegend[queue-size]: Msg
Legend1[queue-size]: Msg
LegendI[queue-size]: Msg:
LegendO[queue-size]: Unprocessed Msg:
WithPeak[queue-size]: ymwd
#-------------------------------------------------------------------
Title[concurrency]: smiert.org - Local/Remote Concurrency
MaxBytes[concurrency]: 500
AbsMax[concurrency]: 10000
Options[concurrency]: gauge
Target[concurrency]: `/usr/local/bin/qmailmrtg7 c /var/log/qmail/qmail-send`
PageTop[concurrency]: smiert.org - Local/Remote Concurrency
ShortLegend[concurrency]: Concurrency
YLegend[concurrency]: Concurrency
Legend1[concurrency]: Concurrency
LegendI[concurrency]: Local:
LegendO[concurrency]: Remote:
WithPeak[concurrency]: ymwd
#-------------------------------------------------------------------
Title[messstatus]: smiert.org - Message Status
MaxBytes[messstatus]: 10000
AbsMax[messstatus]: 100000
Options[messstatus]: gauge
Target[messstatus]: `/usr/local/bin/qmailmrtg7 s /var/log/qmail/qmail-send`
PageTop[messstatus]: smiert.org - Message Status
ShortLegend[messstatus]: Msg
YLegend[messstatus]: Msg
Legend1[messstatus]: Msg
LegendI[messstatus]: Success:
LegendO[messstatus]: Failures:
WithPeak[messstatus]: ymwd
#-------------------------------------------------------------------
Title[bytes]: smiert.org - Bytes Transfered
MaxBytes[bytes]: 200000
AbsMax[bytes]: 30000000
Options[bytes]: gauge
Target[bytes]: `/usr/local/bin/qmailmrtg7 b /var/log/qmail/qmail-send`
PageTop[bytes]: smiert.org - Bytes Transfered
ShortLegend[bytes]: kB
YLegend[bytes]: kB
Legend1[bytes]: kB
LegendI[bytes]: kB:
LegendO[bytes]: kB:
WithPeak[bytes]: ymwd
#-------------------------------------------------------------------
Title[smtp]: smiert.org - SMTP Concurrency
MaxBytes[smtp]: 100
AbsMax[smtp]: 500
Options[smtp]: gauge
Target[smtp]: `/usr/local/bin/qmailmrtg7 t /var/log/qmail/qmail-smtpd`
PageTop[smtp]: smiert.org - SMTP Concurrency
ShortLegend[smtp]: SMTP
YLegend[smtp]: SMTP
Legend1[smtp]: SMTP
LegendI[smtp]: SMTP:
LegendO[smtp]:
WithPeak[smtp]: ymwd
#-------------------------------------------------------------------
Title[smtpad]: smiert.org - SMTP Totals
MaxBytes[smtpad]: 1000
AbsMax[smtpad]: 10000
Options[smtpad]: gauge
Target[smtpad]: `/usr/local/bin/qmailmrtg7 a /var/log/qmail/qmail-smtpd`
PageTop[smtpad]: smiert.org - SMTP Totals
ShortLegend[smtpad]: SMTP
YLegend[smtpad]: SMTP
Legend1[smtpad]: SMTP
LegendI[smtpad]: Allow:
LegendO[smtpad]: Deny:
WithPeak[smtpad]: ymwd
#-------------------------------------------------------------------
Title[pop3]: smiert.org - POP3 Concurrency
MaxBytes[pop3]: 100
AbsMax[pop3]: 500
Options[pop3]: gauge
Target[pop3]: `/usr/local/bin/qmailmrtg7 t /var/log/qmail/qmail-pop3d`
PageTop[pop3]: smiert.org POP3 Concurrency
ShortLegend[pop3]: POP3
YLegend[pop3]: POP3
Legend1[pop3]: POP3
LegendI[pop3]: POP3:
LegendO[pop3]:
WithPeak[pop3]: ymwd
#-------------------------------------------------------------------
Title[pop3ad]: smiert.org - POP3 Totals
MaxBytes[pop3ad]: 1000
AbsMax[pop3ad]: 10000
Options[pop3ad]: gauge
Target[pop3ad]: `/usr/local/bin/qmailmrtg7 a /var/log/qmail/qmail-pop3d`
PageTop[pop3ad]: smiert.org - POP3 Totals
ShortLegend[pop3ad]: POP3
YLegend[pop3ad]: POP3
Legend1[pop3ad]: POP3
LegendI[pop3ad]: Allow:
LegendO[pop3ad]: Deny:
WithPeak[pop3ad]: ymwd
# /usr/bin/mrtg /var/www/html/qmailstats/qmail.mrtg.cfg
biasanya 3 kali
# crontab -e
*/5 * * * * /usr/bin/mrtg /path/to/qmailstats/qmail.mrtg.cfg