Skip to content

Deferred (queued) emails are never sent; they are re-queued forever #424

Closed

Description

@caseysoftware

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

  1. added
    php
    on Oct 21, 2026
  2. added a commit that references this issue on Oct 21, 2026
    3c6ebcf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    php

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions