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?
I realize that the index/cache files contain last-access data, but
if the cache files become corrupted and have to be removed, then this
last-access information is lost. I would like something independent
of the cache files. Advice please...
Jeff Earickson
Colby College
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>