Hello, I am settiing up a dovecot (imap, pop, sieve, lda) + openldap infrastructure. I need to store the timestamp of the last login of each user in an attribute of its corresponding ldap object. I could not find a way of doing this through configuration options so I am thinking of coding this task into the dovecot-auth source code, maybe in the passdb-ldap.c file. What do you recomend about this? Thanks. __________ Information from ESET Mail Security, version of virus signature database 8278 (20130429) __________ The message was checked by ESET Mail Security. http://www.eset.com
Am 29.04.2013 16:50, schrieb Oscar A. Jara:>> > Hello, I am settiing up a dovecot (imap, pop, sieve, lda) + openldap > infrastructure. I need to store the timestamp of the last login of each > user in an attribute of its corresponding ldap object. I could not find > a way of doing this through configuration options so I am thinking of > coding this task into the dovecot-auth source code, maybe in the > passdb-ldap.c file. What do you recomend about this? Thanks.It's very easy to use post-login-scripting as described on http://wiki2.dovecot.org/PostLoginScripting You just have to code the LDAP-updates in bash. But: We have done this in the past, but we realized, that those many user-logins (~15.000 to ~20.000 active users simultaneously) had been a measureable impact on our LDAP. Okay, not very suprising... We decided to use the simple way of touching ~/.lastlogin. It should be easy to set up a second script that updates the LDAP-records once per night. Normally there shouldn't been a reason to have lastlogin updated "realtime" in LDAP many time per hour. Peer -- Heinlein Support GmbH Schwedter Str. 8/9b, 10119 Berlin http://www.heinlein-support.de Tel: 030 / 405051-42 Fax: 030 / 405051-19 Zwangsangaben lt. ?35a GmbHG: HRB 93818 B / Amtsgericht Berlin-Charlottenburg, Gesch?ftsf?hrer: Peer Heinlein -- Sitz: Berlin
Oscar A. Jara <oajara at frsf.utn.edu.ar> wrote:> Hello, I am settiing up a dovecot (imap, pop, sieve, lda) + openldap > infrastructure. I need to store the timestamp of the last login of > each user in an attribute of its corresponding ldap object. I could > not find a way of doing this through configuration options so I am > thinking of coding this task into the dovecot-auth source code, maybe > in the passdb-ldap.c file. What do you recomend about this? Thanks.I don't think this is a wise idea. LDAP does not like to be written to. With approach like you envision you will certainly kill your LDAP server instantly. If you have any replicated slaves, the write load you will be creating will kill them a second later. Either use post-login scripting to store that value in a SQL database, or better, just touch a file in the users $HOME. Question: why do you need this las-login timestamp information? Maybe there is a better way to solve your problem/need. Gr??e, Sven. -- Sigmentation fault. Core dumped.