Re: [Courier-imap] UID STORE FLAGS problem while IMAP_KEYWORDS=1

2008-07-04 Thread Vlad
 Vlad writes:
 
 Hello all.
 
 I use courier-imap (from toaster package) on CentOS 5 machine with one
 virtual domain (qmail+vpopmail) and fiew little mailboxes.
 I've discovered strange behaviour of imapd on UID STORE ..
 +-FLAGS.SILENT (\someflag) operations.
 Each time such command passing to, imapd process start to use 98-100%
 of CPU and freeze for very long time without command responce.
 During that time all followed commands (NOOP) are getting stuck without
 responces as well.
 I tried to use latest version of courier-imap (original is 4.1.2) and
 got same result. Appropriated authlib packages were used of course.
 Changing IMAP_USELOCKS and IMAP_ENHANCEDIDLE to 0 did not help.
 
 Only after setting IMAP_KEYWORDS=0 I got positive result.
 
 I use 4.1.2 version on another server under Fedora 6 and it work fine
 with IMAP_KEYWORDS=1
 
 What can be the reason?
 
 If you use NFS, verify that the clocks on the client and the server are
 synchronized.
 
 There is no NFS or any other distributed file system. There are local
 partitions (ext3) only.

 Check that FAM or Gamin are correctly installed. Look in syslog for any
 error messages.

Sorry, is there any chance to get the problem solved?
As I wrote there are no error messages in the log files.




-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
Courier-imap mailing list
Courier-imap@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap


Re: [Courier-imap] Imaplogin - lastauth

2008-07-04 Thread Brian Candler
On Thu, Jul 03, 2008 at 01:16:57PM +0200, Carlos García Gómez wrote:
I need to store last authentication time for imap login.

A simple solution is to look at the mtime timestamp on the 'cur'
subdirectory of the Maildir. This is because every time the user logs in,
any mail in new/ is moved to cur/, and this updates the timestamp on cur/.

This doesn't work if the user has no new mail, but you can add a simple
patch to update the cur/ directory in that case.

The attached patches are a couple of years old, you'll have to see if they
still apply cleanly. They have been posted before, e.g.
http://sourceforge.net/mailarchive/message.php?msg_id=20080401054905.GA13986%40uk.tiscali.com

Regards,

Brian.
diff -uNr courier-imap-4.0.3.orig/imap/imapscanclient.c 
courier-imap-4.0.3/imap/imapscanclient.c
--- courier-imap-4.0.3.orig/imap/imapscanclient.c   Tue Jul 20 00:54:14 2004
+++ courier-imap-4.0.3/imap/imapscanclient.cSun May 22 18:16:33 2005
@@ -358,6 +358,7 @@
 struct dirent *de;
 unsigned long left_unseen=0;
 intdowritecache=0;
+intgotnew=0;
 
if (is_sharedsubdir(dir))
maildir_shared_sync(dir);
@@ -723,6 +724,7 @@
}
 
if (dirp)   closedir(dirp);
+   if (n)  gotnew = 1;
 
while (n)
{
@@ -749,6 +751,13 @@
}
} while (keepgoing);
}
+
+   /* Update the 'cur' timestamp if no new mail arrived */
+   if (!gotnew) {
+   strcpy(p+strlen(p)-3, cur);
+   utimes(p, 0);
+   }
+
free(p);
 
/*
diff -uNr courier-imap-4.0.3.orig/maildir/maildirgetnew.c 
courier-imap-4.0.3/maildir/maildirgetnew.c
--- courier-imap-4.0.3.orig/maildir/maildirgetnew.c Tue Jun  8 23:44:24 2004
+++ courier-imap-4.0.3/maildir/maildirgetnew.c  Sun May 22 18:09:46 2005
@@ -77,6 +77,7 @@
int n;
char *new_buf[20];
char *cur_buf[20];
+   int gotnew = 0;
 
do
{
@@ -125,6 +126,7 @@
}
}
if (dirp)   closedir(dirp);
+   if (n)  gotnew = 1;
 
while (n)
{
@@ -151,4 +153,7 @@
free(cp);
}
} while (keepgoing);
+
+   /* Update the 'cur' timestamp even if no new mail arrived */
+   if (!gotnew) utimes(curd, 0);
 }
diff --exclude *~ -uNr sqwebmail-5.0.2.orig/sqwebmail/maildir.c 
sqwebmail-5.0.2/sqwebmail/maildir.c
--- sqwebmail-5.0.2.orig/sqwebmail/maildir.cThu Oct 21 02:13:18 2004
+++ sqwebmail-5.0.2/sqwebmail/maildir.c Sun May 22 20:15:03 2005
@@ -1115,6 +1115,7 @@
DIR *dirp;
struct  dirent  *dire;
characl_buf[2];
+   int gotnew=0;
 
/* Delete old files in tmp */
 
@@ -1143,8 +1144,14 @@
rename(oldname, newname);
free(oldname);
free(newname);
+   gotnew=1;
}
if (dirp)   closedir(dirp);
+   if (!gotnew) {
+   /* Update the 'cur' timestamp if no new mail arrived */
+   strcpy(dirbuf+strlen(dirbuf)-3, cur);
+   utimes(dirbuf, 0);
+   }
free(dirbuf);
 
/* Look for any messages mark as deleted.  When we delete a message
-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08___
Courier-imap mailing list
Courier-imap@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap


Re: [Courier-imap] Imaplogin - lastauth

2008-07-04 Thread Brian Candler
On Fri, Jul 04, 2008 at 08:42:03AM -0300, Jeronimo Zucco wrote:
 Brian Candler wrote:
  A simple solution is to look at the mtime timestamp on the 'cur'
  subdirectory of the Maildir. This is because every time the user logs in,
  any mail in new/ is moved to cur/, and this updates the timestamp on cur/.
 

 
 For performance reasons, I've disabled log of timestamp access in
 the Maildir's partition with noatime option, this solution doesn't
 work  in my setup.

You misunderstand. There are three inode timestamps:

ctime - when file's status was last changed
mtime - when file was modified
atime - when file was accessed

Disabling atime updates doesn't affect the other two. mtime is always
updated when a file or directory is changed. 'man 2 stat' for more info.

Brian.

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
Courier-imap mailing list
Courier-imap@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap