Bug 83086 - Cannot send signed and/or encrypted messages
Summary: Cannot send signed and/or encrypted messages
Status: RESOLVED DUPLICATE of bug 85009
Alias: None
Product: kmail
Classification: Applications
Component: encryption (show other bugs)
Version: SVN (3.5 branch)
Platform: Unlisted Binaries Linux
: NOR grave
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 83081 84970 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-06-09 10:15 UTC by András Manţia
Modified: 2007-09-14 12:17 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
jnlib_logging.c.diff (2.45 KB, text/x-diff)
2004-06-21 12:31 UTC, David Faure
Details

Note You need to log in before you can comment on or make changes to this bug.
Description András Manţia 2004-06-09 10:15:50 UTC
I have a grave problem since I've updated KMail from CVS HEAD. It seems to be 
related to 
encryption and signing and the result is a crash and loss of the composed mail. 
Whenever I try  
to send a message I get the following warnings (and in the end KMail crashes): 
 
1. "One or more of your configured OpenPGP encryption keys or S/MIME 
certificates is not  
usable for encryption. Please reconfigure your encryption keys and certificates 
for this identity in the identity configuration dialog. 
If you choose to continue, and the keys are needed later on, you will be 
prompted to  
specify the keys to use." 
 
NOTE: I haven't changed my keys or any KMail setting and it worked before.  
 
Pressing continue gives me another message 
2. "This message could not be signed, since the chosen backend does  
not seem to support signing; this should actually never happen, please report 
this bug." 
 
Pressing OK makes KMail crash. Backtrace at the end of the report. 
 
The Cryptography setting for this identity is: 
- the same OpenPGP key is used for signing and encryption 
- preferred message format: Any 
I've chosen to sign, but NOT to encrypt the message. 
 
In Crypto Backends I have selected Kpgp/gpg, as I have gpg 1.2.4. I have gpgsm 
0.9.4, which 
is not enough for GpgME, but I don't care about signing and encrypting of 
attachements at this 
point. Inline Encryption is enough for me (and this was selected in the 
composer.) 
 
The crash happens depending on the encryption selected in the composer (but the 
warnings usually 
remain for all of them). 
- Inline - crashes 
- Any - does not crash, warning are visible, mail is not sent 
- S/MIME: only the 2nd warning is visible, mail is sent without signing 
- S/MIME opaque: same as S/MIME 
 
In case of encrypting I get one more warning: 
"You have requested to encrypt this message, and to encrypt a copy to yourself,  
but no valid trusted encryption keys have been configured for this identity." 
 
I also got a warning about my key will expire (but I disabled this warning) 
with a message like: 
"Your OpenPGP signing key 
Andras Mantia (KeyID 0xCE8BFF4F) 
expires in less than 4294954719 days." 
 
The key expiration is set to unlimited. 
 
PS: I can read encrypted mails sent to me without problem, and the (old) signed 
messages are correctly 
recognized. 
 
Here is the BT for the crash: 
Using host libthread_db library "/lib/libthread_db.so.1". 
[Thread debugging using libthread_db enabled] 
[New Thread 16384 (LWP 32721)] 
[KCrash handler] 
#5  0x421ea871 in kill () from /lib/libc.so.6 
#6  0x42089501 in pthread_kill () from /lib/libpthread.so.0 
#7  0x4208954b in raise () from /lib/libpthread.so.0 
#8  0x421ea604 in raise () from /lib/libc.so.6 
#9  0x421ebaac in abort () from /lib/libc.so.6 
#10 0x421e399a in __assert_fail () from /lib/libc.so.6 
#11 0x403d5c7e in MessageComposer::composeInlineOpenPGPMessage ( 
    this=0x8623418, theMessage=@0x8731f98, doSign=true, doEncrypt=false) 
    at /data/development/sources/kde-head/kdepim/kmail/messagecomposer.cpp:1048 
#12 0x403d5e43 in MessageComposer::composeMessage (this=0x8623418,  
    theMessage=@0x8731f98, doSign=true, doEncrypt=false,  
    format=InlineOpenPGPFormat) 
    at /data/development/sources/kde-head/kdepim/kmail/messagecomposer.cpp:1076 
#13 0x403d57ff in MessageComposer::composeMessage (this=0x8623418) 
    at /data/development/sources/kde-head/kdepim/kmail/messagecomposer.cpp:774 
#14 0x403de027 in MessageComposerJob::composeMessage (this=0x85c05a8) 
    at /data/development/sources/kde-head/kdepim/kmail/messagecomposer.cpp:206 
#15 0x403dda60 in ComposeMessageJob::execute (this=0x85c05a8) 
    at /data/development/sources/kde-head/kdepim/kmail/messagecomposer.cpp:232 
#16 0x403d3243 in MessageComposer::slotDoNextJob (this=0x8623418) 
    at /data/development/sources/kde-head/kdepim/kmail/messagecomposer.cpp:329 
#17 0x403db358 in MessageComposer::qt_invoke (this=0x8623418, _id=2,  
    _o=0xbfffee70) at messagecomposer.moc:95 
#18 0x41996f1b in QObject::activate_signal (this=0x82ee1b0, clist=0x87140b8,  
    o=0xbfffee70) at kernel/qobject.cpp:2356 
#19 0x41cee0b4 in QSignal::signal (this=0x82ee1b0, t0=@0x82ee1d8) 
    at .moc/debug-shared-mt/moc_qsignal.cpp:100 
#20 0x419b4673 in QSignal::activate (this=0x82ee1b0) at kernel/qsignal.cpp:212 
#21 0x419bbb8b in QSingleShotTimer::event (this=0x82ee188) 
    at kernel/qtimer.cpp:277 
#22 0x4193445b in QApplication::internalNotify (this=0xbffff4d0,  
    receiver=0x82ee188, e=0xbffff150) at kernel/qapplication.cpp:2620 
#23 0x41933918 in QApplication::notify (this=0xbffff4d0, receiver=0x82ee188,  
    e=0xbffff150) at kernel/qapplication.cpp:2343 
#24 0x4146e547 in KApplication::notify () from /opt/kde-cvs/lib/libkdecore.so.4 
#25 0x418ca531 in QApplication::sendEvent (receiver=0x82ee188,  
    event=0xbffff150) at qapplication.h:491 
#26 0x4192272a in QEventLoop::activateTimers (this=0x8178270) 
    at kernel/qeventloop_unix.cpp:558 
#27 0x418dc2d4 in QEventLoop::processEvents (this=0x8178270, flags=4) 
    at kernel/qeventloop_x11.cpp:389 
#28 0x41948622 in QEventLoop::enterLoop (this=0x8178270) 
    at kernel/qeventloop.cpp:198 
#29 0x4194853e in QEventLoop::exec (this=0x8178270) 
    at kernel/qeventloop.cpp:145 
#30 0x419345db in QApplication::exec (this=0xbffff4d0) 
    at kernel/qapplication.cpp:2743 
#31 0x0804aa37 in main (argc=7, argv=0xbffff644) 
    at /data/development/sources/kde-head/kdepim/kmail/main.cpp:108
Comment 1 David Faure 2004-06-09 10:27:15 UTC
On Wednesday 09 June 2004 10:15, Mantia Andras wrote:
> In Crypto Backends I have selected Kpgp/gpg, as I have gpg 1.2.4. I have gpgsm 
> 0.9.4, which 
> is not enough for GpgME, but I don't care about signing and encrypting of 
> attachements at this 
> point. Inline Encryption is enough for me (and this was selected in the 
> composer.) 

But we use gpgme also for inline encryption now.
Try running gpg-agent first?

Comment 2 András Manţia 2004-06-09 10:42:53 UTC
I started gpg-agent --daemon, the result is the same. Or am I forced to 
upgrade the newpg and it's not enough to have gpg installed or 
otherwise I won't be able to send signed and encrypted messages 
anymore? 
 Right now I cannot even select GpgMe from the Crypto Backends, just 
Kgpg/gpg1. And it's not clear for me what does it mean (read, what 
feature does it provide and what features won't work). 

 I run a fairy recent distro (SuSE 9.1).

Comment 3 David Faure 2004-06-09 10:48:24 UTC
On Wednesday 09 June 2004 10:42, Mantia Andras wrote:
>  Right now I cannot even select GpgMe from the Crypto Backends, just 
> Kgpg/gpg1.
Ah. I have no idea if/how the code is supposed to work with Kgpg/gpg1.
I would like to find out why gpgme can't be selected - given that we do ship a copy
of gpgme with kdepim... Did configure use that one, or an installed gpgme?
Ah, or does it say that gpg is too old so no gpgme can be used at all?

You restarted kmail after starting gpg-agent, in a way that kmail inherits the env. vars
from gpg-agent, right? This is of course necessary. (I suggest to run gpg-agent with
eval `gpg-agent --daemon`  in e.g. ~/.kde/env/agents.sh if using kdebase-cvs-head)
But of course this will only matter once gpgme is actually enabled.

Comment 4 András Manţia 2004-06-09 10:59:26 UTC
From config.log:
configure:42985: checking for gpgme-config
configure:43003: found /usr/bin/gpgme-config
configure:43016: result: /usr/bin/gpgme-config
configure:43035: checking for GPGME - version >= 0.4.4
configure:43278: result: no

