I think I found the bug. Please test this patch (which is a patch in the
true sense of the word).
When the mailboxes table is updated, the running server(s) receive a pg
LISTEN/NOTIFY signal. But aox has a rate limiter. It doesn't pick up
changes more often than every third seconds.
So if you create two new accounts within three seconds, for example, and
try to log in as the second, the server goes boom.
I'm not surprised that the bug has been able to hide for years.
The PROPER fix is different, but is rather large, so here's a stopgap.
Doesn't help with POP logins.
Arnt
diff --git a/imap/imap.cpp b/imap/imap.cpp
index b33aecd..acad44e 100644
--- a/imap/imap.cpp
+++ b/imap/imap.cpp
@@ -601,6 +601,8 @@ void IMAP::runCommands()
delayNeeded = (int)d->lastBadTime + delayNeeded - (int)::time(0);
if ( delayNeeded < 0 )
delayNeeded = 0;
+ if ( user() && !user()->inbox() && delayNeeded < 4 )
+ delayNeeded = 4;
if ( delayNeeded > 0 && !d->commands.isEmpty() ) {
log( "Delaying next IMAP command for " + fn( delayNeeded ) +
" seconds (because of " + fn( syntaxErrors() ) +