Ticket #11988 (assigned defect (bug))

Opened 2 years ago

Last modified 6 weeks ago

VERP does not work

Reported by: vladimir_kolesnikov Owned by: westi
Priority: normal Milestone: Future Release
Component: Mail Version: 3.0
Severity: normal Keywords: has-patch
Cc: vladimir@…

Description

Suppose that we have a custom hook for "phpmailer_init" action which enables VERP support:

function phpmailer_init($phpmailer)
{
    $phpmailer->IsSMTP();
    if (!$phpmailer->smtp) {
        $phpmailer->smtp = new SMTP();
    }

    $phpmailer->smtp->do_verp = true;
}

But VERP support (in wp-includes/class-smtp.php) is a bit buggy: here's the transcript the session:

 Out: 220 example.com ESMTP Postfix
 In:  EHLO example.com
 Out: 250-example.com
 Out: 250-PIPELINING
 Out: 250-SIZE 10240000
 Out: 250-ETRN
 Out: 250-XVERP
 Out: 250-ENHANCEDSTATUSCODES
 Out: 250-8BITMIME
 Out: 250 DSN
 In:  MAIL FROM:<mailer@example.com>XVERP
 Out: 501 5.1.7 Bad sender address syntax
 In:  RSET
 Out: 250 2.0.0 Ok

You can see that the server (Postfix) supports VERP (250-XVERP) but the MAIL FROM line is malformed - it lacks space character between ">" and "XVERP":

220 example.com ESMTP Postfix (Ubuntu)
EHLO example.com
250-example.com
250-PIPELINING
250-SIZE 10240000
250-ETRN
250-XVERP
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
MAIL FROM:<mailer@example.com> XVERP
250 2.1.0 Ok
RSET
250 2.0.0 Ok
QUIT
221 2.0.0 Bye

You can see that the space character solves the problem.

Attachments

class-smtp.php.diff Download (463 bytes) - added by vladimir_kolesnikov 2 years ago.

Change History

A typo: should be

function phpmailer_init(&$phpmailer)

instead of

function phpmailer_init($phpmailer)

in the example.

  • Cc vladimir@… added

This is an external, so this should be reported upstream. Is class-smtp current?

  • Milestone changed from Unassigned to Future Release

"Upstream" for PHPMailer for PHP 4 is WordPress :) If we do not fix this, there is no fix.

  • Owner set to westi
  • Status changed from new to assigned

We need to open a new upstream ticket for this in  http://code.google.com/a/apache-extras.org/p/phpmailer/issues/list

Note: See TracTickets for help on using tickets.