[imp] IMP with IMAP2001a c-client
Jan Schneider
jan@horde.org
Thu, 30 May 2002 13:35:37 +0200
Zitat von Shawn Robinson <Shawn.Robinson@telus.com>:
> At 02:10 AM 2002/05/29 +0200, Jan Schneider wrote:
> >Zitat von Shawn Robinson <Shawn.Robinson@telus.com>:
> >
> > > 1) ensure the OP_SILENT is set on all imap stream opens.
> >
> >This sounds interesting, but this flag isn't mentioned in the php
> manual. I
> >didn't have the time to look inside the source code, but is it it
> defined
> >anywhere?
>
> It's included in php4.1.2/ext/imap/php_imap.c as a flag, and there is a
> reference to it in the uwash documentation at
> http://www.washington.edu/imap/documentation/internal.txt.html (search
> for
> OP_SILENT)
Grrr, someone should add this to the php manual. I guess this could help us
a lot because there are many cases where the c-client throws errors that
can't be silenced from within the php code.
> > > 4) eat the errors after most/all imap calls in IMP. using
> imap_errors() ?
> >
> >This function only returns the last error messages but doesn't prevent
> the
> >c-client from being so loud.
>
> From php.net:
> array imap_errors ( void)
> This function returns an array of all of the IMAP error messages
> generated since the last imap_errors() call, or the beginning of
> the page. When imap_errors() is called, the error stack is
> subsequently cleared.
>
> So, it looks to me like it will clear the error stack of accumulated
> errors, but these errors are never read and presented.
This doesn't help because it won't silence messages from the c-client. They
are only added to the error stack but still thrown on the pages.
> However, I just found a snippet in imp/status.php that inlcudes a call to
> imap_alerts(), which is also fed via the mm_log call in the imap sources.
>
>
> >if (isset($imp['stream'])) {
> > $alerts = imap_alerts();
> > if (is_array($alerts)) {
> > foreach ($alerts as $alert) {
> > Horde::raiseMessage($alert, HORDE_MESSAGE);
> > }
> > }
> >}
>
> I'll lose the raiseMessage, and I bet this will clear up my griefs. Any
> ideas on what could break, or why the imap_alerts() call is in
> status.php?
We do this to show any error messages from the imap server that are raised
on an imap action that we didn't catch inside the code.
Jan.
--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft