Emails are not reliably sent (Technics)

by Auge ⌂, Wednesday, October 28, 2020, 12:47 (1069 days ago) @ mkjjj


We have an issue for a long time that I don't know to fix (mfl version 2.4.24. server runs PHP 7.4). Some emails are just not sent (Or rejected by some providers?). For example, we have severe problems with GMAIL and GMX. Personal domain emails, on the other hand, work fine. So, I'm pretty sure it is not exactly a mlf issue.

That seems to be the case.

One strange thing: We have always 3 sender addresses in the email header. Two are generic server addresses like forum@fh6f56h4.server.com. The last is the correct forum email.

The first two addresses will be added by your service provider. The script serves only one sender address with the e-mail, the one you provided as the forums own e-mail-address in the forum settings.

Can I somehow log the emails sent by mlf? This would make troubleshooting easier.

No, you can't. In the current state the forum script uses the PHP-function mail that, different as the name implies, does not send an e-mail by itself. The function delivers the e-mail only to the mail relay, that is configured on the webserver machine. This mail relay accepts the e-mail and will send it to the recipient(s). As return value of the function mail you get a boolean state (true or false) that tells you, if the delivering to the mail relay was successful but not, if the e-mail was successfully delivered to the recipient(s).

A quote from the PHP-documentation for mail:

"Returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise.

It is important to note that just because the mail was accepted for delivery, it does NOT mean the mail will actually reach the intended destination."

Because of that, the forum script does not know anything about the sending state, successfully delivery or, what seems to be part of your problem, about changes to the message, made by the mail relay.

Can I somehow change the settings so, that only the standard forum email is included in the header?

No, you can't. The additional addesses get added later, outside the influence of the forum script.

Any ideas would be very much appreciated.

You can test the latest beta version for 2.5, currently version There you can specify to use a SMTP-function for sending the e-mails. That way the script avoids the use of mail with it's indirect e-mail handling. But you have to cofigure some new features (including the SMTP-feature) currently in config files and by hand (as stated in the release notes) and not in the settings. If you are willing to give it a try in a testing installation, ask here for help. There are a few installations of the upcoming 2.5-branch. Micha as a team member runs a beta version since months and did not report any severe problems.

Tschö, Auge

Trenne niemals Müll, denn er hat nur eine Silbe!

Complete thread:

 RSS Feed of thread