Bug 420766 - Envelope From is empty on outgoing mails
Summary: Envelope From is empty on outgoing mails
Status: RESOLVED WORKSFORME
Alias: None
Product: kmail2
Classification: Applications
Component: general (show other bugs)
Version: 5.14.0
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-29 19:19 UTC by David de Cos
Modified: 2020-10-21 09:38 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David de Cos 2020-04-29 19:19:28 UTC
In the last days, some of the e-mails that I have received show an empty FROM field in KMail. This may have coincided with upgrading to 20.04. Some remarks:

The e-mails don't actually have an empty FROM field. Other clients show them correctly.

Those e-mails have certain things in common (which may or not be relevant):

- They have been sent from the same server (all e-mails being notifications from comments in forums at my university's Moodle).

- In those e-mails, the FROM field has characters like "é", "ú", "ñ".

- In the e-mail source, the FROM field looks like this:
"=?utf-8?B?TWFyw61hICBMZcOzbiBHb256w6FsZXogKGVnZWxhIDIwMTktMjAtKHIpZW4=?=
=?utf-8?B?IGJpdGFydGV6KQ==?=" <actual e-mail address of the sender>


Thinking that those special characters might be responsible for the bug, I sent myself an e-mail in which I manually changed my name from David to Dávid, and included an attachment named "filé.txt". When I received it back, it didn't show an empty FROM field like the other e-mails, but it did show something interesting: "Dávid" was shown as "D?vid", and the attachment file name was shown as "t?do.txt". Manually changing the encoding in the View menu didn't fix this. I suspect this might be due to the same bug I'm reporting here, because I have never noticed anything like this either. If it isn't, I guess I will report a separate bug for that, because that's not the expected behavior either.


SOFTWARE/OS VERSIONS
Kmail version: 5.14.0
KDE Plasma Version: 5.18.4.1
KDE Frameworks Version: 5.69.0
Qt Version: 5.14.2
Comment 1 Tim Mohlmann 2020-05-03 19:23:48 UTC
Same problem here. Arch Linux with KMail 5.14.0. Verified with KMail on 5.13 on Kubuntu and bug does not exist there.

In fact, the smtp "envelope from" is empty. In my case this is causing all outgoing mail not being DKIM signed by the server and rejected by bigger hosters like Gmail.

A logs from the sever:

mail postfix/smtpd[15514]: connect from mailu_front_1.mailu_default[192.168.203.3]
mail postfix/smtpd[15514]: 522801C1F36: client=5-15-244-176.residential.rdsnet.ro[5.15.244.176], sasl_method=XCLIENT, sasl_username=tester@usrpro.io
mail postfix/cleanup[15518]: 522801C1F36: replace: header Received: from localhost (5-15-244-176.residential.rdsnet.ro [5.15.244.176])??by mail.usrpro.io (Postfix) with ESMTPA id 522801C1F36??for <admin@test.mailu.io>; Sat,  2 May 2020 13:17:20 +0000 (UTC) from 5-15-244-176.residential.rdsnet.ro[5.15.244.176]; from=<> to=<admin@test.mailu.io> proto=ESMTP helo=<localhost>: Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP])??by mail.usrpro.io (Postfix) with ESMTPA id 522801C1F36??for <admin@test.mailu.io>; Sat,  2 May 2020 13:17:20 +0000 (UTC)
mail postfix/cleanup[15518]: 522801C1F36: message-id=<>
mail postfix/qmgr[118]: 522801C1F36: from=<>, size=457, nrcpt=1 (queue active)
mail postfix/smtpd[15514]: disconnect from 5-15-244-176.residential.rdsnet.ro[5.15.244.176] ehlo=2 xclient=0/1 mail=1 rcpt=1 data=1 quit=1 commands=6/7

Notice that the from=<> is empty.

On the receiving side header look like:

Delivered-To: <admin@test.mailu.io>
Return-Path: <>
Received: from test.mailu.io ([192.168.203.11])
	by test.mailu.io with LMTP
	id OCXxBv9yrV6CFQAAMfcGgg
	(envelope-from <>)
	for <admin@test.mailu.io>; Sat, 02 May 2020 13:17:51 +0000