configure:44515: checking for gpg
configure:44533: found /usr/bin/gpg
configure:44545: result: /usr/bin/gpg
configure:44615: checking for gpgsm
configure:44633: found /usr/bin/gpgsm
configure:44645: result: /usr/bin/gpgsm

From config.h:
/* Path to the GPGSM binary. */
#define GPGSM_PATH "/usr/bin/gpgsm"

/* Path to the GnuPG binary. */
#define GPG_PATH "/usr/bin/gpg"

/* Define to 1 if you have gpgme >= 0.4.4 */
#define HAVE_GPGME_0_4_BRANCH 1

/* Define to 1 if your gpgme supports gpgme_cancel() */
/* #undef HAVE_GPGME_CANCEL */

/* Define to 1 if you have gpgme >= 0.4.4 */
#define HAVE_GPGME_H 1

/* Define to 1 if your gpgme supports GPGME_KEYLIST_MODE_VALIDATE */
/* #undef HAVE_GPGME_KEYLIST_MODE_VALIDATE */

/* Define to 1 if your gpgme's gpgme_key_t has the keylist_mode member */
/* #undef HAVE_GPGME_KEY_T_KEYLIST_MODE */


And yes, it says that my gpgsm is too old.
So the question now is: if KMail provides its own gpgme if the system does not have a good one, why isn't that used?

Regarding gpg-agent, I did:
andris@stein:~> gpg-agent --daemon
gpg-agent[16703]: Secure memory is not locked into core
GPG_AGENT_INFO=/tmp/gpg-RqmJ85/S.gpg-agent:16761:1; export GPG_AGENT_INFO;
andris@stein:~> GPG_AGENT_INFO=/tmp/gpg-RqmJ85/S.gpg-agent:16761:1; export GPG_AGENT_INFO;
andris@stein:~> kmail


BTW, when were the requirements changed for inline encryption? IIRC I've update a week or so ago kdepim and it worked than, but doesn't work now.
Comment 5 David Faure 2004-06-09 11:23:11 UTC
On Wednesday 09 June 2004 10:59, Mantia Andras wrote:
> configure:43035: checking for GPGME - version >= 0.4.4
> configure:43278: result: no
> So the question now is: if KMail provides its own gpgme if the system does not have a good one, why isn't that used?
From what I see in the configure script, gpgme-copy is used when you get "no" above.
What's GPGME_LIBS for you? (check toplevel MakeVars if using unsermake, any Makefile if using automake)
Is there any .la in kdepim/libkdenetwork/libgpgme-copy/gpgme/ ?

gpgme-copy should probably be updated to a newer version, I wonder if this could be the problem...
Marc: the configure check looks for GPGME_KEYLIST_MODE_VALIDATE, gpgme_cancel, and gpgme_key_t->keylist_mode,
in the installed gpgme. But when using gpgme-copy, none of those are available. Does that cripple the functionality
somehow? If yes, then we have to upgrade gpgme-copy obviously. Do you see any problems in doing that?

> And yes, it says that my gpgsm is too old.
Don't worry about gpgsm, that's for S/MIME. What matters for you is gpg + gpgme.

Comment 6 András Manţia 2004-06-09 11:32:33 UTC
> What's GPGME_LIBS for you? (check toplevel MakeVars if using unsermake, any 
> Makefile if using automake) 
GPGME_LIBS = $(top_builddir)/libkdenetwork/libgpgme-copy/gpgme/libgpgme.la

> Is there any .la in kdepim/libkdenetwork/libgpgme-copy/gpgme/ ? 
Yes, I have libqgpgme.la.

So it's compiled.
 
> Don't worry about gpgsm, that's for S/MIME. What matters for you is gpg + 
> gpgme. 

Indeed. S/MIME is disabled under GpgMe, OpenPgp/gpg is not, but if I check it, close the dialog, go back to the configuration dialog it is not checked anymore. This is what I mean when I said that I can't select GpgMe.
 

Comment 7 András Manţia 2004-06-09 11:36:10 UTC
Oops, sorry, the libraries in libgpgme-copy/gpgme are:
libgpgme-real.la
libgpgme.la

So it should be OK.
Comment 8 David Faure 2004-06-09 11:43:50 UTC
On Wednesday 09 June 2004 11:32, Mantia Andras wrote:
> Indeed. S/MIME is disabled under GpgMe, OpenPgp/gpg is not, but if I check it, close the dialog, go back to the configuration dialog it is not checked anymore. This is what I mean when I said that I can't select GpgMe.
Ah there's the bug then.
It's unchecked, but not disabled, right?

