Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: m4z on October 04, 2019, 06:58:54 PM

Title: New mail issue in (almost) current HEAD
Post by: m4z on October 04, 2019, 06:58:54 PM
I'm using the HEAD from 2019-09-23 (https://github.com/SimpleMachines/SMF2.1/commit/8079796516a5f2944fea476a1fd04a0bda6d1fb7). This bug didn't exist in rc2, I only see it since updating.

Whenever notifications are sent since the update, I receive an error mail a bit later (I suspect this is caused by the title of my beta forum):

This is the mail system at host mail.(my-redacted-domainname).

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                   The mail system

<(redacted)@gmail.com>: host gmail-smtp-in.l.google.com[66.102.1.27]
    said: 550-5.7.1 [(redacted)      13] Messages with multiple addresses in
    From: 550 5.7.1 header are not accepted. j25si3406681wrd.444 - gsmtp (in
    reply to end of DATA command)



---------- Forwarded message ----------
From: Beta-Foo@mail.(my-redacted-domainname), Bar@mail.(my-redacted-domainname), v2@mail.(my-redacted-domainname), "(Beta)"@mail.(my-redacted-domainname), "[BETA]"@mail.(my-redacted-domainname), "PS@mail.(my-redacted-domainname):Did I say beta?" <webmaster@beta-forum.(my-redacted-domainname)>
To: <(redacted)@gmail.com>
Cc:
Bcc:
Date: Thu, 03 Oct 2019 19:59:47 -0000
Subject: Themenantwort: Re: Is this real life?
In einem Thema, das Sie beobachten, wurde eine Antwort von m4z geschrieben.

Sehen Sie sich die Antwort an unter: http://beta-forum.(my-redacted-domainname)/index.php?topic=43.new#new

Um dieses Thema abzubestellen, verwenden Sie diesen Link: http://beta-forum.(my-redacted-domainname)/index.php?action=notifyboard;board=4.0

Sie werden für dieses Thema keine weiteren Benachrichtigungen erhalten, bis Sie es lesen.

Grüße,
das Beta-Foo Bar v2 (Beta) [BETA] PS: Did I say beta?-Team.


Yes, the title of my beta forum really is "Beta-Y Z v2 (Beta) [BETA] PS: Did I say beta?", so as to not to confuse it with my production forum. It also has different colors etc.
My production forum is called "Y Z v2" and doesn't exhibit the problem, so I assume a special-to-PHP character, maybe the ":"(?), is causing this.
Title: Re: New mail issue in (almost) current HEAD
Post by: m4z on October 05, 2019, 03:50:12 AM
Yep, could confirm my suspicion: When I remove the colon from the forum name/title, mails are sent properly.
Title: Re: New mail issue in (almost) current HEAD
Post by: SychO on October 05, 2019, 08:11:49 AM
Huh this is interesting, does it also not work with  news letters ?
Title: Re: New mail issue in (almost) current HEAD
Post by: m4z on October 05, 2019, 08:43:53 AM
Will try, never used them.
Title: Re: New mail issue in (almost) current HEAD
Post by: m4z on October 05, 2019, 11:50:52 AM
When the forum name doesn't contain a colon, the mail is sent fine (I had to shorten the subject to 60 chars, though, but I kept the newsletter-colon):

---------- Forwarded message ---------
From: Beta-Foo Bar v2 (Beta) [BETA] PS Did I say beta? <webmaster@beta-forum.(redacted)>
Date: Sat, Oct 5, 2019 at 5:27 PM
Subject: Beta-F. B. v2 (Beta) [BETA] PS Did I say beta?: Betreff
To: <(redacted)@gmail.com>


Test-Newsletter aus dem Beta-Forum


This page intentionally left non-blank


Grüße,
das Beta-Foo Bar v2 (Beta) [BETA] PS Did I say beta?-Team.

https://beta-forum.(redacted)/index.php



When re-adding the problematic colon to my forum name, the length check of the newsletter subject didn't complain about it being longer than 60 chars, and the mail bounces again:

This is the mail system at host mail.(redacted).

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                   The mail system

<(redacted)@gmail.com>: host gmail-smtp-in.l.google.com[74.125.133.26]
    said: 550-5.7.1 [(redacted)      13] Messages with multiple addresses in
    From: 550 5.7.1 header are not accepted. 92si8698602wrq.93 - gsmtp (in
    reply to end of DATA command)