Received: from mail.usrpro.io (mail.usrpro.io [95.216.219.34])
	by test.mailu.io (Postfix) with ESMTP id B25B65DEBF
	for <admin@test.mailu.io>; Sat,  2 May 2020 13:17:50 +0000 (UTC)
Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP])
	by mail.usrpro.io (Postfix) with ESMTPA id 522801C1F36
	for <admin@test.mailu.io>; Sat,  2 May 2020 13:17:20 +0000 (UTC)
From: tester@usrpro.io
To: admin@test.mailu.io
Subject: smtp mail from is empty
Date: 2020-05-02 16:17:21.963507399 +0300 EEST m=+0.867210250
MIME-Version: 1.0
Content-type: text/html; charset="UTF-8"
X-Spamd-Bar: +++++
X-Spam-Level: *****
Authentication-Results: test.mailu.io;
	dkim=none;
	dmarc=fail reason="No valid SPF, No valid DKIM" header.from=usrpro.io (policy=reject);
	spf=none (test.mailu.io: domain of mail.usrpro.io has no SPF policy when checking 95.216.219.34) smtp.helo=mail.usrpro.io

The From in the body is set, but envelope from is empty.
Comment 2 Laurent Montel 2020-05-04 04:59:52 UTC
Could you send me a testcase  as  I can't reproduce it here.
Thanks
Comment 3 Laurent Montel 2020-05-04 05:11:48 UTC
Git commit ea14bb921d43118361b1973b01bacfeaf5a8bf2f by Laurent Montel.
Committed on 04/05/2020 at 05:11.
Pushed by mlaurent into branch 'release/20.04'.

Fix Bug 420766 - Envelope From is empty on outgoing mails
Revert support for big email (for the moment it creates too many
bug in encoding)

M  +6    -5    messageviewer/src/htmlwriter/webengineparthtmlwriter.cpp

https://commits.kde.org/messagelib/ea14bb921d43118361b1973b01bacfeaf5a8bf2f
Comment 4 Tim Mohlmann 2020-05-04 07:16:03 UTC
(In reply to Laurent Montel from comment #2)
> Could you send me a testcase  as  I can't reproduce it here.
> Thanks

Hi! thanks for your quick reply. I've tried sending you an direct e-mail from Kmail just now, but the KDE server is also hard bouncing my e-mail due to this issue:

May 04 07:10:29 mail postfix/smtpd[10281]: CE1EE1C1F7A: client=5-15-225-27.residential.rdsnet.ro[5.15.225.27], sasl_method=XCLIENT, sasl_username=admin@usrpro.io
May 04 07:10:29 mail postfix/cleanup[10285]: CE1EE1C1F7A: replace: header Received: from sky.localnet (5-15-225-27.residential.rdsnet.ro [5.15.225.27])??by mail.usrpro.io (Postfix) with ESMTPA id CE1EE1C1F7A??for <montel@kde.org>; Mon,  4 May 2020 07:10:29 +0000 (UTC) from 5-15-225-27.residential.rdsnet.ro[5.15.225.27]; from=<> to=<montel@kde.org> proto=ESMTP helo=<sky.localnet>: Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP])??by mail.usrpro.io (Postfix) with ESMTPA id CE1EE1C1F7A??for <montel@kde.org>; Mon,  4 May 2020 07:10:29 +0000 (UTC)
May 04 07:10:29 mail postfix/cleanup[10285]: CE1EE1C1F7A: message-id=<3811245.7F7dMsKJgg@sky>
May 04 07:10:30 mail postfix/qmgr[119]: CE1EE1C1F7A: from=<>, size=644, nrcpt=1 (queue active)
May 04 07:10:30 mail postfix/smtpd[10281]: disconnect from 5-15-225-27.residential.rdsnet.ro[5.15.225.27] ehlo=2 xclient=0/1 mail=1 rcpt=1 data=1 quit=1 commands=6/7
May 04 07:10:41 mail postfix/smtp[10286]: CE1EE1C1F7A: to=<montel@kde.org>, relay=letterbox.kde.org[46.43.1.242]:25, delay=12, delays=0.37/0.05/4.6/6.9, dsn=5.7.1, status=bounced (host letterbox.kde.org[46.43.1.242] said: 550 5.7.1 rejected by DMARC policy for usrpro.io (in reply to end of DATA command))

