[imp] IMP with IMAP2001a c-client

Shawn Robinson Shawn.Robinson@telus.com
Tue, 28 May 2002 17:23:58 -0600

I'm having a bit of an issue with the Uwash imap2001a c-client library 
being a bit chatty with error messages.  For instance, it was throwing 
errors for "Mailbox is empty", that would be display in the apache error 
log, and the bottom of the php page, but occasionally the errors surface 
before the page headers, which breaks things for my users (usually on the 
page view *after* the error occurs).

For the "Mailbox is empty" problem, I modified the imap4r1.c call where it 
was being generated, but now I'm looking at some of the errors being 
"thrown" from the address parsing routines, and need something a bit more 
Ideally, I'd like to hide these from the users since there's nothing they 
can do about it anyway.

I see several options to "quiet" the imap library, and I'd appreciate any 
feedback on them:
1) ensure the OP_SILENT is set on all imap stream opens.
2) patch the php4*/ext/imap/php_imap.c mm_log() routine to eat errors
3) hack at the imap client lib to remove the errors
4) eat the errors after most/all imap calls in IMP. using imap_errors() ?

Any other ideas?  Will any of these break anything?

Shawn Robinson