Bug 390806

Summary: kmail sleeping after opening an attachment
Product: [Applications] kmail2 Reporter: Martin Schnitkemper <martin.schnitkemper>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: jjm, montel
Priority: NOR    
Version: 5.7.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:

Description Martin Schnitkemper 2018-02-20 19:45:39 UTC
After opening an attachment, kmail does not remove its process on exit. It is not possible to launch kmail again, unless I kill the previous process.  In fact, a second process is starting but kmail does not appear. 

If launching kmail on console I get these messages after opening a PDF:

| command= "okular %U" args= ("okular %U", "file:///tmp/messageviewer_attachment_JpSXKU/RE1258538069258.pdf")
| EXEC  "/usr/bin/okular /tmp/messageviewer_attachment_JpSXKU/RE1258538069258.pdf"
| EXEC done
| sleeping...

This happen with every kind of attachment.
Comment 1 Laurent Montel 2018-02-21 08:28:35 UTC
I confirm it.
it seems to be a bug in kf5 framework as we use kf5 method.
Comment 2 Jonathan Marten 2018-02-21 12:22:12 UTC
The console messages above are from kioexec, which was a fix implemented a long time ago for bug 130709.  kioexec sleeps for 180 seconds after starting the application but before removing the temporary file, so that if the application forks and the parent returns immediately the file will not be removed before the child application has the chance to open it.

If you wait for 3 minutes after opening the attachment, then you will find that kmail exits correctly.

The question, therefore, is why kmail is waiting for the opening of the attachment to finish - it should launch it in a separate background process.
Comment 3 Martin Schnitkemper 2023-03-16 10:15:40 UTC
The problem has now been fixed and no longer occurs.
[kmail2 5.22.3 (22.12.3) | KDE Plasma version: 5.27.2 | KDE Framework Version: 5.103.0 | Qt version: 5.15.8]