Make WordPress Core

Opened 14 months ago

Last modified 4 months ago

#62129 new enhancement

Add a Site Health test for existence of sender email address

Reported by: knutsp's profile knutsp Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Site Health Keywords: needs-copy-review 2nd-opinion
Focuses: administration Cc:

Description

On many email systems today, to accept an email, the sender email adress must exists. If not this may be the reason fo rejection:

RCPT TO:<wordpress@…>
550-Response: 550 No Such User Here"
550 Invalid sender <wordpress@…>

If not it should be a warning or recommendation to create it, as just a forwarder or full account for storing.

Related: #49687

Change History (5)

#1 @knutsp
14 months ago

  • Summary changed from Add a Site Heath test for existence of sender email address to Add a Site Health test for existence of sender email address

#2 @SirLouen
4 months ago

  • Keywords needs-copy-review 2nd-opinion added

Following the conversation here #60420

I want to summarize in this topic what is really needed:

The problem here is that by default, all emails are being sent with a From: header with an email in the form of wordpress@hostname.

This brought my mind to this report, which is not exactly the same, but the concern here was similar: Poor knowledge by the users leading to some type of trouble (in that ticket, SEO issues, in this ticket, mail delivery problems).

This can lead into two problems:

  1. The first is that users without such mailbox enabled could have multiple problems, not only with receiving emails, but with spam checks
  2. It's not widely known, and it seems that many people think that the From: email is the same as admin_email option (and many plugins are fostering this behavior.

One of the proposed behavior that seems to resonate well is adding the Site Health recommended improvements. Here an example of how it could look:

https://i.imgur.com/ixsRbwl.png

Text:

By default, WordPress sends emails from an address like wordpress@localhost. This can sometimes cause delivery issues or make emails appear less professional.r

To customize the sender email, we recommend installing a dedicated plugin or adding the filter hook wp_mail_from

Learn more about Mailing in WordPress.(opens in a new tab)

In the last part, it will be linking to this section in the WordPress Administration Handbook that will be talking about Mail (I'm taking care of this, still in progress).

#3 @SirLouen
4 months ago

#63785 was marked as a duplicate.

#4 @SirLouen
4 months ago

#59979 was marked as a duplicate.

#5 @SirLouen
4 months ago

I'm going to recap the latest comments regarding this topic:

These were the concerns of @michael.orlitzky

You're bypassing the MTA's configuration... what if it uses a relay host and the web server is blacklisted?
You have to pick a HELO name that both passes SPF and is valid for the web server.
What do you do if there's a temporary DNS error?
What do you do if you manage to connect but the connection is dropped?
What do you do if everything goes OK, but at the very end, the server sends you a 4xx mailbox full?

And these are the answeres from @knutsp

You're bypassing the MTA's configuration... what if it uses a relay host and the web server is blacklisted?

Fail.

You have to pick a HELO name that both passes SPF and is valid for the web server.

Fail.

What do you do if there's a temporary DNS error?

Temporarily undetermined result.

What do you do if you manage to connect but the connection is dropped?

Temporarily incolclusive result.

What do you do if everything goes OK, but at the very end, the server sends you a 4xx mailbox full?

Success. Not relevant.

In my view, the only problem WordPress should care about is that the From address should exist, whatever it's configured to be. The fact that this may not be reliably checked doesn't make it unusable.

This said:

  1. Having inconclusive or failed reports within the Health Check is not alien. This happens a lot with checks like the Cron results.
  2. As @knutsp suggested, the idea is just to check if the address is valid in the simplest way. We could even expand the message by some code to check if it has been changed and good to go. RCPT TO could definitely do the trick (VRFY is disabled by most servers, so I would not care about it). Also some servers send a 200 to RCPT TO regardless of the fact that the mailbox exists or not, delivering a false positive, which is the worst case scenario.

This can be documented like

Mailbox Test Results

Case success (Recommended Action)

The destination server accepted our probe to the email wordpress@localhost. But this is not a guarantee that the address exists so we recommend sending a real email to this email address and manually confirming that you are receiving it.

Case failure (Critical Action)

The destination server refused our probe to the email wordpress@localhost. Some providers intentionally block these probes, so we recommend sending a real email to this email address and manually confirming that you are receiving it.

And many other checks can take place to display a full message of what can be going on. For example, we could be checking if the email was already changed or not via filter hook. If it was never changed, we could add something like:

Be aware that by default, WordPress sends emails from wordpress@localhost. This can sometimes cause delivery issues or make emails appear less professional.
To customize the sender email, we recommend installing a dedicated plugin or adding the filter hook wp_mail_from
Learn more about Mailing in WordPress.(opens in a new tab)

If it was manually changed, we could simply dismiss all these tests , and return a full valid check like

We can confirm that you have modified the From address via hook filter. No further checks will be done in this scenario as we expect you are in control of the situation.

Currently we are discussing about the structure of the test and the copy. Be free to add anything that could be worth mentioning.

Last edited 4 months ago by SirLouen (previous) (diff)
Note: See TracTickets for help on using tickets.