Emails are not reliably sent (Technics)

by mkjjj, Wednesday, October 28, 2020, 10:54 (1247 days ago)

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.

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.

Can I somehow log the emails sent by mlf? This would make troubleshooting easier. Can I somehow change the settings so, that only the standard forum email is included in the header?

mlf runs on good quality shared hosting (all-inkl.) I assume no serious issues there.

Any ideas would be very much appreciated.

Avatar

Emails are not reliably sent

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

Hello

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 2.4.99.3. 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!

Emails are not reliably sent

by mkjjj, Wednesday, October 28, 2020, 12:59 (1247 days ago) @ Auge

Thanks for taking so much time for the reply. Will check out the 2.5 beta. SMTP is something I've hoped for. Will update this post after some testing.

Thanks again,

Mike

Emails are not reliably sent

by mkjjj, Wednesday, October 28, 2020, 13:27 (1247 days ago) @ mkjjj

I've just found something interesting while checking the email header.

It reads like this:

From: Text@dd39012.kasserver.com, Forum@dd39012.kasserver.com,
nicht =?UTF-8?Q?=C3=B6ffentlich=2C=20nur=20f=C3=BCr=20Mitg?= =?UTF-8?Q?lieder?= <Forum <info@domain.de>>

However, the email in the settings reads:

Forum <info@domain.de>

The title of the Forum is set to:

Forum, nicht öffentlich, nur für Mitglieder

After changing this to just "Forum" it seems to work.

What am I missing here?

Avatar

Emails are not reliably sent

by Auge ⌂, Wednesday, October 28, 2020, 14:27 (1247 days ago) @ mkjjj

I've just found something interesting while checking the email header.

It reads like this:

From: Text@dd39012.kasserver.com, Forum@dd39012.kasserver.com,
nicht =?UTF-8?Q?=C3=B6ffentlich=2C=20nur=20f=C3=BCr=20Mitg?= =?UTF-8?Q?lieder?= <Forum <info@domain.de>>

However, the email in the settings reads:

Forum <info@domain.de>

Why this? The settings should only contain the e-mail-address in itself, not a text like Forum <mail@example.com>. The forum script does the stitching of the forum name and e-mail-address by itself.

The title of the Forum is set to:

Forum, nicht öffentlich, nur für Mitglieder

After changing this to just "Forum" it seems to work.

What am I missing here?

The questionable setting above led to an invalid From-header. The header field From contains a comma separated list of e-mail-adresses (From: info@example.com) or mailboxes (Forum <info@example.com>). Your forum name stands alone for itself and breaks the necessary format. It must be: Forum <info@example.com>, but is (according to your posting): Forum name <Forum <info@example.com>>.

That's documented in your own example. We will inspect it from outer to inner side. The next code block contains the whole content of the From-header. The first two addresses got added after delivering the e-mail with the function mail to the mail relay of your provider.


Text@dd39012.kasserver.com, Forum@dd39012.kasserver.com, nicht =?UTF-8?Q?=C3=B6ffentlich=2C=20nur=20f=C3=BCr=20Mitg?= =?UTF-8?Q?lieder?= <Forum <info@domain.de>>

If we remove the two addresses that got added by the mail relay (these are technically valid entries) we will get the following.


nicht =?UTF-8?Q?=C3=B6ffentlich=2C=20nur=20f=C3=BCr=20Mitg?= =?UTF-8?Q?lieder?= <Forum <info@domain.de>>

The first part is the Name of your forum, encoded to be transported in UTF-8 followed by the generated output with your broken setting.

Only the forum name:


nicht =?UTF-8?Q?=C3=B6ffentlich=2C=20nur=20f=C3=BCr=20Mitg?= =?UTF-8?Q?lieder?=

Now to the broken part of the sender mailbox.

The name (set by the forum script and shown above) is followed by the wrong setting for the e-mail-address of the forum. The outer brackets got added in the function my_mail, the inner brackets was added to the wrong formatted setting of the address by you.


