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.