thunderbird / thunderbird-android

K-9 Mail – Open Source Email App for Android
https://k9mail.app/
Apache License 2.0
9.69k stars 2.44k forks source link

mail sent from identity without display name gets displayname 'null' for messages saved as draft #7111

Open JohaJung opened 11 months ago

JohaJung commented 11 months ago

Checklist

App version

6.602 as well as 6.707

Where did you get the app from?

F-Droid

Android version

11 (LineageOS 18.1)

Device model

Samsung GT-I9301I

Steps to reproduce

  1. Create an Identity with your email address as sender and leave the "Your Name" field empty.
  2. Compose a new Email (to yourself), select the identity just created and save this message as draft.
  3. Re-Open this draft from the drafts folder and send it.

Expected behavior

The email is sent with From: myaddress@example.com in its headers.

Actual behavior

The From header of the sent mail is set to From: null <myaddress@example.com>.

Side-note: This malfunction even causes some mail providers' spam filters to increase the spam score for such mails (observed for Posteo).

Logs

Uploaded log file (captured via adb) here: k-9-log.txt

cketti commented 11 months ago

The problem is that we're writing some information to a special header field when saving draft messages. When opening that draft message, the name and email address for the sending "identity" is read from that header field. The code to create that header field contains a bug and writes "null" when there's no sender display name set.

We'll make a small change to avoid the problem, include that in the next beta version, and backport it to the stable version if no problems with the new code are reported.

The proper way to fix this, is to use the From header to figure out which of K-9 Mail's existing identities should be used to send the message. But that's a larger change that we won't backport to K-9 Mail 6.6xx.