Sean Chittenden wrote:
Howdy. I was in the process of turning up a new dbmail install when I
ran into a rather large problem. When I upload more than two messages
from my local inbox onto the server via IMAP, the server spins in a
tight loop and runs forever, which is something of a problem when I
want to mass-migrate people from cyrus to dbmail via imap.
The problem seems to be that db_get_msgflag() and db_get_main_header()
are getting called over and over, courtesy of _ic_fetch().
Wrong.
Like I said: it's _ic_search that's messing up here.
> COMMAND: [5 UID SEARCH RECENT HEADER MESSAGE-ID
<[EMAIL PROTECTED]>]
It's not just that dbmail starts searching *all* messages in the
mailbox involved whereas only 'recent' messages should be searched.
Which is just very sloooooooow on large mailboxes to begin with (bug
#97). The problem there is that the 'recent' flag is never cleared at
the moment.
arg[0]: 'SEARCH'
arg[1]: 'RECENT'
arg[2]: 'HEADER'
arg[3]: 'MESSAGE-ID'
arg[4]: '<[EMAIL PROTECTED]>'
IMAPClientHandler(): Executing command uid...
db.c,db_acl_has_right: checking ACL for user [3] on mailbox [1]
dbpgsql.c,db_query: executing query [SELECT mailbox_idnr FROM
dbmail_mailboxes WHERE mailbox_idnr = '1' AND owner_idnr = '3']
dbpgsql.c,db_query: executing query [SELECT block.messageblk FROM
dbmail_messageblks block, dbmail_messages msg WHERE
block.physmessage_id = msg.physmessage_id AND msg.message_idnr = '120'
ORDER BY block.messageblk_idnr]
[etc, etc, for each messageid...]
dbpgsql.c,db_query: executing query [SELECT message_idnr FROM
dbmail_messages WHERE mailbox_idnr = '1' AND status < '2' AND
unique_id!='' AND recent_flag=1]
Now where did that select come from. It should only happen at the
beginning of a search command.
IMAPClientHandler(): Finished command uid
IMAPClientHandler(): line read for PID 74220
COMMAND: [6 APPEND INBOX (\Seen) "05-Nov-2004 02:05:06 -0800" {3976}]
[clean append run]
IMAPClientHandler(): Finished command append
IMAPClientHandler(): line read for PID 74220
COMMAND: [7 UID SEARCH RECENT HEADER MESSAGE-ID
<[EMAIL PROTECTED]>]
Same type of search as before, but with a nasty twist...
dbpgsql.c,db_query: executing query [SELECT mailbox_idnr FROM
dbmail_mailboxes WHERE mailbox_idnr = '1' AND owner_idnr = '3']
looking for RECENT messages
dbpgsql.c,db_query: executing query [SELECT block.messageblk FROM
dbmail_messageblks block, dbmail_messages msg WHERE
block.physmessage_id = msg.physmessage_id AND msg.message_idnr = '120'
ORDER BY block.messageblk_idnr]
Parsing a message for the message-id header lookup.
dbpgsql.c,db_query: executing query [SELECT message_idnr FROM
dbmail_messages WHERE mailbox_idnr = '1' AND status < '2' AND
unique_id!='' AND recent_flag=1]
Here we go again. But this time no graceful exit:
dbpgsql.c,db_query: executing query [SELECT block.messageblk FROM
dbmail_messageblks block, dbmail_messages msg WHERE
block.physmessage_id = msg.physmessage_id AND msg.message_idnr = '120'
ORDER BY block.messageblk_idnr]
Look maw, I'm looping.....
This is a nasty one Sean.
It's imaputils.c(perform_imap_search)
--
________________________________________________________________
Paul Stevens mailto:[EMAIL PROTECTED]
NET FACILITIES GROUP PGP: finger [EMAIL PROTECTED]
The Netherlands________________________________http://www.nfg.nl