Do you get 
[Backends]
OpenPGP=gpgme
in libkleopatrarc after selecting gpgme for OpenPGP support?

I'm afraid the next step is going to be about debugging cryptobackendfactory, see
Kleo::CryptoBackendFactory in kdepim/certmanager/lib/kleo.
readConfig() reads the above, and uses backendByName() to find the gpgme backend.

Do you get any errors (other than for s/mime) when using the Rescan button
in kmail's configuration dialog?

Comment 9 András Manţia 2004-06-09 12:00:53 UTC
> Ah there's the bug then. 
> It's unchecked, but not disabled, right? 
Yes. It's there, it's checkable, but it won't remember the setting.
 
> Do you get 
> [Backends] 
> OpenPGP=gpgme 
> in libkleopatrarc after selecting gpgme for OpenPGP support? 
No, it remains:
[Backends]
OpenPGP=Kpgp/gpg1

I have manually changed to gpgme, now it KMail crashes on mail sending without showing the warning messages. The backtrace is the same as in the original report.
 
> I'm afraid the next step is going to be about debugging cryptobackendfactory, > see 
> Kleo::CryptoBackendFactory in kdepim/certmanager/lib/kleo. 
>readConfig() reads the above, and uses backendByName() to find the gpgme backend. 

I don't think it's a simple configuration changing/storage error, see above.
Of course, there is also an error, as now I cannot change back to Kpgp/gpg. 

> Do you get any errors (other than for s/mime) when using the Rescan button 
> in kmail's configuration dialog? 
No, those are the only ones.


Comment 10 David Faure 2004-06-09 16:56:42 UTC
CVS commit by faure: 

Added changed() signal to BackendConfigWidget so that changes are saved.
CCMAIL: 83086@bugs.kde.org


  M +7 -2      certmanager/lib/ui/backendconfigwidget.cpp   1.6
  M +5 -0      certmanager/lib/ui/backendconfigwidget.h   1.3
  M +1 -0      kmail/configuredialog.cpp   1.458


--- kdepim/kmail/configuredialog.cpp  #1.457:1.458
@@ -3719,4 +3719,5 @@ SecurityPageCryptPlugTab::SecurityPageCr
 
   mBackendConfig = Kleo::CryptoBackendFactory::instance()->configWidget( this, "mBackendConfig" );
+  connect( mBackendConfig, SIGNAL( changed( bool ) ), this, SIGNAL( changed( bool ) ) );
 
   vlay->addWidget( mBackendConfig );

--- kdepim/certmanager/lib/ui/backendconfigwidget.cpp  #1.5:1.6
@@ -74,5 +74,5 @@ class Kleo::BackendListView : public KLi
 {
 public:
-  BackendListView( QWidget* parent, const char* name = 0 )
+  BackendListView( BackendConfigWidget* parent, const char* name = 0 )
     : KListView( parent, name ) {}
 
@@ -85,4 +85,6 @@ public:
   /// deselect all except one for a given protocol type (radiobutton-like exclusivity)
   void deselectAll( ProtocolType protocolType, QCheckListItem* except );
+
+  void emitChanged() { static_cast<BackendConfigWidget *>( parentWidget() )->emitChanged( true ); }
 };
 
@@ -127,7 +129,9 @@ public:
 protected:
   virtual void stateChange( bool b ) {
+    BackendListView* lv = static_cast<BackendListView *>( listView() );
     // "radio-button-like" behavior for the protocol checkboxes
     if ( b )
-      static_cast<BackendListView *>( listView() )->deselectAll( mProtocolType, this );
+      lv->deselectAll( mProtocolType, this );
+    lv->emitChanged();
     QCheckListItem::stateChange( b );
   }
@@ -293,4 +297,5 @@ void Kleo::BackendConfigWidget::slotResc
                                   reasons, i18n("Scan Results") );
   load();
+  emit changed( true );
 }
 