If needed, I can relax the DMARC policy on this domain. This might take some time for the change to propagate globally though.
Comment 5 Tim Mohlmann 2020-05-04 07:18:42 UTC
(In reply to Laurent Montel from comment #3)
> Git commit ea14bb921d43118361b1973b01bacfeaf5a8bf2f by Laurent Montel.
> Committed on 04/05/2020 at 05:11.
> Pushed by mlaurent into branch 'release/20.04'.
> 
> Fix Bug 420766 - Envelope From is empty on outgoing mails
> Revert support for big email (for the moment it creates too many
> bug in encoding)
> 
> M  +6    -5    messageviewer/src/htmlwriter/webengineparthtmlwriter.cpp
> 
> https://commits.kde.org/messagelib/ea14bb921d43118361b1973b01bacfeaf5a8bf2f

Great! I will see if I can do a local build later.
Comment 6 Laurent Montel 2020-05-04 07:39:29 UTC
(In reply to Tim Mohlmann from comment #5)
> (In reply to Laurent Montel from comment #3)
> > Git commit ea14bb921d43118361b1973b01bacfeaf5a8bf2f by Laurent Montel.
> > Committed on 04/05/2020 at 05:11.
> > Pushed by mlaurent into branch 'release/20.04'.
> > 
> > Fix Bug 420766 - Envelope From is empty on outgoing mails
> > Revert support for big email (for the moment it creates too many
> > bug in encoding)
> > 
> > M  +6    -5    messageviewer/src/htmlwriter/webengineparthtmlwriter.cpp
> > 
> > https://commits.kde.org/messagelib/ea14bb921d43118361b1973b01bacfeaf5a8bf2f
> 
> Great! I will see if I can do a local build later.

It's the bad bug report. Sorry.
I reopen it
Comment 7 Tim Mohlmann 2020-05-05 07:31:43 UTC
(In reply to Laurent Montel from comment #2)
> Could you send me a testcase  as  I can't reproduce it here.
> Thanks

I've relaxed my domain's DMARC policy and I've send you a direct email. The sender address is admin@usrpro.io which is from my test server / account.

According my server logs the e-mail was successfully delivered. Most probably you find it in spam, because of the bug.
Comment 8 David de Cos 2020-05-22 20:46:11 UTC
I have just upgraded to 5.14.1, and I think my previous problems are gone. I can see the FROM field in all my e-mails again, and the attachment names are correctly shown too.

Thank you very much.
Comment 9 null 2020-05-24 18:44:01 UTC
Tim: After upgrading to 5.14.1, is the issue gone for you too?
Comment 10 Tim Mohlmann 2020-05-28 14:03:29 UTC
No, after upgrade I'm still seeing the same issues. I have sent a test case to Laurent and we had a brief discussion about it a few week ago, no news since.

After update I've sent out another test mail. In the "Message Source" it is clear the envelope-from remains empty:

Received: from REDACTED ([192.168.203.10])
	by mail.REDACTED.io with LMTP
	id J0dHBcHDz16VJwAAzCKaEg
	(envelope-from <>)
	for <REDACTED>; Thu, 28 May 2020 13:59:29 +0000

Version info after upgrade:

KMail
Version 5.14.1 (20.04.0)
Comment 11 Tim Mohlmann 2020-10-21 09:38:39 UTC
Since reporting the bug, I've switched to Gentoo and used a fresh install of Kmail. Now at version 5.14.3 The bug does not reproduce anymore.

Maybe it was a issue with my specific configuration, of something from Arch packaging. I don't know.

Anyway it works for me know and I haven't seen others confirming the bug, so I will close it. Thanks for your patience!