Multiple addresses
-
Hi,
I use the User Submitted Posts Plugin and it works perfectly but I did not receive notification emails.
The Postman SMTP Plugin solved that problem for me when I use only 1 notification address. When I give in 2 addresses (client and administrator) no notification emails are received.
I cannot see if the cause of this is in the Postman or the USP Plugin.
USP says it is possible to give in multiple addresses divided by a comma.
I also tried with ;
Could the problem be in USP or is it really capable to handle multiple addresses?
Site: https://www.edithdezwart.nl but under construction at the time of writing this support question.
-
Yes, User Submitted Posts works with multiple email addresses. It could be that another plugin or theme script is interfering with normal functionality. You can verify by temp disabling all other plugins or setting up a test WP install running only USP.
Dear Jeff,
I am sorry to say I disagree. I tried USP with only the USP and Postman Plugins and still there was no notification of USP messages as I could see in the Postman email log.
I even tried several standard WordPress themes with the same result.
But no problem; I found a workaround in the possibility in Postman to add a CC address to every mail sent by the WordPress installation.
So again: compliments for this really complete product and thanks for support!@specialk, I agree with McCage, User Submitted Posts mangles the From address which some SMTP servers will reject.
From: WordPress <[email protected] [email protected]> Sender: [email protected] To: [email protected], [email protected] Reply-To: WordPress <[email protected] [email protected]> Subject: WordPress: New user-submitted post!
As you can see, the From and Reply-To headers are no longer valid when multiple recipients are configured in User Submitted Posts.
Here are the original wp_mail parameters from USP:
[18-Jul-2015 14:20:17 UTC] DEBUG PostmanMessage: Processing other Header - MIME-Version: 1.0 [18-Jul-2015 14:20:17 UTC] DEBUG PostmanMessage: Processing From Header - From: WordPress <[email protected], [email protected]> [18-Jul-2015 14:20:17 UTC] DEBUG PostmanMessage: Processing Reply-To Header - Reply-To: WordPress <[email protected], [email protected]> [18-Jul-2015 14:20:17 UTC] DEBUG PostmanMessage: Processing Return-Path Header - Return-Path: [email protected], [email protected] [18-Jul-2015 14:20:17 UTC] WARN PostmanMessage: Ignoring Return-Path header '[email protected], [email protected]' [18-Jul-2015 14:20:17 UTC] DEBUG PostmanMessage: Processing Content-Type Header - Content-Type: text/plain; charset="UTF-8" [18-Jul-2015 14:20:17 UTC] DEBUG PostmanMessage: User added recipient: "[email protected]" [18-Jul-2015 14:20:17 UTC] DEBUG PostmanMessage: User added recipient: "[email protected]"
The problem with USP is here:
$headers .= "From: $blog <$to>\n"; $headers .= "Reply-To: $blog <$to>\n";
Jason, do you have any recommendations for more correct mail headers? I’m not an expert in email stuff – just know what works on my own server, which has no problems with the headers sent by USP. If you want to suggest an improvement, I would be glad to check it out and implement. Thanks.
1. You can have only one address in a From header. Change
From: WordPress <[email protected], [email protected]>
to
From: WordPress <[email protected]>
2. Since your Reply-To header is the same as the from header, there is no need to set it.
3. Since your Content-Type is plain, you shouldn’t be setting the MIME-Version header.
4. Setting the Return-Path header is an RFC violation, don’t set it.
Sweet thanks. Will try to verify these suggestions and implement next update. Cheers.
Hey Jason,
I’ve been looking further into this, but cannot locate where in the RFC it says that setting the Return-Path header is a violation.
Do you have some reference to official documentation?
https://stackoverflow.com/a/1782730
https://www.ietf.org/rfc/rfc2821.txt
https://tools.ietf.org/html/rfc5321Page 58 of 5321
A message-originating SMTP system SHOULD NOT send a message that already contains a Return-path header field. SMTP servers performing a relay function MUST NOT inspect the message data, and especially not to the extent needed to determine if Return-path header fields are present. SMTP servers making final delivery MAY remove Return- path header fields before adding their own.
I’ve seen a case where a mail server actually rejected a message with a return-path instead of just removing the header. Probably because return-path back scatter is a form of Spam.
Both my SMTP plugin, and more recent versions of PHPMailer, strip the Return-Path header.
Okay, that makes sense, but it raises some questions/concerns:
1) Is all mail sent via PHP considered SMTP?
2) In my tests, the return-path header often specifies an email address that doesn’t exist
3) The return-path header for many sites includes the server admin username, for example, [email protected]
I’ve already removed the return-path header from all of my plugins, and would appreciate any input/advice you could offer for these points. Thank you.
Is all mail sent via PHP considered SMTP?
All mail is SMTP. SMTP is the protocol for sending mail on the Internet like HTTP is the protocol for web pages.
PHP mail(), as I understand it, is just a wrapper for sendmail, and sendmail is a primitive TCP app for sending a message to an SMTP server on localhost/port 25.
In my tests, the return-path header often specifies an email address that doesn’t exist
Like the RFC says, the return-path header will always be set to the address in the MAIL FROM command. Open relays won’t validate what this value is, in which case it certainly may not exist. Other relays, like smtp.gmail.com, require the MAIL FROM to be a valid Gmail email address.
If the final SMTP system can not make delivery, a bounce message is returned to the Return-Path address, this is why the Wikipedia article calls the MAIL FROM the bounce address.
The return-path header for many WP sites includes the admin username, for example, [email protected]
Because the message had this header:
From: [email protected]
I wrote an article that might help:
Contact Form emails won’t send with my Visitor’s Email AddressCheers! ??
Great stuff, thanks. Some follow ups:
“The return-path on a received email will always be the address in the original MAIL FROM command.”
So how to set the MAIL FROM command? Because as mentioned before, I am sending email alerts and setting the From header as [email protected]. This is verified in the received message source. Even so, the Return-Path header specifies a completely different email, namely one that consists of the server admin username and the domain name, for example:
That is, your last point is incorrect (in general).
It depends on the software doing the sending. If you are using Postman, what you are seeing is expected because the user account ([email protected]) is used in the MAIL FROM regardless of what is set in the Message ([email protected]).
Example:
220 mailtrap.io ESMTP ready EHLO localhost 235 2.0.0 OK MAIL FROM:<[email protected]> 250 2.1.0 Ok RCPT TO:<[email protected]> 250 2.1.0 Ok DATA 354 Go ahead From: john <[email protected]> To: [email protected] Subject: Postman SMTP Test (hendriks.ca) Date: Thu, 12 Nov 2015 04:00:16 +0000 . 250 2.0.0 Ok: queued
In the above example web is the account owner. john is the sender. jane is the recipient. the message will arrive with web as the return-path.
Google, for example, would eat the message if I tried to use a MAIL FROM that did not match the email I authenticated with. This is to prevent Spoofing. That’s why if you software uses the From header for your MAIL FROM, and you don’t own the From header, your email just vanishes.
So how to set the MAIL FROM command?
Only the software actually talking to the SMTP server can do this. For WordPress, that means it is the responsibility of the SMTP plugin. The plugin composing the message can not set it, nor should it, since it does not know the account details.
Okay that makes sense, thanks.
So as far as my question is concerned, basically you’re saying that using only PHP mail() it is not possible to set the Return-Path header, and that in order to do so an entire SMTP library must be used, correct? (like SwiftMailer or similar)
Yes.
PHP mail() was made for a world without email threats like Spam and Phishing. It’s great for jason@localhost to jeff@localhost.
It supports none of the technologies for combatting Internet email threats: SMTPS, STARTTLS, SASL, SPF, DKIM, DMARC.
PHPMail is the SMTP library that ships with WordPress. But out-of-the-box it is in “PHP mail()” mode. wordpress/wp-includes/class-phpmailer.php, line 162.
i’m putting this thread in my ‘favourites’ now ??
- The topic ‘Multiple addresses’ is closed to new replies.