Part 17 - Installing Qtrap > 리눅스 Tip

본문 바로가기
 

Part 17 - Installing Qtrap

페이지 정보

작성자 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 댓글 0건 조회 17,995회 작성일 09-01-31 09:11

본문

Part 17 - Installing Qtrap
Image
Our final ingredient in this installation is going to be a domain level word filter, which I've named "Qtrap". This script is applied on a per domain basis and serves as a "bad word" scanner to catch any spam that Spamassassin may have missed. This filter serves as the last defense against SPAM before it arrived in your inbox. I like this filter because it helps to get rid of any SPAM that happens to make it by Spamassassin. Without any protection at all, my mailbox gets a shit ton of SPAM every day. Within the first 3 months I enacted the Qtrap filter, Qtrap logged over 9,000 deleted SPAM messages, none of which were legitimate e-mails. My keyboard's delete key was very appreciated the extra rest.
Any emails that are scanned and contain a banned word will be automatically deleted and logged by the qtrap script. A whitelist feature now exists so that individual addresses or domains can be exempt from the qtrap scan.
So let's install it...
cd /home/vpopmail
mkdir -p qtrap/logs
cd qtrap
cp /downloads/qmailrocks/scripts/qtrap/qtrap-2.0.0 ./qtrap.sh
Defnining your whitelist:
vi qtrap.sh
You will see a block of code for the whitelist that looks like this:
whitelist_check () {
case $WHITELIST in
address@somewhere.com This e-mail address is being protected from spam bots, you need JavaScript enabled to view it | address@somewhereelse.com This e-mail address is being protected from spam bots, you need JavaScript enabled to view it |*entiredomain.com)
echo $SENDER found in whitelist on `date "+%D %H:%M:%S"` >> /home/vpopmail/qtrap/logs/qtrap.log
exit 0;;
*)
;;
esac
}
The email addresses in the bold red text above should be substituted with any email addresses that you wish to whitelist against the qtrap filter process. Whitelisted addresses will be allowed to send you mail that contains "banned" words. Un-whitelisted address will be scanned and their message deleted if it contains a banned word. As you can see above, you can specify an individual address ( address@somewhere.com This e-mail address is being protected from spam bots, you need JavaScript enabled to view it ) or you can simply whitelist an entire domain (*entiredomain.com).
Defining your "banned word" list:
within the qtrap.sh script you should see another section, below the whitelist section of code, that looks like this:
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
}
The portion of the above section that I've highlighted in RED is the array of "banned" words. Edit this array to your satisfaction. Make sure that each word is seperated by a pipe "|" and keep in mind that the array is case sensitive. So the words "SEX" and "Sex" are 2 different words. Also, excercise caution here. You don't want to ban words that are used in everyday e-mails. For example, you wouldn't want to ban the word "hello" or something like that. You should only ban words that you are 100% sure you would never see in a legitimate e-mail.
Now let's set up the logging directory...
touch /home/vpopmail/qtrap/logs/qtrap.log
chown -R vpopmail:vchkpw /home/vpopmail/qtrap
chmod -R 755 /home/vpopmail/qtrap
Now we will add this script into the mail path for a domain on our server.
cd /home/vpopmail/domains/yourdomain.com
vi .qmail-default
add the following line above the line that is already there
| /home/vpopmail/qtrap/qtrap.sh
Here's an example:
.qmail-default before:
| /home/vpopmail/bin/vdelivermail '' delete
,qmail-default after:
| /home/vpopmail/qtrap/qtrap.sh
| /home/vpopmail/bin/vdelivermail '' delete
Save these changes and that should be it. You don't have to restart anything. To test this last rule, try sending an e-mail to your mailbox and make sure that the test e-mail contains one of the words that you entered into the "bad word" list in the Qtrap script. If the filter is working right, the message should NOT arrive in your inbox. You should then be able to view the log file at /home/vpopmail/qtrap/logs/qtrap.log and see a log of the dropeed message corresponding to the time at which you sent the test message. The drop log should look something like this:
MESSAGE DROPPED from someone@somewhere.com This e-mail address is being protected from spam bots, you need JavaScript enabled to view it because of some_banned_word on on 06/13/03 02:37:51
If the test was successfull, then that's it! Congratulations, you've completed the Qmailrocks.org Qmail installation. Have fun. The next couple steps discuss cleanup as well as some closing notes and suggestions.
 

Proceed to Part 18

댓글목록

등록된 댓글이 없습니다.

Total 138건 4 페이지
리눅스 Tip 목록
번호 제목 글쓴이 조회 날짜
84 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 14729 05-23
83 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 14622 05-22
82 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 12567 05-22
81 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 15042 05-22
80 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 14024 05-21
79 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 17119 05-10
78 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 19319 05-08
77 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 15293 06-11
76 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 8893 02-02
75 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 8449 01-31
74 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 16140 01-31
열람중 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 17996 01-31
72 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 17112 01-31
71 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 15616 01-31
70 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 16352 01-31
69 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 14813 01-31
68 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 14082 01-31
67 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 15155 01-31
게시물 검색