查看完整版本: pop-before-smtp

danny 2009-8-11 18:07

pop-before-smtp

[color=#333333][b][size=3]pop-before-smtp 是用pop認證來代替smtp認證帳號,只要寄信之前先收信後就可以寄信,這時候smtp認證就是使用之前的pop認證[/size][/b][/color]


[color=#333333]
[/color][b][size=2]準備:
[/size][color=#993366]1. perl modules[/color][/b]
Time::HiRes
File::Tail
Net::Netmask
Date::Parse
DB_File
可至 [url=http://search.cpan.org/][color=#0000ff]http://search.cpan.org/[/color][/url] 下載安裝
[b][color=#993366]2.pop-before-smtp-1.42.tar.gz[/color][/b]
可至 [url=https://sourceforge.net/project/showfiles.php?group_id=5017][color=#0000ff]https://sourceforge.net/project/showfiles.php?group_id=5017[/color][/url] 下載安裝
[size=2][b]安裝:[/b]
[/size][b][color=#993366]1. 安裝所需的 perl modules
[/color][/b]# perl Makefile.PL
# make
# make install
[b][color=#ff6600]註: 這是針對perl modules 安裝的方法[/color][/b]

[b][color=#993366]2. 設定 pop-before-smtp
[/color][/b]解壓縮:
# tar -zxvf pop-before-smtp-1.42.tar.gz
進入該目錄:
# cd pop-before-smtp-1.42.tar.gz
修改 pop-before-smtp-conf.pl
# vi pop-before-smtp-conf.pl
找到下列三個參數後並做以下設定
$file_tail{’name’} = ‘/var/log/maillog’; #設定mail的log檔
$grace = 30*60;         #有效時間,單位是秒
$dbfile = ‘/etc/postfix/pop-before-smtp’;  #允許ip的db存放位置
找到支援vm-pop3d的設定, 並將註解拿掉
# A Modern vm-pop3d can use a normal, 1-line pattern:
$pat = ‘^[LOGTIME] \S+ vm-pop3d\[\d+\]: ‘ .
‘User .+? logged in from (\d+\.\d+\.\d+\.\d+)’;
[b][color=#993366]3. 測試 pop-before-smtp 是否可用
[/color][/b]# ./pop-before-smtp –config=./pop-before-smtp-conf.pl –debug –nowrite –reprocess
[b][color=#ff6600]註: 如果有列出日期及ip等資料,則表示正確[/color][/b]
[b][color=#993366]4. 安裝 pop-before-smtp[/color][/b]
# cp pop-before-smtp.init /etc/rc.d/init.d/pop-before-smtp
# cp pop-before-smtp /usr/sbin/
# cp pop-before-smtp-conf.pl /etc
[b][color=#993366]5. 將 pop-before-smtp 加入 chkconfig,並開機自動啟動[/color][/b]
# chkconfig –add pop-before-smtp
# chkconfig pop-before-smtp on
[b][color=#993366]6. 啟動 pop-before-smtp[/color][/b]
# service pop-before-smtp start
or
# /etc/rc.d/init.d/pop-before-smtp start
[color=#ff6600]註: 啟動後在/etc/postfix/下會多出一個 pop-before-smtp.db檔案[/color]
[b][color=#993366]7. 修改postfix的main.cf[/color][/b]
# vi /etc/postfix/main.cf
修改 smtpd_recipient_restrictions
smtpd_recipient_restrictions = permit_mynetworks,reject_non_fqdn_recipient, check_client_access hash:/etc/postfix/pop-before-smtp, check_relay_domains
增加 check_client_access hash:/etc/postfix/pop-before-smtp 這一行
[b][color=#993366]8. 重新啟動 postfix[/color][/b]
# service postfix restart
or
# /etc/rc.d/init.d/postfix restart

本文轉自遨遊飛翔
頁: [1]
查看完整版本: pop-before-smtp