[imp] IMP: hook: post-login: write to LDAP server?

Jan Schneider jan at horde.org
Wed Sep 24 17:29:48 UTC 2008


Zitat von Patrick Ben Koetter <p at state-of-mind.de>:

> Good afternoon from Munich!
>
> I need to create a large number (~ 100.000) of Mailaccounts in advance, but I
> don't want my SMTP server to receive mail for those recipients and store all
> the spam that makes it through the filters, unless a user has successfully
> logged into IMP. The login is supposed to activate the account and make it
> know to the SMTP server.
>
> My idea is to define an attribute in LDAP and set it to FALSE until the user
> logs into IMP and have this a condition in the SMTP servers query to the LDAP
> server. Then, after login, a script runs once and sets the value to  
> TRUE. From
> that moment on the condition is satisfied in the SMTP servers query and the
> recipient becomes a valid recipient.
>
> Reading through the docs, I guess, imp/config/hooks.php is the place to
> implement a script that will alter the LDAP attribute, right? Is there a
> runonlyonce hook or will the script have to run every time a user logs in?

If you do it be this hook, then it will indeed run on each login.  
Alternatively you can:
a) create a custom maintenance task the only runs on the first login,  
unattended.
b) let the SMTP server check the Horde preference backend whether the  
last_login preference exists for the user.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the imp mailing list