Jason Hendriks
Forum Replies Created
-
As you know, the WP administrator can specify *any* email address for that setting, so would there be a problem if the email is not from the same domain?
Yes, it would be a problem if the mail server did not approve of this address as the From address. While it’s good to be aware of it, that’s not your problem. The user should set the address correctly. You can’t be expected to know what the correct address is.
From my understanding thus far, the From header must match the domain
No, not at all. The rule is the email must have originated from the SMTP server denoted in the SPF record of the From email’s domain.
So the domain can be mywidgets.com and the WP admin can be jeff@gmail.com, if an SMTP plugin is installed that sends via smtp.gmail.com
The WP admin can be jeff@myotherdomain.com, if the SPF record of myotherdomain.com authorizes mywidgets.com to send email.
And the WP admin can be jeff@mywidgets.com, again, if the SPF record of mywidgets.com authorizes A or MX to send email.
For example hendriks.ca:
hendriks.ca. 3599 IN MX 1 ASPMX.L.GOOGLE.COM. hendriks.ca. 3599 IN TXT "v=spf1 include:_spf.google.com -all".. is a Google account and authorizes smtp.gmail.com to send e-mail on its behalf.
wordpress.com:
wordpress.com. 12628 IN MX 0 mail.automattic.com. wordpress.com. 3542 IN TXT "v=spf1 include:_spf.automattic.com ~all".. is an automattic account and authorizes automattic.com to send e-mail on its behalf.
whitehouse.gov:
whitehouse.gov. 526 IN MX 105 mail1.eop.gov. whitehouse.gov. 10153 IN TXT "v=spf1 +mx ~all".. is an eop.gov account and authorizes it’s localhost to send mail on it’s behalf.
Forum: Plugins
In reply to: [Postman SMTP Mailer/Email Log] Undefined offset errorPHP 5? Like 5.0? That might explain it.
So yeah that makes sense, because wp_mail() is using PHPMailer, correct?
By default ya. There are a bunch of plugins that modify PHPMailer to use SMTP directly: WP Mail SMTP, WP SMTP, Easy WP SMTP, Mail Bank. They all pretty much copy each other.
Then there are a bunch of plugins that bring their own implementations:
- Postman: Zend_Mail / Gmail API / Mandrill API / SendGrid API
- Cimy SWIFT: Swift Mailer
- wpMandrill: Mandrill API
- SendGrid: SendGrid API
Would that be optimal, or can you suggest any improvements?
No that’s perfect!
Forum: Plugins
In reply to: [Postman SMTP Mailer/Email Log] Undefined offset errorreturn @round ( $size / pow ( 1024, ($i = floor ( log ( $size, 1024 ) )) ), 2 ) . ' ' . $unit [$i];What the heck?? Your memory size must be less than zero!? Could you please tell me your operating system and PHP brand/version.
So strange. I can reproduce it by setting size to 0 or less than 0. I will check for < 0 before calling this function. That should fix it.
Thanks so much for bring this to my attention π
Forum: Plugins
In reply to: [Postman SMTP Mailer/Email Log] disable loggingSettings > Postman SMTP > Show all Settings > Logging > Enable Logging > No
π Thank you for using!
My pleasure, sir! π
Well as we discovered back in August, you’re already using the wp_mail function (not PHP mail) to delegate e-mail to either WordPress, or a purpose-built plugin like Postman. Why not stick with that?
Then you don’t have worry about blocked ports, Gmail API, Mandrill API, SendGrid API, OAuth 2.0, all that stuff!
In my experience, all the Contact Forms available for WordPress set the visitor’s email address as the From header. With the intention that the email shows up in your inbox “from” the visitor.
But services like Hotmail/Gmail/Yahoo discourage this behaviour and re-write the From header to be the email address of the account holder. So the visitor’s email address is lost. In this case setting the Reply-To address is a must.
But this seems to contradict what you say elsewhere (from previously in this forum thread):
You are absolutely right. And I will clarify that statement to say if the From address is your own email address, there is no need to set it.
Is it safe to say that it’s always a good idea to set the Reply-To header?
Yes* π
*Easy WP SMTP fails if you set a reply-to address. But that’s just their bug and shouldn’t change what you do.
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 π
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.
It depends on the software doing the sending. If you are using Postman, what you are seeing is expected because the user account (adminusername@domainname.tld) is used in the MAIL FROM regardless of what is set in the Message (email@example.com).
Example:
220 mailtrap.io ESMTP ready EHLO localhost 235 2.0.0 OK MAIL FROM:<web@hendriks.ca> 250 2.1.0 Ok RCPT TO:<jane@hendriks.ca> 250 2.1.0 Ok DATA 354 Go ahead From: john <john@hendriks.ca> To: jane@hendriks.ca Subject: Postman SMTP Test (hendriks.ca) Date: Thu, 12 Nov 2015 04:00:16 +0000 . 250 2.0.0 Ok: queuedIn 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.
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, adminusername@example.com
Because the message had this header:
From: adminusername@example.com
I wrote an article that might help:
Contact Form emails wonβt send with my Visitorβs Email AddressCheers! π
http://stackoverflow.com/a/1782730
http://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.
does the noreply Mail box need to be a real mailbox for it to work?
According to Google, yes.
my emails were failing to send it, however I didn’t do the new client id part. Is that cause?
Yes.
would you still consider using a email address that users Reply to even though all they are receiving is there username and password for my site?
You want your users to be able to reach you on any email you send them. If someone is using a fake email address to annoy someone via your site, they should be able to respond to you.
Forum: Plugins
In reply to: [Contact Form 7] Contact Form 7 ErrorHi, the thing is this was working for about a year and only recently started.
I’ll bet that’s because Google recently changed the security setting on your account.
I’ve tried playing with the from email address, and otherwise gone through the list.
You’re just guessing at solutions when you don’t even know the problem. The Email Log in Postman will tell you definitively what’s wrong.
I’ve also spoken with the host and they tell me it’s an issue with the plugin
You don’t work in IT, do you? If you did, you would know system admin and network support never know why something breaks and their answer is almost always “reboot it” or “its your fault” π You can ignore them. You will find your answer here.
Cheers,
Jason π