Weblog entry #33 for lee

Using an LDAP addressbook for whitelisting in Exim
Posted by lee on Thu 21 Jun 2007 at 19:37
Tags: ,

I recently started using an LDAP addressbook, and given my correspondents are automatically added into it, I decided to use it for whitelisting in my Exim user filter.

Firstly I added an entry into the LDAP server for exim and assigned it read access to the Addressbook database.

Then I added the following into my user exim filter file. I've placed it below the entries dealing with mailing lists, so lookups only happen for non-list (or "direct") email.

if "${lookup ldap {\
      user=\"cn=exim,dc=example,dc=com\" pass=TRUSTNO1 \
      ldap://localhost/o=Addressbook?cn?sub?(mail=${address:$h_From:}) \
      }{yes}{no}}" is "yes"
then
   #logwrite "userfilter_whitelist_ldap ${address:$h_From:}"
   save /var/mail/foo/bar/whitelist/
   finish
endif

Basically the filter extracts an email address from the "From:" header (alternatively the $reply_address or $sender_address variables could be used) and checks to see if there is a corresponding name listed in the database.

 

Comments on this Entry

Posted by Thorsten (80.69.xx.xx) on Fri 22 Jun 2007 at 07:16
[ Send Message ]
nice idea - thanks for the suggestion!

[ Parent | Reply to this comment ]

Posted by jimmy2975 (76.184.xx.xx) on Mon 7 Jan 2008 at 13:41
[ Send Message | View Weblogs ]
Hi,

I have been trying to get a addressbook going with read/write using evolution.

I have followed the instructions from your weblog

I have skipped the TLS part since I cant find the /etc/ssl directory on my fedora core 8 box.

I use evolution. I can see the addressboook created, and all the features in the evolution schema. When I try to create an entry and hit "OK" I get permission denied. I have chmod 700 even 777 the /var/lib/ldap/evolution that I have included in the slapd.conf. I still get the permission denied error

Any comments/suggestions are appreciated.

Please help

THanks
Regards
JImmy

[ Parent | Reply to this comment ]

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search