FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=18038&edit=1

ID: 18038
Comment by: kqc9do4b
Reported By: 3KKABBYn at madewell dot net
Summary: Reaching the set limit should not generate an error
Status: Open
Type: Feature/Change Request
Package: Mail_Queue
Package Version: 1.2.6
PHP Version: 5.2.9
New Comment:

I generally agree with the original comment which said that
Mail_Queue_Container::get() should simply return false when a limit is
reached.

As it presently stands (v. 1.2.6), the while loop in
Mail_Queue::sendMailsInQueue() never terminates (infinite loop) when the
limit is reached, because the loop tests for the return of 'false'
without testing for the possible return of an error object:

while ($mail = $this->get()) {
$this->container->countSend($mail);


Previous Comments:
------------------------------------------------------------------------

[2010-11-09 17:04:58] cl1mh4224rd

Description:
------------
In Mail_Queue 1.2.5, I believe, code was introduced into the
Mail_Queue_Container::get() method that returns an error object when the
queue has reached the limit that the user sets. (Lines 126-131 in
Mail/Queue/Container.php)

To make matters worse, the error object's code is set to
MAILQUEUE_ERROR_CANNOT_INITIALIZE. This makes it impossible to
distinguish from legitimate errors.

The problem is most obvious when you've set up logging of error
conditions, as an "error" log event will be generated each time the
limit is met, despite this being a normal, expected situation.

Possible solutions are to 1) simply return FALSE, or 2) add a new error
code (i.e. MAILQUEUE_ERROR_LIMIT_REACHED) and set the instantiated error
object's code to this value.

I feel that this situation should not be considered an error condition,
so #1 is ideal, in my opinion, but #2 may be an acceptable alternative.

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedDec 28, '10 at 9:03p
activeDec 28, '10 at 9:03p
posts1
users1
websitepear.php.net

1 user in discussion

Kqc9do4b: 1 post

People

Translate

site design / logo © 2022 Grokbase