i was looking your mail and as I have a data base i added a field to de data base I modified the script so it lokks like this.
#!/bin/sh echo "update mailbox set last_log = now() WHERE username = '$USER'" | mysql postfix exec /usr/dovecot/libexec/dovecot/pop3 but nothing gets written to the field. I think there is a problem with the value of variable $USER, as this is a shell script. Any Ideas? On Feb 11, 2008 1:42 PM, Hugo Monteiro <[EMAIL PROTECTED]> wrote: > > Osvaldo Alvarez Pozo wrote: > > Hi > > I wonder how can I know if a mailbox is not beeing consulted. I mean I > > have severals mailboxs but I know some account are not used. I like to > > know how to determine wich mail accounts are not beeing used. Is there > > any way in dovecot to know the las time a user loged in to dovecot? > > > > Thanks > > > > > > I'm using dovecot's ability to use "pre execution" scripts. > > Basically i have in my imap protocol definition in dovecot.conf an > alternate mail_executable > > protocol imap { > ... > mail_executable = /usr/local/bin/imap-wrapper.sh > ... > } > > And that executable has the following: > > ---- snip ---- > #!/bin/sh > > # Filesystem based timestamp in user's home directory and protocol used > echo imap > /var/spool/lastlogin/$UID > > # Finally execute the imap/pop3 binary. If you use both, you'll need two > scripts. > exec /usr/lib/dovecot/imap > ---- snip ---- > > > I echo the protocol into the file because i have both pop and imap > available to my users and this way i can keep track when was the last > time they accessed their mailbox (ls -l /var/spool/lastlogin/username) > and which protocol they used in that access (cat > /var/spool/lastlogin/username). > > > There are inumerous possibilities of course. > > Regards, > > Hugo Monteiro. > > -- > ci.fct.unl.pt:~# cat .signature > > Hugo Monteiro > Email : [EMAIL PROTECTED] > Telefone : +351 212948300 Ext.15307 > > Centro de Informática > Faculdade de Ciências e Tecnologia da > Universidade Nova de Lisboa > Quinta da Torre 2829-516 Caparica Portugal > Telefone: +351 212948596 Fax: +351 212948548 > www.ci.fct.unl.pt [EMAIL PROTECTED] > > ci.fct.unl.pt:~# _ > >