The new version of phpmailer shipped with Moodle 3.2 has added check
that the explicitly provided MessageID matches /^<.*@.*>$/.
Values coming from our overridden moodle_phpmailer::addCustomHeader()
had a whitespace at the start. So the requested value was not used as
the Message-ID header and the default phpmailer value was used.
As a result, forum posts threading was broken in email clients.
The method used to be set as private in PHPdocs @access property in the
versions for PHP4. But apparenty upstream considers the function public.
Also, if the function did not declare visibility explicitly, it was
considered public anyway.
Stage 2 - We now extend phpmailer and do our customisations in our subclass
rather than directly in the original file.
Previously we modified SetLanguage(), but I have not carried that change over
because I could not see code paths where this gets executed.(See bug)
I tested the header/content of the old class vs this one and think the changes
are all carried over. (If anyone has clever thoughts for how to unit test this
mailing out it would be useful, especially for upgrading phpmailer).