Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Sir Osis of Liver on April 26, 2023, 01:27:46 PM

Title: Notification emails fail
Post by: Sir Osis of Liver on April 26, 2023, 01:27:46 PM
Just fixed this on one forum, and am seeing it on another.  2.0.19 email notifications fail in php 7.4, work in 8.0.  Can anyone confirm?
Title: Re: Notification emails fail
Post by: shawnb61 on April 26, 2023, 10:06:53 PM
I can confirm that the following work fine in 2.0.19 for notification delivery:
SMTP mail type, PHP 7.4 - OK
SMTP mail type, PHP 8.0 - OK
PHP mail type, PHP 7.4 - OK

I believe there is an issue with PHP type, php8+, in 2.0.x. 

I do suggest using SMTP going forward under all circumstances.  I can confirm that more & more mail providers are rejecting the PHP mail type outright.  I ran into that on my own site recently, IIRC, it was outlook.com & hotmail.com that mangled mail sent by the PHP mail type, no matter what PHP or SMF version.  Only SMTP worked.  I believe this is a recent change.


Source: https://help.krystal.uk/mail-channels/what-is-php-mail-and-how-does-it-differ-to-smtp
QuoteWhile PHP mail is a great tool and is easy to use, it should not be used for production environments and certainly not where email deliverability is important (for example, order emails.) as PHP mail has a habit of ending up in Junk Spam Folders due to the unauthenticated nature of the message.
Title: Re: Notification emails fail
Post by: Sir Osis of Liver on April 26, 2023, 10:12:58 PM
Odd thing is, can't replicate this on test install.  My install and client forum are both using php mail, running on different Crocweb servers.  Only difference I see is mysql version.

Cient -
Version Information:
Forum version: SMF 2.0.19 (more detailed)
Current SMF version: SMF 2.0.19
GD version: 2.3.3
Database Server: MariaDB
MySQL version: 10.3.38-MariaDB-cll-lve
PHP: 8.0.28
Server version: LiteSpeed


Test install -
Version Information:
Forum version: SMF 2.0.19 (more detailed)
Current SMF version: SMF 2.1.3
GD version: 2.3.3
Database Server: MariaDB
MySQL version: 10.6.12-MariaDB-cll-lve
PHP: 8.0.28
Server version: LiteSpeed

Client forum is now sending notification emails.

Title: Re: Notification emails fail
Post by: Sesquipedalian on April 27, 2023, 12:32:13 AM
If you don't have SPF, DKIM, and DMARC fully configured, email delivery is a crap shoot. Emails from the test install might not (yet) be getting dropped simply because it is new and hasn't gotten onto anyone's naughty list yet.
Title: Re: Notification emails fail
Post by: shawnb61 on April 27, 2023, 01:42:54 AM
Quote from: Sesquipedalian on April 27, 2023, 12:32:13 AMIf you don't have SPF, DKIM, and DMARC fully configured, email delivery is a crap shoot. Emails from the test install might not (yet) be getting dropped simply because it is new and hasn't gotten onto anyone's naughty list yet.

Yep.  It may help to send an email, and once received, and inspect it in its raw format.  In gmail, there is an option to 'Show Original'.   In other email packages, it is often 'View raw format'.  Look for authentication results.

Good news looks something like this (format varies per email client):
email_auth_pass.png

Bad news looks something like this (format varies per email client):
email_auth_fail.png

Title: Re: Notification emails fail
Post by: Aleksi "Lex" Kilpinen on April 27, 2023, 04:44:34 AM
Gmail web version also includes an easy tool just for this alone.
If you choose "Show original", it will also show the checked headers first.

Then good news looks like this.
Title: Re: Notification emails fail
Post by: Sir Osis of Liver on April 27, 2023, 05:03:09 PM
I would guess most forums are using php mail, it's default in 2.0/2.1, doesn't require any setup.
Title: Re: Notification emails fail
Post by: Aleksi "Lex" Kilpinen on April 27, 2023, 05:14:00 PM
Sadly there's quite literally nothing we can do about that. Some hosts will allow you to configure the server to intercept php mail and "fix it" to match the actual mailserver settings, but this too requires configuration from the user.
Title: Re: Notification emails fail
Post by: Sir Osis of Liver on April 27, 2023, 07:34:01 PM
Well, updating from php 7.4 to 8.0 fixed it on one forum, so it's not an issue with the mail settings.  I'm trying to get the other forum updated from 7.4 to 8.0, but can't get into cpanel (GoDaddy :P ) and the owner's been offline.  Will be interesting to see if it works on a second server, different host.
Title: Re: Notification emails fail
Post by: shawnb61 on April 27, 2023, 08:39:28 PM
Question - where php8 is working with email type php, is the os windows or Unix?

(The php8 issue is specific to unix.)
Title: Re: Notification emails fail
Post by: Sir Osis of Liver on April 27, 2023, 11:42:00 PM
Quote from: Sir Osis of Liver on April 26, 2023, 10:12:58 PMCient -
Version Information:
Forum version: SMF 2.0.19 (more detailed)
Current SMF version: SMF 2.0.19
GD version: 2.3.3
Database Server: MariaDB
MySQL version: 10.3.38-MariaDB-cll-lve
PHP: 8.0.28
Server version: LiteSpeed


Test install -
Version Information:
Forum version: SMF 2.0.19 (more detailed)
Current SMF version: SMF 2.1.3
GD version: 2.3.3
Database Server: MariaDB
MySQL version: 10.6.12-MariaDB-cll-lve
PHP: 8.0.28
Server version: LiteSpeed


Both using php mail, on same host different servers, iirc LiteSpeed is linux, accessing both forums with FF102 in Win8.1.  If I revert client forum to php 7.4 notifications fail.  Other members also do not receive notifications.  Client forum is clean install with 5 mods installed, logging only a few user errors.  Will try installing same mods on test install when I'm back on computer tomorrow.

Title: Re: Notification emails fail
Post by: Aleksi "Lex" Kilpinen on April 28, 2023, 01:32:57 AM
Quote from: Sir Osis of Liver on April 27, 2023, 07:34:01 PMWell, updating from php 7.4 to 8.0 fixed it on one forum, so it's not an issue with the mail settings.
Correlation does not imply causation. I'm not saying you are wrong, but I'm saying that you can not know that for sure without further details. It could just be that the php versions on that particular host machine are configured differently by default.