I'm trying to track down why dbmail-imapd bombs out when talking to
Thunderbird 1.5 on my jumbo-INBOX-of-doom (tipping the scales at close
to 90k-messages these days).

I was doing an strace on the imap daemon and noticed a huge amount of
this kind of thing:

dup(9)                                  = 11
lseek(11, 0, SEEK_CUR)                  = -1 ESPIPE (Illegal seek)
lseek(11, 4294967295, SEEK_SET)         = -1 ESPIPE (Illegal seek)
write(11, " ", 1)                       = 1
close(11)                               = 0
dup(9)                                  = 11
lseek(11, 0, SEEK_CUR)                  = -1 ESPIPE (Illegal seek)
lseek(11, 4294967295, SEEK_SET)         = -1 ESPIPE (Illegal seek)
write(11, "UID 308219", 10)             = 10
close(11)

This is unsurprising, because dbmail_imap_session_printf does a pretty
huge amount of work on every call:

1) vprintf the message
2) flush the output fd
3) dup the fd and create a new g_mime_stream_fs on it 
4) create a new stream filter
5) add the filter to the stream
6) write the string (yay!)
7) free all the stuff it just created

I hacked up something that creates the stream stuff statically in the
function, but I think that's too ugly for words (it does work though!).

Where can I put a call to properly initialize these streams s.t. they
are called once per daemon?

Matt

Reply via email to