2022-11-13 07:41:57
2022-11-07 04:45:22
2022-11-07 04:42:29
834485
Friendica 2022.10 seems to be sending malformed email notifications
@Friendica Support
I am the system administrator of the Friendica node at talkabout.cf, and have just updated the node to version 2022.10, along with a system upgrade to Ubuntu 22.04 and an updated web control panel. I just received several email notifications that were garbled in my inbox. I was able to trace the problem to some header lines that have an extra space at the beginning of each line. I am including these redacted headers below. I also leave a couple of lines above and below intact to make these extra leading spaces visible.
The message ID of course is added by the mail transfer agent before the message is delivered, but I left that header because it is immediately above the Subject: header, which does not contain a leading space. I did resend the message by copying and pasting the garbled source message into a text editor, removing the leading space from each line and copying and pasting it back into a direct connection to my local SMTP server, sending the message to myself, and I received the correctly decoded message. Did I find a bug in the latest 2022.10 Friendica code, or did something go wrong with the upgrades that I performed prior to the update that somehow didn't affect anything other than these mail headers?
I am the system administrator of the Friendica node at talkabout.cf, and have just updated the node to version 2022.10, along with a system upgrade to Ubuntu 22.04 and an updated web control panel. I just received several email notifications that were garbled in my inbox. I was able to trace the problem to some header lines that have an extra space at the beginning of each line. I am including these redacted headers below. I also leave a couple of lines above and below intact to make these extra leading spaces visible.
Subject: [Friendica:Notify] Name Redacted tagged you (kyle@talkabout.cf)
Precedence: list
X-Friendica-Host: talkabout.cf
X-Friendica-Platform: Friendica
X-Friendica-Version: 2022.10
List-ID: <notification.talkabout.cf>
List-Archive: <https://talkabout.cf/notifications/system>
X-Friendica-Account: <kyle@talkabout.cf>
References: <RedactedHexID@email.server>
In-Reply-To: <RedactedHexID@email.server>
From: Talkabout Federated Social Network | Powered by Friendica <notify@talkabout.cf>
Reply-To: Talkabout Federated Social Network | Powered by Friendica <notify@talkabout.cf>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="2-189687198-581818022=:18767"
Message-Id: <RedactedMessageIDSuppliedByServer@email.server>
From: "redacted@email.address" <notify@talkabout.cf>
Date: Sun, 06 Nov 2022 14:33:24 +0100
The message ID of course is added by the mail transfer agent before the message is delivered, but I left that header because it is immediately above the Subject: header, which does not contain a leading space. I did resend the message by copying and pasting the garbled source message into a text editor, removing the leading space from each line and copying and pasting it back into a direct connection to my local SMTP server, sending the message to myself, and I received the correctly decoded message. Did I find a bug in the latest 2022.10 Friendica code, or did something go wrong with the upgrades that I performed prior to the update that somehow didn't affect anything other than these mail headers?
Hypolite Petovan
•It sounds like there's an overly zealous mail software somewhere as no other admin has had this issue before and we haven't changed the sending software.
Friendica Support reshared this.
Hypolite Petovan
•mail()
PHP function which relies on the current MTA of the server, eithersendmail
orpostfix
, etc...What is your configuration in this regard?
Friendica Support reshared this.
Kyle π πΆ
•Kyle π πΆ
•Hypolite Petovan
•mail()
call in Friendica, so I feel like it has to do with Exim. Would you be able to temporarily switch to Postfix to perform a test?Friendica Support reshared this.
Kyle π πΆ
•Incidentally, I used the interactive php shell to send one such garbled message back through the php mail function after rewriting the message body to escape the new line characters and rewriting the headers to remove leading spaces and add \r\n to the end of each line as I read in a guide on how to use the function. The message came to my inbox legible and ungarbled. I used the message I'm replying to here, which is already on the public forum, so I won't have to redact anything other than my own email address and my mail server domain. In case it helps, this is how I called the function.
... show more
Incidentally, I used the interactive php shell to send one such garbled message back through the php mail function after rewriting the message body to escape the new line characters and rewriting the headers to remove leading spaces and add \r\n to the end of each line as I read in a guide on how to use the function. The message came to my inbox legible and ungarbled. I used the message I'm replying to here, which is already on the public forum, so I won't have to redact anything other than my own email address and my mail server domain. In case it helps, this is how I called the function.
Steffen K9 π°
•I'm using the phpmailer add-on and my own mail server with postfix.
Peter VΓ‘gner
•Email messages that I am getting into my inbox don't suffer from this.
I can't think of how exim would garble the headers though.
Peter VΓ‘gner
•Are you using other addons that might affect generating or sending emails?
Kyle π πΆ
•Kyle π πΆ
•Hypolite Petovan
•\n
by\r\n
insrc/Object/Email.php
on lines 140 and 143 and try again, see if it changes anything?Friendica Support reshared this.
Kyle π πΆ
•Hypolite Petovan
•Friendica Support reshared this.
Hypolite Petovan
•src/Util/Emailer.php
lines 166 through 168 with the same edit.And then you should be ok. The big question is whether everyone else will still be ok. π
Friendica Support reshared this.
Kyle π πΆ
•Hypolite Petovan likes this.
Hypolite Petovan
•Friendica Support reshared this.