[Dovecot] last access file for 1.0-stable?

Timo Sirainen tss at iki.fi
Tue Jul 26 22:57:20 EEST 2005


On Tue, 2005-07-26 at 07:15 -0400, Jeff A. Earickson wrote:
> Hi,
>    I am almost ready to convert from UW-imap to dovecot 1.0 stable
> for my imap use.  I hacked UW-imap to touch a file in the user's
> home directory so I can always tell the last time they used imap.
> My hack looks something like this:
> 
> if(authenticated)
> {
>         touchfile = (char *) malloc((strlen (home) + 15);
>         sprintf(touchfile,"%s/.imapd.last",homedir);
>         fd = open(touchfile,O_WRONLY|O_CREAT|O_TRUNC,0600);
>         if(fd < 0)
>            syslog (LOG_NOTICE|LOG_AUTH,"touchfile failed for %s:%s",user,strerror(errno));
>         else
>            close(fd);
>         free(touchfile);
> }
> 
> Where to do this in the dovecot code?  Is there something like this 
> already available?

Not really. But you could put this somewhere in main() function in
imap/main.c for example.

Another way would be to change imap_executable setting in config file to
some wrapper script/executable which does this and then execs Dovecot's
imap process. No source code modification needed.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://dovecot.org/pipermail/dovecot/attachments/20050726/ed9ccc31/attachment-0001.bin>


More information about the dovecot mailing list