[go: up one dir, main page]

Page MenuHomePhabricator

Email Message-ID headers containing question marks are rejected by gmail
Open, Stalled, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • make UserMailer::makeMsgId return a string with question marks in it, e.g. <myid?1234h@localhost.localdomain>
  • change your user's email address to a gmail adress
  • make mediawiki send a notification to the user

What happens?:
gmail servers block the email and reply with

host gmail-smtp-in.l.google.com[108.177.119.27] said: 550-5.7.1 [88.99.100.229
7] Our system has detected that this message is 550-5.7.1 likely
unsolicited mail.

i tried my private smtp server (posteo.de) and our company's mail server. both get blocked.

What should have happened instead?:
gmail servers accept the email

Software version
Mediawiki 1.38.2

This change from this commit swapped wfWikiID() with WikiMap::getCurrentWikiDomain()->getId(). The latter introduced an encoding for hyphens. So a wiki id my-database-name is turned into my?hdatabase?hname.

The implication for us is that clients who use gmail and access our applications with hyphens in their urls do not receive any emails from MediaWikis notification system. We have a multi tenancy application where database names are domain names. So my-mediawiki.de would have a corresponding database called wiki_my-mediawiki.de.

I filed a question in the google support forums: https://support.google.com/mail/thread/181400931?hl=en
I guess the RFC5322 is quite clear on this, allowing question marks in the header field. Is there anything I could do other than patching the method myself?

Event Timeline

CC'ing original change author, in case there's input/thoughts to share

Aklapper changed the task status from Open to Stalled.Sep 8 2024, 5:48 PM

This seems to boil down to the strtr() call in convertToString() in https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/libs/rdbms/database/domain/DatabaseDomain.php

In any case, I cannot spot anything in https://www.rfc-editor.org/rfc/rfc5322 section 3.6.4 and 3.2.3 which would not allow a question mark in the message-id.
It it was true that Gmail blocks MediaWiki mail because of ? in Message-ID, then I'd first like to see a confirmation by Google for this assumption plus Google's interpretation of the RFC. Setting task status to stalled until that is provided by one of the affected parties.

@Aklapper I opened another Google community question, which seems to be the best option to get eventually through to Gmail folks: https://support.google.com/mail/thread/295575902/gmail-blocks-mail-containing-question-marks-in-message-id
I would say chances are low to get a meaningful response, though.