php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38188 imap_mail_move results in 'Notice' and loop broken
Submitted: 2006-07-22 14:16 UTC Modified: 2006-07-24 10:29 UTC
From: Ruben at e-builds dot com Assigned:
Status: Not a bug Package: IMAP related
PHP Version: 5.1.4 OS: Win XP // IIS 5.1
Private report: No CVE-ID: None
 [2006-07-22 14:16 UTC] Ruben at e-builds dot com
Description:
------------
Only sometimes, but once I get it, most of the next times, when I call imap_mail_move within a loop over the mails in an imap folder it returns 0 though it shouldn't!  
  
In the next iteration of the loop I get the Notice:
  Notice: Unknown: No matching messages (errflg=2) in Unknown on line 0
probably at the next imap function (imap_headerinfo).

I also think, though it is a Notice, it manages to not completely let my loop finish all the remaining iterations.

Reproduce code:
---------------
..
$cmails=imap_num_msg($imap);
for ($i = 1; $i <= $cmails; $i++) { 
	set_time_limit(120) ;
	$header = imap_headerinfo($imap, $i);
	..
	imap_mail_move($imap, $i, 'OLT Incomplete');
	..
}

Expected result:
----------------
for all messages to be moved to 'OLT Invomplete'
(with some conditions of course, but for simplicity not mentioned)

Actual result:
--------------
-----------------START-----------------
Connected to mailserver
  Found 4 messages. Reading unread..
  Reading unread e-mail (nr. 1)..
    IS a license request.
    Request has all the MINIMUM information. Putting into OLT..
      Checking USER
        User found by e-mail!
        User ID=16691
        User (ID:16691) doubted and updated as such!
        E-mail sent to user to activate account.
      Checking LICENSE
        Using License Number: 0330100000118
        License created in DB! (ID:34458)
        License key on Hold.
    Request successfully added in OLT! (Moved to imap folder 'Completed')
  Reading unread e-mail (nr. 2)..
    IS a license request.
    Request has all the MINIMUM information. Putting into OLT..
      Checking USER
        User not found.
        User (ID:16691) doubted and updated as such!
        E-mail sent to user to activate account.
      Checking LICENSE
         Country is unknown (no invoice would be made (Could not move to imap folder 'Incomplete')
------------------END------------------

Notice: Unknown: No matching messages (errflg=2) in Unknown on line 0

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-22 14:17 UTC] Ruben at e-builds dot com
adjusted title
 [2006-07-23 11:56 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.


 [2006-07-24 10:21 UTC] Ruben at e-builds dot com
I am really sorry, guys.
I cannot reproduce with a simple script and the Notice happens so seldomly that after 45" of trying to give you something to work on, I gave up.
The original script is bigger than 600 lines..

Maybe my script is faulty, though I doubt it, but because the 'Notice' says 'Unknown' and at 'line 0', I can't detect it.
Doesn't this also points to a bug (the 'Unknown' and 'line 0') ?
 [2006-07-24 10:29 UTC] tony2001@php.net
"Unknown" and "line 0" means it happens on shutdown and it's perfectly legal.
Please reopen the report if/when you have more information to add. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 09:01:29 2024 UTC