[fix] failed emails aren't removed from the queue

Discuss, research, share, find, and solve bugs

[fix] failed emails aren't removed from the queue

Postby thisisit3 » 9:35pm, Sun 06 May, 2007

If you see something like this:

1599 emails failed (will retry later)

Then chances are your process queue is broken, it will take weeks to remove all those emails from the queue. I don't know why, but there is a simple piece of code that can "unsubscribe" failed users automaticaly, but its disabled by default.

The following patch will enable automatic unsubscription of failed emails and your process queue will run much faster and will complete without any issues related to failed emails.

Code: Select all
--- processqueue.php.orig       2007-05-07 00:33:57.000000000 +0300
+++ processqueue.php    2007-05-07 00:34:45.000000000 +0300
@@ -668,11 +668,11 @@
              }
              # make sure it's not because it's an invalid email
              # unconfirm this user, so they're not included next time
-             if (!$throttled && !validateEmail($useremail)) {
+             //if (!$throttled && !validateEmail($useremail)) {
                logEvent("invalid email $useremail user marked unconfirmed");
                Sql_Query(sprintf('update %s set confirmed = 0 where email = "%s"',
                  $GLOBALS['tables']['user'],$useremail));
-             }
+             //}
            }
            if ($script_stage < 5) {
              $script_stage = 5; # we have actually sent one user
thisisit3
PL Nut
 
Posts: 27
Joined: 12:32pm, Thu 26 Apr, 2007

Postby itsrich » 6:13pm, Mon 10 Sep, 2007

I need a little help clarifying what thisisit3 is telling me to change.

It appears I am being directed to add // in two places.

I can edit the code, just looking for clarification of what changes to make.

Thanks in advance!
itsrich
phpList newbie
 
Posts: 1
Joined: 6:34pm, Fri 17 Aug, 2007

Postby thisisit3 » 6:23am, Tue 11 Sep, 2007

thats correct, if you comment out those two lines then failed emails will be automatically marked as unconfirmed, thus won't be retried for sending and keeping the queue "full".
thisisit3
PL Nut
 
Posts: 27
Joined: 12:32pm, Thu 26 Apr, 2007

Re: [fix] failed emails aren't removed from the queue

Postby raybman » 2:49pm, Wed 22 Sep, 2010

Thanks, I'll give it a go.
raybman
phpLister
 
Posts: 9
Joined: 5:31pm, Tue 21 Sep, 2010

Re: [fix] failed emails aren't removed from the queue

Postby mikeaja » 11:22am, Wed 03 Nov, 2010

This fix worked great so far for me. Had the same problem as the OP, and could find no way of getting to the end of the send (to view the stats).

Thanks.
mikeaja
phpLister
 
Posts: 11
Joined: 5:19pm, Sat 02 Oct, 2010

Re: [fix] failed emails aren't removed from the queue

Postby FlagKing » 1:40pm, Tue 12 Apr, 2011

That's an amazing tip!

Thanks to you Thisisit3!
FlagKing
phpList newbie
 
Posts: 2
Joined: 7:52pm, Mon 11 Apr, 2011


Return to Bug Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron