[Exim] Exim 4 and SMTP after POP/POP before SMTP using popre…

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Bernhard Erdmann
日付:  
To: Philip Hazel, popbsmtp-users, exim users, cjs
題目: [Exim] Exim 4 and SMTP after POP/POP before SMTP using poprelay (was: Re: Exim & popbsmtp)
Hi,

I got Exim to work with poprelay-1.5 for "SMTP after POP" or "POP before
SMTP".

Philip Hazel, many thanks for your great documentation of Exim! The
clear and comprehensive writing did save my head many times in the past.

poprelay's (http://poprelay.sourceforge.net/) documentation shows many
spelling errors and the RedHat centric SystemV script even reads "for
OpenSSH" and it is untested. I found many bugs using all the options
printed by usage(). Not much to trust in...

popbsmtp's (http://popbsmtp.sourceforge.net/) documentation reads much
better but relies on the Perl module Net::Netmask. This module wants
Perl 5.6.1 but on this particular machine I had to get "SMTP after POP"
up & running Perl 5.6.0 was installed and upgrading Perl was too much
pain because of dependencies... SuSE 7.1 just sucks.

Anyway: poprelay scans /var/log/mail written by the POP3 daemon using
syslog and updates a Berkeley DB file (DB_HASH, not terminated by binary
zero) writing the popper's IP address (key) and a timestamp (value).

Using this DB file in Exim 4.20 for admitting relay to authenticated
poppers is fairly easy:

POPCLIENTS =
${lookup{$sender_host_address}dbmnz{/etc/exim/popip.db}{$sender_host_address}}
hostlist relay_from_hosts = 127.0.0.1 : POPCLIENTS

Very important is the correct DB lookup type dbmnz instead of dbm (dbm
will not get successful lookups):

http://www.exim.org/exim-html-4.20/doc/html/spec_9.html#SECT9.2

dbmnz: This is the same as dbm, except that a terminating binary zero is
not included in the key that is passed to the DBM library. You may need
this if you want to look up data in files that are created by or shared
with some other application that does not use terminating zeros. For
example, you need to use dbmnz rather than dbm if you want to
authenticate incoming SMTP calls using the passwords from Courier's
/etc/userdbshadow.dat file. Exim's utility program for creating DBM
files (exim_dbmbuild) includes the zeros by default, but has an option
to omit them (see section 45.8).

Regards
Bernie