Bug in Email Client: Microsoft 365 not able to forward email

REPRODUCIBILITY: 100%
OS VERSION: 4.5.0.18
HARDWARE: Xperia 10 II
UI LANGUAGE: English
REGRESSION:

DESCRIPTION:

Microsoft Email being forwarded to [firstname][lastname] instead of [email address], or error message in Outlook “Your message contains invalid characters (bare line feed characters) which the email servers at xxxx.nl don’t support.”

PRECONDITIONS:

  1. Account Microsoft 365
  2. Contact A: Piet de Wit, stored as firstname = Piet, lastname = Wit, de
  3. Contact B: Jan Zwart, stored as firstname = Jan, lastname = Zwart

STEPS TO REPRODUCE:

  1. Select email, press Forward arrow
  2. A. Type “piet”, Select mail address from dropdown list, Send
  3. B. Type “jan”, Select mail address from dropdown list, Send

EXPECTED RESULT:

Emails being forwarded

ACTUAL RESULT:

In both cases I get error messages in Outlook, so they appear in Inbox of the account used for forwarding. Errors look different.

A. Forwarding to Piet.
Error message: “de wasn’t found at xxxxxx.onmicrosoft.com.”
Remarkable is the “de” in this message. In the Original Message Headers there is a clue.
To: Piet Wit<de@xxxxxx.onmicrosoft.com>
So probably the To address was “Piet Wit, de” = [firstname][lastname]

B. Forwarding to Jan.
Error message: " Your message to rob@yyyyyy.nl couldn’t be delivered. Your message contains invalid characters (bare line feed characters) which the email servers at yyyyyy.nl don’t support."
This time the To address is OK, but something else is spoiling the party.
The email shows the following Error Details
Reported error: 550 5.6.11 SMTPSEND.BareLinefeedsAreIllegal; message contains bare linefeeds, which cannot be sent via DATA and receiving system does not support BDAT
DSN generated by: AM8P194MB1701.EURP194.PROD.OUTLOOK.COM

MODIFICATIONS:

No patches or WayDroid

ADDITIONAL INFORMATION:

