From: Robert O. <r....@it...> - 2004-04-21 18:57:02
|
I posted the changes here in the forum. Since they utilize some = "hardcoded" values instead of a nice configurable config-addition, it = did not make it into the faq.=20 There are several adjustments that are VERY specific to your LDAP setup, = like authenticating the query, the structure of your LDAP database or = the field(s) that are checked for the address in question. If you are = running ms-exchange in the background, the necessary changes should be = quite simple. If you use a different LDAP server, you probably have to = adjust the "filter" which requires detailed knowledge of the LDAP server = and some testing with an external LDAP utility. If someone gets this running with a different LDAP server, I would be = interested in the required changes. Maybe we could make a more = "automatic" determination. Remember, if you change the code, you will probably redo the changes = every time you update ASSP to another version. I made that for the 1.0.8 version, but as far as I know the "localmail" = procedure had not changed in 1.0.9, so I expect it should work with this = release too. This procedure determines whether a given email address is = to be considered "local", normally by checking against the = "localdomains". You still need "localdomains" for email-interface and = relay-checking, that is done elsewhere in the code. Here it goes: -=3D-=3D-=3D-=3D- Add the following dependency on top of ASSP.PL use Net::LDAP; # do LDAP lookup of email addresses In case the Net::LDAP library is not installed, it can be installed = quickly via the "PPM" command PPM install Net::LDAP -=3D-=3D-=3D-=3D- Locate the procedure "sub localmail" within ASSP source and replace the = procedure with the following code -=3D-=3D-=3D-=3D- sub localmail { my $h=3Dshift; $h =3D $1 if $h=3D~/\@(.*)/; #print "h=3D$h ld=3D$localDomains ldf=3D$localDomainsFile\n"; =20 # do LDAP lookup. If the LDAP server does nor run on "localhost", put = your server name there =20 $ldap =3D Net::LDAP->new( 'localhost' ); =20 # bind to a directory with dn and password # change 'cn=3Duser,cn=3DUsers,DC=3Dcompany,DC=3Dcom' to a valid user = at your LDAP server # that is allowed to do such queries $mesg =3D $ldap->bind( 'cn=3Duser,cn=3DUsers,DC=3Dcompany,DC=3Dcom', password =3D> 'add your password here'); # perform a search. We just check whether the lookup of the # email address returns "any result" or an error # "base" is the root, queries are done down the whole tree # "filter" defines the query. You must check what field(s) contain ALL = relevant # email addresses and aliases. The query below works well with = MS-Exchange 5.5/2K $mesg =3D $ldap->search( base =3D> "DC=3Dcompany,DC=3Dcom", filter =3D> "(proxyaddresses=3Dsmtp:$1$h)", attrs =3D> ['mail']); $mesg->code && die $mesg->error; =20 $entry_count =3D $mesg->count; =20 # uncomment the last line to see the result on the screen (if visible) #print "LDAP search: $1$h returns: $entry_count entries\n"; $mesg =3D $ldap->unbind; # take down session return $entry_count =20 0; } -=3D-=3D-=3D-=3D- ----- Original Message -----=20 From: "ASSP" <as...@ew...> To: <ass...@li...> Sent: Wednesday, April 21, 2004 2:38 PM Subject: Fwd: Re(2): [Assp-user] Blocking of spam bombs - how does this = work? ass...@li... on Montag, 19. April 2004 at 14:35 Uhr +0100 wrote: >I too had this problem and this was the reason for me to implement >LDAP-Lookup in ASSP as my Exchange-Server did not check the invalid >recipients until the entire message was read - and in turn wanted to >send >yet another NDR back. Is there a chance to get your implementation of ldap lookup into assp? greetings --=20 Fritz Borgstedt - Chief Engineer, Unicorn <fb...@iw...>,http://www.magicvillage.de ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dcli= ck _______________________________________________ Assp-user mailing list Ass...@li... https://lists.sourceforge.net/lists/listinfo/assp-user |