---------- Forwarded message ----------
From: Beta-Foo@mail.(redacted), Bar@mail.(redacted), v2@mail.(redacted), "(Beta)"@mail.(redacted), "[BETA]"@mail.(redacted), "PS@mail.(redacted):Did I say beta?" <webmaster@beta-forum.(redacted)>
To: <(redacted)@gmail.com>
Cc:
Bcc:
Date: Sat, 05 Oct 2019 15:40:45 -0000
Subject: Beta-Foo Bar v2 (Beta) [BETA] PS: Did I say beta?: Betreff
Test-Newsletter aus dem Beta-Forum #2

Grüße,
das Beta-Foo Bar v2 (Beta) [BETA] PS: Did I say beta?-Team.

https://beta-forum.(redacted)/index.php
Title: Re: New mail issue in (almost) current HEAD
Post by: shawnb61 on October 19, 2019, 04:31:00 PM
Did the kick back come from gmail, or another mail provider?

I've found this error reported elsewhere online via a quick Google, and in all cases, it was gmail reporting the error.  There seemed to be a fair amount of grousing that gmail should be able to handle those characters. 

So it's not clear to me whether this is a gmail issue or an SMF issue.

Then again...  Under the covers, many domains actually use gmail...  This is almost certainly a very pervasive problem...

So I logged this up on the 2.1:
https://github.com/SimpleMachines/SMF2.1/issues/5834
Title: Re: New mail issue in (almost) current HEAD
Post by: Arantor on October 19, 2019, 04:39:31 PM
SMF issue as it appears to be mangling the "From" header into where the recipient thinks it has multiple From headers.
Title: Re: New mail issue in (almost) current HEAD
Post by: shawnb61 on October 19, 2019, 05:05:28 PM
I'm not sure that is the case, as other apps have reported the same issue.  The text of the error message itself is a bit of a red herring.  The problem isn't the list, it's the colon...  Removing that single character fixes it, as m4z has confirmed above.   

I.e., looking at m4z's (excellent) tests above, it appears it doesn't like this email at all:
"PS@mail.(redacted):Did I say beta?" <webmaster@beta-forum.(redacted)>


Either way, it's logged now. 

The biggest question in my mind is what does the standard say.  Should gmail be ignoring the : within the double quotes above?  Or is the sender expected to escape or encode it somehow?
Title: Re: New mail issue in (almost) current HEAD
Post by: m4z on October 19, 2019, 05:08:02 PM
I've temporarily set the mail address of one of my accounts to an https://www.throwawaymail.com address, and while the mail was accepted by their server, in their webmailer it breaks the mail enough so that I can only see the From address (Beta-Foo@mail.(redacted)) and Subject (sadly, they don't allow you to view the raw mail), but nothing more (no body etc.).
Title: Re: New mail issue in (almost) current HEAD
Post by: Arantor on October 19, 2019, 05:10:04 PM
QuoteI'm not sure that is the case, as other apps have reported the same issue.

QuoteFrom: Beta-Foo Bar v2 (Beta) [BETA] PS Did I say beta? <webmaster@beta-forum.(redacted)>

QuoteFrom: Beta-Foo@mail.(redacted), Bar@mail.(redacted), v2@mail.(redacted), "(Beta)"@mail.(redacted), "[BETA]"@mail.(redacted), "PS@mail.(redacted):Did I say beta?" <webmaster@beta-forum.(redacted)>

Each token from the email sender is being processed by the mail relay as its own email (and doing so according to spec at that point) - thus "Beta-Foo" becomes [email protected], "Bar" becomes [email protected], etc.

Either SMF is sending it wrong (lack of quotes), or it's being mangled by a relay further down the chain that's stripped quotes and then tokenised. I... don't believe it's the latter.
Title: Re: New mail issue in (almost) current HEAD
Post by: shawnb61 on October 19, 2019, 05:16:30 PM
Good discussion to continue on the bug report on the 2.1 repo at this point!
Title: Re: New mail issue in (almost) current HEAD
Post by: Arantor on October 19, 2019, 05:21:34 PM
Not really, I'll just unsubscribe because of the notifications it otherwise generates.
Title: Re: New mail issue in (almost) current HEAD
Post by: shawnb61 on November 29, 2022, 11:00:19 PM
Fixed in 2.1