<Forum <info@domain.de>>

With a clean setting for the forum e-mail-address (info@domain.de, not Forum <info@domain.de>) the mailbox entry would look like this:


nicht =?UTF-8?Q?=C3=B6ffentlich=2C=20nur=20f=C3=BCr=20Mitg?= =?UTF-8?Q?lieder?= <info@domain.de>

Going back to

After changing this to just "Forum" it seems to work.

This is a second possible problem. The (old, long) name contains commata. Commata separates the entries in the From-header, so the From-header contains the following sender entries (not encoded):

- Text@dd39012.kasserver.com
- Forum@dd39012.kasserver.com
- Forum
- nicht öffentlich
- nur für Mitglieder <Forum <info@domain.de>>

The senders Forum and nicht öffentlich are invalid, the last entry nur für Mitglieder <Forum <info@domain.de>> anyway. I would expect the forum name to be safe because of its encoding. But it not seems to be so.

Please try sending e-mails with a forum name with more than one word but without commata and a corrected setting of the forums own e-mail-address (only the address in itself).

Tchö, Auge

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

Emails are not reliably sent

by mkjjj, Wednesday, October 28, 2020, 14:44 (1247 days ago) @ Auge

It works fine with more than one word but without comma. No big deal. Might be a good idea to add a hint. The problem was that the email address looks just fine in the email client. You have to inspect the header to see what's going on.

Thanks, Mike

Avatar

Emails are not reliably sent, a further notice

by Auge ⌂, Wednesday, October 28, 2020, 14:57 (1247 days ago) @ mkjjj

Hello

It reads like this:

From: Text@dd39012.kasserver.com, Forum@dd39012.kasserver.com,
nicht =?UTF-8?Q?=C3=B6ffentlich=2C=20nur=20f=C3=BCr=20Mitg?= =?UTF-8?Q?lieder?= <Forum <info@domain.de>>

Beside the problems, described in the other reply, I see another problem, when reading the RFC 2822 that describes the format of a valid e-mail. But, to say it in the beginning, that's a point we have not in our hand.

Section 3.6.2 of RFC 2822 (you have to search it with the browser search tool (normally to open with [CTRL]+[F]) describes the headers, that can be set to specify the sender. There are following possible headers and their quoted descriptions (wit additonal notices from me).

From

from            =       "From:" mailbox-list CRLF

This can be one address or mailbox or a list of addresses and/or mailboxes.

The "From:" field specifies the author(s) of the message, that is, the mailbox(es) of the person(s) or system(s) responsible for the writing of the message.

Sender

sender          =       "Sender:" mailbox CRLF

This can be one address/mailbox but not a list.

The "Sender:" field specifies the mailbox of the agent responsible for the actual transmission of the message. For example, if a secretary were to send a message for another person, the mailbox of the secretary would appear in the "Sender:" field and the mailbox of the actual author would appear in the "From:" field. If the originator of the message can be indicated by a single mailbox and the author and transmitter are identical, the "Sender:" field SHOULD NOT be used. Otherwise, both fields SHOULD appear.

ReplyTo

reply-to        =       "Reply-To:" address-list CRLF

This can be one address or a list of addresses but not mailboxes.

When the "Reply-To:" field is present, it indicates the mailbox(es) to which the author of the message suggests that replies be sent. In the absence of the "Reply-To:" field, replies SHOULD by default be sent to the mailbox(es) specified in the "From:" field unless otherwise specified by the person composing the reply.

The descriptions are followed by this sentence:

In all cases, the "From:" field SHOULD NOT contain any mailbox that does not belong to the author(s) of the message.

That means, when I do not read and understand it completely wrong, that the additional addresses that got added by your provider, would have to be appear in an added Sender-header but NOT in the From-header because they in fact "does not belong to the author(s) of the message" and it has to be only one address. But that's another issue for your provider.

Tschö, Auge

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

RSS Feed of thread