You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Deferred (queued) emails are never sent; they are re-queued forever #424
Found on the dev-6.0.0 branch (local, at 9bd3a1e0) during the lib/ cleanup. It may be on master too: the same code is there.
With mail_defer on, w2p_Utilities_Mail::Send() queues the message, but the queue never delivers it.
QueueMail() (classes/w2p/Utilities/Mail.class.php L352) stores get_object_vars($this), which includes defer = 1.
SendQueuedMail() (L362) copies those values back onto a new object and calls $this->Send(). Because defer is still set, Send() calls QueueMail() again instead of sending.
The queue scanner sees a successful callback, deletes the old entry, and the new copy waits for the next run. The mail is never sent and the queue never empties.
SendQueuedMail() also reads $this->transport, which is never defined (warning on every run). The restored Mailer value already holds the transport.
Reproduced with SMTP to a local sink: immediate mail arrives, queued mail never does, and event_queue always holds one w2p_Utilities_Mail::SendQueuedMail row.
Fix: in SendQueuedMail(), set $this->defer = false before calling Send(), and drop the $this->transport line (or base it on $this->Mailer).
Activity
Mail: send queued mail instead of queueing it again; fix Cc/Bcc