WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#8800 closed defect (bug) (invalid)

Mail notification problem (comments)

Reported by: joukahainen Owned by:
Milestone: Priority: low
Severity: minor Version: 2.7
Component: Mail Keywords: reporter-feedback dev-feedback
Focuses: Cc:

Description

When Wordpress 2.7 sends email about new comments for some reason the sender address contains brackets, for example :

MAIL FROM :<WordPress <wordpress@…>>

In my environment (Mercury mail in same server) this causes mail to be rejected by Mercury with "sender address is invalid notification" if the sender is considered local.

For temporary workaround i did change pluggable.php in wp-includes folder so that the sender address is considered non-local :

Set the from name and email

$phpmailer->From = apply_filters(

'wp_mail_from','@…');

But this is offcourse an temporary workaround.

I m not 100% sure that this is a WordPress issue, but it strongly seems to have something to do with the way WP is using php to send mail.

Change History (15)

comment:1 DD325 years ago

  • Keywords reporter-feedback added; invalid sender address removed

are you complaining about the angle brackets in "WordPress <wordpress@mydomain.net>" or the outer brackets in "MAIL FROM :<WordPress <wordpress@mydomain.net>>}"?

The first is perfectly valid syntax, 'Sender-Name <email@address>', the 2nd, Appears to just be the mail servers logging format to me.. It could be that your mail server expects the Sender Name to be enclosed in quotation marks though: ""WordPress" <wordpress@mydomain.net>" maybe, Feel like changing your filter to add the quotation marks and see if that fixes it?

comment:2 joukahainen5 years ago

Hi

Tried with quotation marks, results follow (first Mercury core module log):

Tue 06, 9:34:51: Job MG000057: sender address ' <wordpress@…' is invalid

Tue 06, 9:34:51: Job MG000057: Processing failed deliveries and generating notifications

Tue 06, 9:35:02: Job MG000059: from <> (local)

  • Recipient <"\"WordPress\"" <wordpress@… unknown

Tue 06, 9:35:02: Job MG000058: from postmaster@… (local).

Then SMTP server log :

09:34:44.059: Connection from 127.0.0.1, Tue Jan 06 09:34:44 2009<lf>

09:34:44.059: << 220 server.mydomain.net ESMTP server ready.<cr><lf>

09:34:44.059: >> HELO SERVER<cr><lf>

09:34:44.075: << 250 server.mydomain.net Hello, SERVER.<cr><lf>

09:34:44.075: >> MAIL FROM:<"\"WordPress\"" <wordpress@…>><cr><lf>

09:34:44.075: << 250 Sender OK - send RCPTs.<cr><lf>

09:34:44.075: >> RCPT TO:<joukahainen@…><cr><lf>

09:34:44.075: << 250 Recipient OK - send RCPT or DATA.<cr><lf>

09:34:50.330: >> DATA<cr><lf>

There seems to be similiar case in Mercury mail forums (the person replying to this suggests something wrong with sending script),

http://community.pmail.com/forums/thread/13279.aspx

But if this has not been seen in other environments this might be a problem in Mercury mail, not wordpress.

comment:3 mrmist5 years ago

The SMTP part of the log seems to disagree with the core module part. I presume the core module deals with local delivery after mail has been accepted by SMTP?

Note that the SMTP part accepts the mail with no issues, only the local transport is moaning. WordPress can't do much about that. The address form is valid as you can see because the SMTP transport accepts it.

comment:4 joukahainen5 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Yes, the core module handles the mail after smtp. This is beginning to look more like an Mercury mail issue. I'll contact them about this. Thanks.

comment:5 joukahainen5 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

Hi again

Mercury support replied :

"It's a WordPress problem.

When Wordpress 2.7 sends email about new comments for some reason the
sender address contains brackets, for example :

MAIL FROM :<WordPress <wordpress@…>>

According to the RFC 2821 the MAIL FROM address is a simple e-mail address in brackets. This one contains the personal name and is also enclosed in brackets.

This should be

MAIL FROM: <wordpress@…>"

comment:6 mrmist5 years ago

  • Keywords reporter-feedback removed

The mail gets sent using PHPMailer. Wordpress does not put any invalid angle brackets into the address, which suggests that if brackets are being used invalidly, then it's a bug within PHPMailer.

comment:7 ryan5 years ago

  • Component changed from General to Mail

comment:8 Nicholas915 years ago

  • Cc dragos.nicholas@… added
  • Keywords dev-feedback added

comment:9 Denis-de-Bernardy5 years ago

  • Keywords reporter-feedback added

any chances that switching to 2.0.4 fixes the issue?

http://sourceforge.net/project/showfiles.php?group_id=26031&package_id=17494

comment:10 Denis-de-Bernardy5 years ago

Supposedly not:

ChangeLog

Version 2.0.4 (April 02 2009)
* fixed == in class.smtp.php
- NOTE: this is it folks, our last PHPMailer to support PHP4

Version 2.0.3 (November 08 2008)
* fixed line 1041 in class.smtp.php (endless loop from missing = sign)
* fixed duplicate images in email body
* removed English language from language files and made it a default within
  class.phpmailer.php - if no language is found, it will default to use
  the english language translation
* corrected $basedir to $directory
* changed default of $LE to "\r\n" to comply with RFC 2822. Can be set by the user
  if default is not acceptable
* removed trim() from return results in EncodeQP
* changed $this->AltBody = $textMsg; to $this->AltBody = html_entity_decode($textMsg);
* We have removed the /phpdoc from the downloads. All documentation is now on
  the http://phpmailer.codeworxtech.com website.

comment:12 hakre5 years ago

Checked with my patch from #9697 and did not change a thing. Wanted to test the patch on windows and choosed mercury as relaying smtp and then run into this error here :/. I think it would be better to change the SMTP Agent from mercury to something else. I'm digging.

comment:13 hakre5 years ago

Looks like this is a Bug in Mercury, the Output of the PHP Mailer Class Headers looks ok to me:

Date: Sat, 2 May 2009 15:16:11 +0200
Return-Path: wordpress@192.168.2.106
From: WordPress <wordpress@192.168.2.106>
Message-ID: <e7c561b481ee3a787817dc021ebdc4d9@192.168.2.106>
X-Priority: 3
X-Mailer: PHPMailer (phpmailer.sourceforge.net) [version 2.0.2]
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="UTF-8"

So nothing to fix on the PHPMailer Side with this Issue. Mercury Transport looks not-working here. I can not say wether because of misconfiguration or of having bugs.

comment:14 hakre5 years ago

I could help myself in using a sendmail replacement for that windows testing system:

http://digiex.net/guides-tutorials/544-configuring-php-under-windows-use-gmail-external-smtp-server-ssl.html

this tutorial provides more informatin on how to get to run. the sendmail replacement has a small filesize and is easy to configure. the good thing is, you do not need to run a daemon on your system to send out testmails.

comment:15 Denis-de-Bernardy5 years ago

  • Milestone 2.8 deleted
  • Resolution set to invalid
  • Status changed from reopened to closed

closing as invalid based on hakre's remarks.

Note: See TracTickets for help on using tickets.