--- kdepim/certmanager/lib/ui/backendconfigwidget.h  #1.2:1.3
@@ -54,4 +54,9 @@ namespace Kleo {
     void save() const;
 
+    void emitChanged( bool b ) { emit changed( b ); }
+
+  signals:
+    void changed( bool );
+
   private slots:
     void slotSelectionChanged( QListViewItem * );


Comment 11 David Faure 2004-06-09 17:41:22 UTC
On Wednesday 09 June 2004 12:00, Mantia Andras wrote:
> Of course, there is also an error, as now I cannot change back to Kpgp/gpg. 
That's fixed now.

But I see what the real problem is. KMail thinks your own key is invalid (and refuses
to sign with it) due to gpgme-copy not having validating keylisting stuff.

I will update gpgme-copy later tonight or tomorrow.

Comment 12 András Manţia 2004-06-09 19:16:01 UTC
On Wednesday 09 June 2004 18:41, David Faure wrote:
> I will update gpgme-copy later tonight or tomorrow.

I've updated gpgme to 0.9.0. That should be enough as now I have:
configure:42985: checking for gpgme-config
configure:43003: found /usr/bin/gpgme-config
configure:43016: result: /usr/bin/gpgme-config
configure:43035: checking for GPGME - version >= 0.4.4
configure:43064: result: yes

I rebuild kdepim, yet the problem remains. I don't get the warnings 
anymore, instead KMail crashes when sending the mail if I selected it 
to be signed with inline opengpg, and refuses to send (without any 
message) for other cases. BT below (now without debug info as I forgot 
to add --enable-debug and don't want to recompiled again). 

Regarding the settings: I still cannot change away from gpgme. 

Andras

Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 9198)]
[KCrash handler]
#5  0x421b1871 in kill () from /lib/libc.so.6
#6  0x42050501 in pthread_kill () from /lib/libpthread.so.0
#7  0x4205054b in raise () from /lib/libpthread.so.0
#8  0x421b1604 in raise () from /lib/libc.so.6
#9  0x421b2aac in abort () from /lib/libc.so.6
#10 0x421aa99a in __assert_fail () from /lib/libc.so.6
#11 0x403a33d4 in MessageComposer::composeInlineOpenPGPMessage ()
    at kdatastream.h:6
#12 0x403a400b in MessageComposer::composeMessage () at kdatastream.h:6
#13 0x403a598a in MessageComposer::composeMessage () at kdatastream.h:6
#14 0x403aae9f in ComposeMessageJob::execute () at kdatastream.h:6
#15 0x403a8dbe in MessageComposer::slotDoNextJob () at kdatastream.h:6
#16 0x403a8ec9 in MessageComposer::qt_invoke () at kdatastream.h:6
#17 0x4195cf1b in QObject::activate_signal (this=0x82d9208, 
clist=0x86cf2d8, 
    o=0xbfffeb70) at kernel/qobject.cpp:2356
#18 0x41cb40b4 in QSignal::signal (this=0x82d9208, t0=@0x82d9230)
    at .moc/debug-shared-mt/moc_qsignal.cpp:100
#19 0x4197a673 in QSignal::activate (this=0x82d9208) at 
kernel/qsignal.cpp:212
#20 0x41981b8b in QSingleShotTimer::event (this=0x82d91e0)
    at kernel/qtimer.cpp:277
#21 0x418fa45b in QApplication::internalNotify (this=0xbffff1c0, 
    receiver=0x82d91e0, e=0xbfffee50) at kernel/qapplication.cpp:2620
#22 0x418f9918 in QApplication::notify (this=0xbffff1c0, 
receiver=0x82d91e0, 
    e=0xbfffee50) at kernel/qapplication.cpp:2343
#23 0x41435917 in KApplication::notify () 
from /opt/kde-cvs/lib/libkdecore.so.4
#24 0x41890531 in QApplication::sendEvent (receiver=0x82d91e0, 
    event=0xbfffee50) at qapplication.h:491
#25 0x418e872a in QEventLoop::activateTimers (this=0x8178170)
    at kernel/qeventloop_unix.cpp:558
#26 0x418a22d4 in QEventLoop::processEvents (this=0x8178170, flags=4)
    at kernel/qeventloop_x11.cpp:389
#27 0x4190e622 in QEventLoop::enterLoop (this=0x8178170)
    at kernel/qeventloop.cpp:198
#28 0x4190e53e in QEventLoop::exec (this=0x8178170)
    at kernel/qeventloop.cpp:145
#29 0x418fa5db in QApplication::exec (this=0xbffff1c0)
    at kernel/qapplication.cpp:2743
#30 0x0804ac60 in main ()



