Pop-before-smtpを使ってFedora CoreでPostfixとDovecotでPOP before SMTPする方法です。
Pop-before-smtpはPerlベースなので速度は期待できませんが、インストール方法が簡単そうでした。
他の方法としてはDRACがあります。
Fedora Core 2でインストールしましたが、それ以降でも問題なさそうです。
# tar xvfz pop-before-smtp-1.41.tar.gz
# cd pop-before-smtp-1.41/ # 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
#$file_tail{'name'} = '/var/log/maillog';
# For Dovecot POP3/IMAP when using syslog. #$pat = '^[LOGTIME] \S+ (?:dovecot: )?(?:imap|pop3)-login: ' . # 'Login: .*? (?:\[|rip=)[:f]*(\d+\.\d+\.\d+\.\d+)[],]'; #$out_pat = '^[LOGTIME] \S+ (?:dovecot: )?(?:imap|pop3)-login: ' . # 'Disconnected.*? (?:\[|rip=)[:f]*(\d+\.\d+\.\d+\.\d+)[],]';
=cut #====================== Postfix BerkeleyDB =======================START= # If you comment-out (or remove) the two surrounding =cut lines, we'll use # BerkeleyDB instead of DB_File. use BerkeleyDB; #$mynet_func = \&mynet_postfix; # Use the default $tie_func = \&tie_BerkeleyDB; $sync_func = \&sync_BerkeleyDB; $flock = 0; my $dbh; # We must tie the global %db using the global $dbfile. Also sets $dbh for # our sync function. sub tie_BerkeleyDB { $dbh = tie %db,'BerkeleyDB::Hash',-Filename=>"$dbfile.db",-Flags=>DB_CREATE or die "$0: cannot dbopen $dbfile: $!\n"; } sub sync_BerkeleyDB { $dbh->db_sync and die "$0: sync $dbfile: $!\n"; } =cut #====================== Postfix BerkeleyDB =========================END=
# perl -MCPAN -e shell cpan> install Time::HiRes cpan> install File::Tail cpan> install Date::Parse cpan> install Net::Netmask cpan> install BerkeleyDB
# vi /etc/postfix/main.cf smtpd_recipient_restrictions = permit_mynetworks,reject_non_fqdn_recipient, check_client_access hash:/etc/postfix/pop-before-smtp, reject_unauth_destination # postfix reload
# chkconfig pop-before-smtp on
# /etc/init.d/pop-before-smtp start