Original Message Headers
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=apBp+ZjsBoXrOs7g0IZP5GVmUGma/latgBdPo0uoGGnH3zRbDD6KZi/P8/Ge6G0kSFZVn0rWOW2jJsOP+89wEZNoN4CGnLiko0Qx7sgdPY+tvztbNLEU1/+tgkVAZwUNPRobO6euyfTUnWCJ8VcLZD7SBqz/Tb81/0bwwYORj7zPfmZvJKahBW2v9fLRVeGotmnR/dEkoNDdBFBu5EvgyRLfk5/f9jOP5HMbviXwivBGQ9RwiR5sSFtpUK7wLhs5NLCbh+VhWovWTOS/u6iEKup9E8FEosYYcAC7H84E5kKBZnIrLdVNgl66LYt6JMO5iaEzr4tveM3kD73e8k0chQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
bh=m/Gj0G8ZquwjHCZOlQSfS9jFFu/skpYnSBAm7I5wW4E=;
b=PpN+K17UxNjeiFxLOqjKEsQrZKO0RmbK2wPy3Q+5Us+uLk3UkJeX0ozZcd7i9lfvbzShkyYaQ94PtqQhvOLau6LvutX+SD5GDBbF0Cczvn1TMTXMhhu0i5R0ubyrfSIbxhUXiPbqWe3rivp2edEQNZ3CtSdEZXzHmfK/X9cnzS03mfv62CxLaKQQd6SUbjsxh6IlJlGQ7RemYrMm/hfrFLoJEbDVoPX3Bt73PSvgTMkh6shW9ldL/W0GbVdyQnFlHJBv8DzI3epOgz5ukkroWGEQ6TaEb9fryk9tESwAnlFigXXrBwyuSPbfgVMZnUEGtFDkI7wzU127nRflFqN7jw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=xxxxxx.nl; dmarc=pass action=none header.from=xxxxxx.nl;
dkim=pass header.d=xxxxxx.nl; arc=none
Received: from PA4P194MB1183.EURP194.PROD.OUTLOOK.COM (2603:10a6:102:cb::7) by
AM8P194MB1701.EURP194.PROD.OUTLOOK.COM (2603:10a6:20b:324::16) with Microsoft
SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
15.20.6134.20; Fri, 24 Feb 2023 15:10:24 +0000
Received: from PA4P194MB1183.EURP194.PROD.OUTLOOK.COM
([fe80::ed06:1e3a:a5c7:f42d]) by PA4P194MB1183.EURP194.PROD.OUTLOOK.COM
([fe80::ed06:1e3a:a5c7:f42d%7]) with mapi id 15.20.6134.024; Fri, 24 Feb 2023
15:10:24 +0000
From: Rob LastName | XXXXXXXXXX rob.LastName@xxxxxx.nl
To: “rob@yyyyyy.nl” rob@yyyyyy.nl
Subject: Fwd: RE: Hoe gaat het ? - Evidos / XXXXXXXXXX B.V.
Thread-Topic: RE: Hoe gaat het ? - Evidos / XXXXXXXXXX B.V.
Thread-Index: AQHZSGIeg753fliZVkmKd/x2Pdf/QQ==
Date: Fri, 24 Feb 2023 15:10:24 +0000
Message-ID: PA4P194MB118339064AA5C60AE66A8907EEA89@PA4P194MB1183.EURP194.PROD.OUTLOOK.COM
Accept-Language: en-NL, en-150, en-GB, nl-NL, en-US
Content-Language: aa
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
header.d=none;dmarc=none action=none header.from=xxxxxx.nl;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: PA4P194MB1183:EE_|AM8P194MB1701:EE_
x-ms-office365-filtering-correlation-id: f9bd4157-971e-4aca-32fd-08db1679416a
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: azKxPYvPuAC7uJLki5UHsyEHlwCgf/V7PzAk19TvGvtiqRs3U+ZHjJpJBfidDPZPLw2pmut+dBGEZpAQAbBCkQ5MbQP4zyrX5iOLtNwIQJ09uDqFdr0SGn16zu8RmhMnMUAcjoJdfNYgVhgHrpwDD9kB0zLunc/yjgpGKQLGmTgu+edrhDrZcNTBHbO2qBmNaLfZ8EiIzZx2bqQSXBNybkCNbQ+NiRSVhP2ltdNBKG2SLpKKm1o0kS3cbGIxCRJAYgXRvaN8yCchYCmehzZ+k2JVt/EWDAAvg8cZfSfmjSYLOMykrXAiNs0RCwhTdYFemdqYz5n1qLqzXzZWE0vjzmfIZ0Su7h+S4vAW4vh9xMY/lMkmp8AN/LRaam9k9RNIMdPYHpt6tuYeLJgyUeLKsz8andGKFSNqacDRvGsY3U8RAXYfzvtYdhCyj6CszJ/031blBukXwV2Ya1PBikQ0IjOmsj/3K0y6zQ+8oqOlsqRrRIY4Dr0MWTKpqu2EjE30mK4GzzBf+xUGi6n98/Ydjnz2UINERmDryBWUM36Pj3qrozHwd0qZ1cFR8bzyRfHPc0Sd3Wl1r94u7XbbNVsgjn5SR4PvVQgF5MD25Vi3QRgS0RIYk3ZYrJJel2wFPu2I75mja7v4BQD9FISKxAoEarvxr3JAx/7ktadShbVagrFlrdHzZbRM2iPp4Dbo3ZSZ
x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:nl;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PA4P194MB1183.EURP194.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230025)(39830400003)(396003)(136003)(376002)(346002)(366004)(451199018)(478600001)(7696005)(316002)(71200400001)(558084003)(86362001)(33656002)(38100700002)(122000001)(38070700005)(99936003)(41300700001)(6506007)(26005)(66446008)(91956017)(66476007)(55016003)(2906002)(64756008)(66556008)(6916009)(66946007)(76116006)(8936002)(52536014)(5660300002)(8676002)(186003)(9686003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?utf-8?B?Uzc1UnFDQ0o5UVZvd3pOUFRFRDNOV2dQK3RiZFN6QWZJaEdnbEFNVE91OU9D?=
=?utf-8?B?WkFLNmZRL2lSOS9XcWh3ZHlIanZtNGRoc1V2WFlQdUNydmZqbFdnOEorcGU4?=
=?utf-8?B?WFVUbENhb3hvSldWZ1NkcXlEWEIrc1pJbkdTOWxIY2RKV21EdTBRbDZTVEdI?=
=?utf-8?B?MmxkVGZIY1o5ZkJEL09KcXFEVE1RWWZOSzVTcmF2WjBWUWZKU3l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XpkWkhXYWFjS1BM?=
=?utf-8?B?WW0vUXVJSERoa0lhTGs5ZDh2QlZFbVJxMHpFQVZDTUw3RWNhT2J5Tll6VjlJ?=
=?utf-8?B?dnc4SC9ZMkZpWm81OVpTQnhGS0tMSFZwbjdpRUJUT3U2M2F2ZHZaT0ZQSUJM?=
=?utf-8?B?dlVOYTVuYzM4K1NPV2F5VSt3LytrMWVtMUl6NStUUUs4ODRNbU9jcU1SVkMz?=
=?utf-8?B?amc9PQ==?=
Content-Type: multipart/mixed;
boundary=“002_PA4P194MB118339064AA5C60AE66A8907EEA89PA4P194MB1183EURP
MIME-Version: 1.0
X-OriginatorOrg: xxxxxx.nl
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: PA4P194MB1183.EURP194.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: f9bd4157-971e-4aca-32fd-08db1679416a
X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Feb 2023 15:10:24.6765
(UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 37fb3c68-4afb-409a-8fbc-87a0f4987082
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: uRJPlnnMK8qZ2NUwBBcg1QFxg8GgSsBtG0ref1Cw435xzWIiLcJ4I4cUT6DzL2gLZCxqN1d89MpEXkfpvTTuZZ6dKbRKdQfL/KbXEeGCa/g=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8P194MB1701

This is actually two bug reports in one post. The first one I was able to reproduce, the second one not so much. I’ll file the first one in our internal tracker.

It would be great if you could write another bug report about the second one.

Part two sounds a bit similar to this (insofar as it looks like somewhat wonky parsing/sanitizing of header values).

A bit yes. But not even as far as you stated - that bug is indeed about header values, but the part two here is about the actual data of the message. The issue is that the receiving server, being Microsoft one, doesn’t like getting unix-style line feeds. The message which we are forwarding happens to have them somewhere. Where exactly, it’s hard to tell without seeing the full message. To me this sounds like in order to fix this, we should actually transform the incoming unix-style linefeeds to microsoft-style linefeeds when forwarding the message. Which some would probably consider breaking the message, as we would no longer be forwarding the message as it was when we received it.

The mail was a trail of: a mail from a company, my reply and then theirs again. So the unix-style part may have stemmed from the SailfishOS mail app. I will try to dig it up again; I just tried using Outlook, and I didn’t manage to find a \n, only \r\n.

That would be actually good news, as then it would probably be something that we can easily fix.

This took a while, sorry… At least the problem was still there on 1 July 2023.

So, I think the problem starts in the UI of the Email app.

The screenshot below shows a response to an email I received. One of the people involved is in my Contacts list, the others are not. By coincidence, this Fred has a typical Dutch last name “van Es”. As I sort people by their (main) last name, I spelled his last name as “Es van”…

I think the email app tries to send the email to a person, whose name contains a space. And this space is not recognised by email servers.

BTW Fred’s e-mail is not a Microsoft address, but @xmsnet.nl, one of the oldest email services in NL.

The story above is supported by this header from the email I sent from my SFOS phone.

It shows all the people involved as email adresses, except for Fred. The screenshot was made using Thunderbird, and the option “View source” of the email.