Comment 13 András Manţia 2004-06-09 19:52:34 UTC
Ok, even more (bad?) news: I've downloaded and installed the latest gnupg (1.9.9) and all its requirement libraries. Now I can select S/MIME encryption. The results are:
- inline opengpg crashes as I said
- S/MIME complains about my key ("You have requested to sign this message, but no valid signing keys have been configured for this identity.
If you choose to continue, no signing will be performed.")
- I've changed the expiration for my key from Unlimited to some day in the future, but the problem remains
- with or without gpg-agent, I cannot select keys for S/MIME for the identities (Re-read doesn't give me any key).
- if GpgMe/OpenPGP is not checked, I cannot select OpenPGP keys for identities
- after I change the GpgMe/OpenPGP setting, I have to restart KMail, otherwise it won't read the keys for the identities

From what I see the problems may have the source in not recognizing my key as valid anymore. This worked before for OpenPGP, I never tried S/MIME until now.
Comment 14 András Manţia 2004-06-09 23:46:11 UTC
*** Bug 83081 has been marked as a duplicate of this bug. ***
Comment 15 David Faure 2004-06-10 00:24:25 UTC
On Wednesday 09 June 2004 19:16, Mantia Andras wrote:
> I rebuild kdepim, yet the problem remains. I don't get the warnings 
> anymore, instead KMail crashes when sending the mail if I selected it 
> to be signed with inline opengpg, and refuses to send (without any 
> message) for other cases. BT below (now without debug info as I forgot 
> to add --enable-debug and don't want to recompiled again). 

OK, that's the gpgme problem I've been hitting too. I'm quite sure it's a backend bug,
but I didn't manage to get the backend people to fix it yet.

Do you also see that gpg-agent dies? (it just disappears from the ps list)

Here's a workaround if you're interested: fire kwatchgnupg and set the debug level
to the maximum. Then restart gpg-agent. For me it makes signing work all of a sudden,
which is rather unexplicable.

I just mailed the backend people again, I hope they'll fix it soon.

> Regarding the settings: I still cannot change away from gpgme. 
Huh? Did you really update and reinstall all of kdepim, at least certmanager and kmail?
I'm quite sure the setting is saved now.

Comment 16 András Manţia 2004-06-10 08:31:10 UTC
On Thursday 10 June 2004 01:24, David Faure wrote:
> OK, that's the gpgme problem I've been hitting too. I'm quite sure
> it's a backend bug, but I didn't manage to get the backend people to
> fix it yet.
>
> Do you also see that gpg-agent dies? (it just disappears from the ps
> list)
No, it is there after KMail crashes.

> Here's a workaround if you're interested: fire kwatchgnupg and set
> the debug level to the maximum. Then restart gpg-agent. For me it
> makes signing work all of a sudden, which is rather unexplicable.
It doesn't help, KMail is still crashing here.

> > Regarding the settings: I still cannot change away from gpgme.
>
> Huh? Did you really update and reinstall all of kdepim, at least
> certmanager and kmail? I'm quite sure the setting is saved now.
Yes, sure. Try the following (assuming the selected backend is 
Gpgme/openpgp):
- set the backend to kgpg/gpg1
- close the dialog
- open the config dialog
- the selected backend is still the gpgme/opengpg
- now quit and restart KMail
- the selected backend is kgpg/gpg1

Comment 17 David Faure 2004-06-10 13:49:12 UTC
CVS commit by faure: 

Really set the backend when the user changes the backend in the configuration dialog.
CCMAIL: 83086@bugs.kde.org


  M +2 -0      cryptobackendfactory.cpp   1.2


--- kdepim/certmanager/lib/kleo/cryptobackendfactory.cpp  #1.1:1.2
@@ -156,4 +156,5 @@ void Kleo::CryptoBackendFactory::setSMIM
   KConfigGroup group( configObject(), "Backends" );
   group.writeEntry( "SMIME", name );
+  mSMIMEBackend = backend;
 }
 
@@ -162,4 +163,5 @@ void Kleo::CryptoBackendFactory::setOpen
   KConfigGroup group( configObject(), "Backends" );
   group.writeEntry( "OpenPGP", name );
+  mOpenPGPBackend = backend;
 }
 


Comment 18 David Faure 2004-06-10 13:52:26 UTC
On Thursday 10 June 2004 08:31, Mantia Andras wrote:
> It doesn't help, KMail is still crashing here.

Strange. Maybe it's when I do it in combination with
GPGME_DEBUG=5:/tmp/gpgme.log kmail

If you manage to get the signing bug while doing the above, and with gpg-agent running (and not dying),
can you please send me the log? I didn't manage to get that, since it magically works at that point.

> > > Regarding the settings: I still cannot change away from gpgme.
Fixed for real now.

Comment 19 András Manţia 2004-06-10 14:13:57 UTC
I send the log in private. Now before dying, I got a "Broken pipe" error dialog from KMail. Here is the output to the console:
andris@stein:~> export GPGME_DEBUG=5:/tmp/gpgme.log kmail
andris@stein:~> eval `gpg-agent --daemon`
andris@stein:~> printenv | grep GPG
GPG_AGENT_INFO=/tmp/gpg-lnXdPs/S.gpg-agent:9107:1
GPGME_DEBUG=5:/tmp/gpgme.log
andris@stein:~> kmail: [bool KIMProxy::initialize()]
kmail:  app name: Kopete dcopService: kopete
QMetaObject::findSignal:KMail::IdentityListView: Conflict with QListView::doubleClicked(QListViewItem*,const QPoint&,int)
libkleopatra: WARNING: [void QGpgMECryptoConfigComponent::runGpgConf()] :Operation not permitted
libkleopatra: WARNING: [void QGpgMECryptoConfigComponent::runGpgConf()] :Operation not permitted
kmail: WARNING: Backend error: gpgconf doesn't seem to know the entry for dirmngr/OCSP/allow-ocsp
kmail: WARNING: Backend error: gpgconf doesn't seem to know the entry for dirmngr/OCSP/ocsp-responder
kmail: WARNING: Backend error: gpgconf doesn't seem to know the entry for dirmngr/OCSP/ocsp-signer
empty
Format info for inline openpgp:
  Signing keys: CE8BFF4F
  SplitInfo #0 encryption keys:
  SplitInfo #0 recipients: test
Format info for inline openpgp:
  Signing keys: CE8BFF4F
  SplitInfo #0 encryption keys:
  SplitInfo #0 recipients: test
Format info for inline openpgp:
  Signing keys: CE8BFF4F
  SplitInfo #0 encryption keys:
  SplitInfo #0 recipients: test
Format info for inline openpgp:
  Signing keys: CE8BFF4F
  SplitInfo #0 encryption keys:
  SplitInfo #0 recipients: test
Format info for inline openpgp:
  Signing keys: CE8BFF4F
  SplitInfo #0 encryption keys:
  SplitInfo #0 recipients: test
Format info for inline openpgp:
  Signing keys: CE8BFF4F
  SplitInfo #0 encryption keys:
  SplitInfo #0 recipients: test
Format info for inline openpgp:
  Signing keys: CE8BFF4F
  SplitInfo #0 encryption keys:
  SplitInfo #0 recipients: test
GpgME::Data(): DataProvider supports: read, write, seek, release
GpgME::Data(): DataProvider supports: read, write, seek, release
QGpgME::QByteArrayDataProvider::read( 0x86a4430, 4096 )
QGpgME::QByteArrayDataProvider::release()
QGpgME::QByteArrayDataProvider::release()
kmail: /data/development/sources/kde-head/kdepim/kmail/messagecomposer.cpp:1048: void MessageComposer::composeInlineOpenPGPMessage(KMMessage&, bool, bool): Assertion `!mSignature.isNull()' failed.
*** KMail got signal 6 (Crashing)
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = kmail path = <unknown> pid = 9151
Comment 20 David Faure 2004-06-10 14:35:21 UTC
On Thursday 10 June 2004 14:14, Mantia Andras wrote:
> I send the log in private. Now before dying, I got a "Broken pipe" error dialog from KMail.
I saw that too. Can you confirm that gpg-agent is NOT running anymore, after the broken pipe error happens?

Comment 21 András Manţia 2004-06-10 14:39:43 UTC
gpg-agent IS running for me after the broken pipe (and KMail crash).

gpg-agent --version
gpg-agent[11310]: Secure memory is not locked into core
gpg-agent (GnuPG) 1.9.9
Copyright (C) 2004 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.
Comment 22 Ingo Klöcker 2004-06-11 01:18:50 UTC
I just want to mention that I can send signed and/or encrypted messages with KMail HEAD. Thus it's either a configuration problem or a backend problem. I'm considering to close this bug report as invalid.

I also tested this with a new user. Settings:
~/.gnupg/gpg.conf
use-agent

~/.gnupg/gpg-agent.conf
no-grab
pinentry-program /usr/bin/pinentry-qt
debug 1024

Used GnuPG stuff:
Stock SuSE 8.2 packages + newer self-built RPMs (cf. kmail.ingo-kloecker.de)

I've created a test key for this user.

Then I started kmail, added an email address and the signing/encryption keys to the default identity and added a sending account.

The following worked:
- Signing (inline and PGP/MIME)
- Encryption (only PGP/MIME; even if I select "inline" the message is PGP/MIME encrypted)
- Verification of PGP/MIME signed messages
- Decryption + verification of PGP/MIME signed + encrypted messages

The following doesn't work:
- Verification of clearsigned messages
- Decryption of clearsigned messages

This is with kdepim from 2004-06-10 23:00.
Comment 23 Cornelius Schumacher 2004-06-11 01:41:18 UTC
After updating to the absolutely latest version of HEAD and selecting "OpenPGP (gpg)" as crypto backend it also works for me again.
Comment 24 András Manţia 2004-06-11 10:20:34 UTC
Finally, I got it working. Here are the steps:

1. I removed the self installed gpg stuff and restored the one shipped 
with SuSE 9.1 (just to make sure that gpgme-copy is used)
2. updated and recomplied kdepim

After these steps KMail crashed in the same way as before. I've started 
to modify the gpg-agent.conf and gpg.conf to have the same as Ingo has.
This made signing in KMail working again! OK, so where is the problem?

In gpg.conf there was no "use-agent" for me, but this wasn't the problem 
as I've tried both with and without use-agent now, and it works in both 
cases. I don't have use-agent now.

My original gpg-agent.conf looked like:
###+++--- GPGConf ---+++###
debug-level guru
log-file socket:///home/andris/.gnupg/log-socket
###+++--- GPGConf ---+++### Thu 10 Jun 2004 03:10:32 PM EEST
# GPGConf edited this configuration file.
# It will disable options before this marked block, but it will
# never change anything below these lines.

I've added the pinenentry-program yesterday to it, but it made no 
difference. My current gpg-agent complained about errors in the file, 
so I cleared up and I have now only one line:
pinentry-program /usr/bin/pinentry-qt

Now it works. So I don't have the slightest idea where is the 
configuration problem. 

Still, don't close the report because:
1. KMail crashes if gpg-agent is not running (should give some useful 
error message instead)
2. The requirements were changed (gpg-agent is required), and looks like 
some configuration is also needed in order to make it work. There will 
be many who will find signing broken once they install kdepim 3.3.
Just try kdepim CVS HEAD on a clean system and see if it works without 
manually tweaking configuration files or not. If it needs manual 
configuration, I think it's far from being nice and user friendly.
Comment 25 Martin Koller 2004-06-11 19:57:07 UTC
On Friday 11 June 2004 01:41, Cornelius Schumacher wrote:
> After updating to the absolutely latest version of HEAD and
> selecting "OpenPGP (gpg)" as crypto backend it also works for me again.

I also updated now, but it still does not work. I have exactly the same 
problem you described in your mail to the kmail list.

I'm still using "OpenPGP (Kpgp/gpg1)"

Comment 26 ralphdewitt 2004-06-12 03:20:25 UTC
I have a similar situation with Kmail 1.6.52 and KDE 3.2.3 running on SuSE 9.1. I am unable to digitally sign mails The Settings, Security tab, crypto backends tab, states that GpgMe is compiled without Openpgp and S/MIME support, I have selected Kpgp/gpg1 as my backend but am unable to digitally sign mail. I believe I have all the latest SuSE 9.1 rpm's installed.
Comment 27 Thiago Macieira 2004-06-12 20:19:26 UTC
I'm also having this problem.

If I set the backend to OpenPGP, I can sign messages normally, both using the Inline/OpenPGP method and using OpenPGP/MIME.

However, if I set it to Kgpg/gpg1, KMail shows the error message
"This message could not be signed, since the chosen backend does not seem to support signing; this should actually never happen, please report this bug."
for both OpenPGP/MIME and Inline/OpenPGP, with the plus that, for the latter case, it also crashes with the same failed assertion as the original report.

This is HEAD from a few hours ago, and I'm recompiling again with debugging enabled. I'm using gnupg 1.2.4 and libgpgme-copy (my distro ships 0.3.16), gpg-agent is running and has never crashed.
Comment 28 David Faure 2004-06-21 12:31:10 UTC
The famous gpgme bug which prevented signing has just been fixed.

Please apply the attached patch to your gpgme-1.9.x



Created an attachment (id=6428)
jnlib_logging.c.diff
Comment 29 David Faure 2004-06-21 16:16:59 UTC
On Monday 21 June 2004 12:31, David Faure wrote:
> Please apply the attached patch to your gpgme-1.9.x
Sorry, I meant gnupg-1.9.x

Comment 30 David Faure 2004-07-13 14:10:19 UTC
You need gnupg-1.3.x (or 1.2.5 when it's out), see bug 85009.

Comment 31 András Manţia 2004-07-13 15:51:09 UTC
So isn't this a duplicate of 85009 (or vice versa)?

I didn't had time to test KMail more (nor to update since some time), 
but I will do in the next days as it seems that if I send an encrypted 
mail the receiver cannot read it. I will check with an up to date 
version and report in the following days.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA8+lOTQdfac6L/08RArAyAKC9p5p9/LPVp2cE67S38Ooph0K5OgCeJXas
vEOxQCwZkIO3bBAqDmDvZdg=
=jHpz
-----END PGP SIGNATURE-----

Comment 32 David Faure 2004-07-13 16:48:22 UTC

*** This bug has been marked as a duplicate of 85009 ***
Comment 33 Tom Albers 2004-07-13 17:25:17 UTC
*** Bug 84970 has been marked as a duplicate of this bug. ***