Skip to Content.
Sympa Menu

en - Re: [sympa-users] 2-level LDAP named filter search of sorts?

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: Scott Balmos <address@concealed>
  • To: Aumont - Comite Reseaux des Universites <address@concealed>
  • Cc: address@concealed
  • Subject: Re: [sympa-users] 2-level LDAP named filter search of sorts?
  • Date: Thu, 10 Feb 2005 09:47:13 -0500

Aumont - Comite Reseaux des Universites wrote:

Scott Balmos wrote:

So now, I need a two-level LDAP search. The first search would search to match the [sender] address to any address in attributes mail, mailForwarding, and mailAlternate. It would grab the mail attribute (the canonic address), and then do a normal is_subscriber([returned_mail_attr]) to see if I really am a member of the list. In reality, it seems, I could get away with search(sender_canonic.ldap,[sender]) if search() would return a string that I could use in another scenario function, not just true or false.

e.g. in a scenario file...

search(sender_canonic.ldap,[sender]) smtp -> assign_to=mail_attr
is_subscriber([mail_attr]) smtp -> do_it

Or something similar I guess.

This is possible but not that way because named LDAP search are used as boolean, the result can't be used in another condition. Here is a way to do it. Let's say your list is named foo . The idea is to create a hidden list named foo-hidden which will contain all [mail_attr] of each subscriber of list foo. Then you can authorise foo-hidden to send message to list foo.

In order to do this create foo-hidden with the same ldap subscriber definition but use the parameter "select / all" /to fetch all emails of each person (you may need to adapt the ldap query depending on the directory semantic definition). Then create a scenario named send.subscriber_foo-hidden with
is_subscriber (foo-hidden,[sender]) smtp -> do_it

Don't forget to hidde foo-hidden list : close subscribtion, close message sending, and hidde the list with parameter visibility.

Okay, I see where this is going. Can the attrs2 parameter of a 2-level LDAP include query take multiple attribute names? Like my original message said, there are not only multiple values of an attribute (mail), but also multiple attributes that I have to check. I'm pretty sure I can just as easily replicate this by having multiple include paragraphs in the foo-hidden config, one for each attribute to collect. But obviously cleaner is better. :)

Also, can scenario parameters expand "variables" inside a string, or concatenate a literal string? It doesn't look like it from the scenario definition grammar in the docs. For the above, you have is_subscriber(foo-hidden,[sender]). What I would ideally like is is_subscriber([listname]-hidden,[sender]), so I can make a single site-wide scenario file, instead of replicating it across all lists individually.

Maybe two "easy" fixes? :)

Hope this help.

Serge

Thanks!

--
Scott Balmos




Archive powered by MHonArc 2.6.19+.

Top of Page