Dev4Press No Script
Back to GD Mail Queue (Lite) Forum

Failed validation of email address makes it impossible to empty the queue

Published on: April 27, 2021 at 1:14 pm · By: bindzus

Tags:

Author
Topic
#65810

We had a problem with the mail queue, which made it impossible to empty the queue. When running the cronjob manually from the console we realized that the problem happened in “/wp-includes/PHPMailer/PHPMailer.php” line 1144 of WordPress 5.5.3.

  if (!static::validateAddress($address)) {
    $error_message = sprintf(
      '%s (%s): %s',
      $this->lang('invalid_address'),
      $kind,
      $address
    );
    $this->setError($error_message);
    $this->edebug($error_message);
    if ($this->exceptions) {
      throw new Exception($error_message); // Line 1144
    }

    return false;
  }

The email address came from a spam attack on an unprotected form and the email looked something like “ab.us.e.in<<some more dots and text that I can’t remember>>@gmail.com” and every time the plugin attempted to send the queued email it failed at this email address and the queue was never emptied.

Since such an email address could also be entered by a real user either by accident or perhaps that is their email address, then it would block the entire queue forever.

Could you catch this exception thrown and report it as an error sending instead? The only workaround we could think of was to temporarily comment out line 1144 in the production code to allow all emails to be sent without the validation of the email address. Afterwards we re-added line 1144 and the queue is now empty and everything is back to running normally.

Viewing 1 replies (of 1 total)
Author
Replies
  • #65812

    Thanks for reporting this. I will check this out, and add some way to handle it.

    Regards,
    Milan

    Dev4Press - Premium plugins for WordPress.

    1 user thanked author for this post.
Viewing 1 replies (of 1 total)
  • The topic ‘Failed validation of email address makes it impossible to empty the queue’ is closed to new replies.