Bug 361131

Summary: Mail signature is treated invalid when provided as file
Product: [Applications] kmail2 Reporter: aosthof
Component: config dialogAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED UPSTREAM    
Severity: normal CC: montel
Priority: NOR    
Version: 5.1   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description aosthof 2016-03-29 09:21:41 UTC
If one wants to use a mail signature (like the name, address, etc.) from a file to be appended to new mails, kmail errors with the message "Invalid signature".

Reproducible: Always

Steps to Reproduce:
1. Open "Settings" --> "Configure KMail"
2. From "Identities", choose the identity where you want to add a signature and click on "Change..."
3. Select the tab "Signature", check the checkbox "Attach signature" and select to get the signature from a file.
4. Select the file containing your signature
5. After hitting "OK" an error message is shown saying "the signature is invalid"

Actual Results:  
Mail signatures cannot be used from files anymore.

Expected Results:  
Read the signature from the given file.
Comment 1 Laurent Montel 2016-03-29 09:45:56 UTC
it's local file ?
(it works fine here kmail 5.2)
Comment 2 aosthof 2016-03-29 10:03:22 UTC
(In reply to Laurent Montel from comment #1)
> it's local file ?
> (it works fine here kmail 5.2)

Yes, it's a local file, plain text, permissions 644. The strange thing is, I can use the output of a command (e.g. "cat /path/to/signature") as workaround.
Comment 3 Laurent Montel 2016-03-29 10:31:58 UTC
I know that I fixed some bugs in kdepim 5.1.x so for me it's fixed as it works here.
But not idea in which kdepim version
Comment 4 aosthof 2016-03-29 11:45:18 UTC
I've just upgraded to the latest version available in KDE:/Applications/openSUSE_Leap_42.1, which is kmail5 15.12.3-42.1, but this didn't fix the issue. However I think the relevant fix for this issue went into the 16.03.80 release (likely https://github.com/KDE/kdepim/commit/51fa1752b5c271c504f775945e84d97c7df81b8b).

As I have a workaround, I'll wait for the next release to be available for openSUSE Leap. Thanks for looking into this issue anyway!
Comment 5 Laurent Montel 2016-03-29 11:53:52 UTC
+        QFileInfo file(mSignatureConfigurator->filePath());
+        if (!file.isReadable()) {
             KMessageBox::error(this, i18n("The signature file is not valid"));
             return;
         }

indeed.
I couldn't adapt api in 5.1.x so I changed to 5.2
Comment 6 aosthof 2016-03-29 12:08:08 UTC
Fine for me, I can wait. Thanks for the confirmation.