Bug 136391 - Mailody does not show connect with cpanel or dovecot (SSL) imap server
Summary: Mailody does not show connect with cpanel or dovecot (SSL) imap server
Status: RESOLVED FIXED
Alias: None
Product: mailody
Classification: Miscellaneous
Component: general (show other bugs)
Version: 0.2.0-beta1
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Tom Albers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-27 18:25 UTC by David Bremner
Modified: 2006-11-05 18:09 UTC (History)
0 users

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 Bremner 2006-10-27 18:25:20 UTC
Version:           0.2.0-beta1 (using KDE 3.5.5, Debian Package 4:3.5.5a-1 (testing/unstable))
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.18-1-686

Probably this should be two different bug reports, but...

I tried setting the imap server in mailody to connect to 
a cpanel (not really sure, but thats what the greeting says) imap4rev1 server
and to a dovecot imaps server (running SSL on port 443).

In neither case was I able to see any mailboxes or messages.

The third test case was a "Communigate Pro IMAP Server 4.2.9", where apparently I 
have forgotten my password. (at least that is what kmail and sylpheed tell me)
With mailody, I just got "mailody: connecting to server.domain.tld143" and
then nothing. So maybe a login failure dialog is needed?
Comment 1 Tom Albers 2006-10-28 01:55:38 UTC
It might be that switching mailservers is not bug free, you might be bitten by that. I've just installed dovecot-imapd 1.0-rc2 and it works flawless for me.
Comment 2 Tom Albers 2006-10-29 15:07:49 UTC
Op zo 29 okt 2006 14:18 schreef u:
> To check the switch mailservers idea, I did a clean install on 
> a different debian testing machine,  and still no luck connecting to 
> dovecot over ssl.
> 
> The debugging output looks like: 
> 
> [ 40 quixote ~ ]  mailody
> [ 41 quixote ~ ]  mailody: DB CONSTRUCTOR called
> mailody: TLS not supported!
> mailody: IMAPS Connecting to : 135567204
> QGDict::hashKeyString: Invalid null key
> QGDict::hashKeyString: Invalid null key
> QGDict::hashKeyString: Invalid null key
> QGDict::hashKeyString: Invalid null key
> [repeated many times]
> 
> Could it be trying a TLS dialog even though I selected SSL in the
> setup?

The encryption of TLS is the same as for SSL. Your console shows that TLS is not supported. Did you compile Mailody manually? What was the end of the configure command? Did it tell you QCA was installed?
Comment 3 Tom Albers 2006-11-03 00:23:35 UTC
any news on this?
Comment 4 Tom Albers 2006-11-05 18:09:44 UTC
SVN commit 602297 by toma:

Properly detect if SSL/TLS is possible and warn about it. Disable the settings if needed. CLosing the bugs which I think are related to this.
BUG:136391,136460
CCBUG: 136670


 M  +6 -0      global.cpp  
 M  +5 -0      global.h  
 M  +22 -4     setupaccount.cpp  
 M  +10 -6     socketsafe.cpp  


--- trunk/playground/pim/mailody/src/global.cpp #602296:602297
@@ -20,6 +20,7 @@
 #include <kabc/stdaddressbook.h>
 #include <kapplication.h>
 #include <krun.h>
+#include <qca.h>
 #include "../libkmime/kmime_headers.h"
 #include "global.h"
 
@@ -88,3 +89,8 @@
     }
     return address;
 }
+
+bool Global::cryptoConnectionSupported()
+{
+    return QCA::isSupported(QCA::CAP_TLS);
+}
--- trunk/playground/pim/mailody/src/global.h #602296:602297
@@ -60,6 +60,11 @@
          */
         static QString myEmail();
 
+        /**
+         * will return true when it is possible to use SSL or TLS
+         */
+        static bool cryptoConnectionSupported();
+
     private:
         static Global* m_instance;
 };
--- trunk/playground/pim/mailody/src/setupaccount.cpp #602296:602297
@@ -48,6 +48,7 @@
 using KWallet::Wallet;
 
 // Local includes.
+#include "global.h"
 #include "setupaccount.h"
 
 class SetupAccountPriv
@@ -110,8 +111,8 @@
     d->safeImap = new QButtonGroup(3, Qt::Horizontal, parent);
     d->safeImap->setExclusive(true);
     new QRadioButton(i18n("None"), d->safeImap);
-    new QRadioButton(i18n("SSL"), d->safeImap);
-    new QRadioButton(i18n("TLS"), d->safeImap);
+    QRadioButton* sslRadioI = new QRadioButton(i18n("SSL"), d->safeImap);
+    QRadioButton* tlsRadioI = new QRadioButton(i18n("TLS"), d->safeImap);
     m->addWidget(d->safeImap,3,1);
     l5->setBuddy(d->safeImap);
 
@@ -151,8 +152,8 @@
     d->safeSMTP = new QButtonGroup(3, Qt::Horizontal, parent);
     d->safeSMTP->setExclusive(true);
     new QRadioButton("None", d->safeSMTP);
-    new QRadioButton("SSL", d->safeSMTP);
-    new QRadioButton("TLS", d->safeSMTP);
+    QRadioButton* sslRadioS = new QRadioButton("SSL", d->safeSMTP);
+    QRadioButton* tlsRadioS = new QRadioButton("TLS", d->safeSMTP);
     m->addWidget(d->safeSMTP,7,1);
     l5->setBuddy(d->safeSMTP);
 
@@ -165,6 +166,23 @@
     l8->setBuddy(d->homePage);
 
     readSettings();
+
+    if(!Global::cryptoConnectionSupported())
+    {
+        tlsRadioI->setEnabled(false);
+        tlsRadioS->setEnabled(false);
+        sslRadioI->setEnabled(false);
+        sslRadioS->setEnabled(false);
+        d->safeSMTP->setButton(0);
+        d->safeImap->setButton(0);
+
+        KMessageBox::information(0,i18n("Your system does not seem to be "
+                                        "setup for TLS or SSL, these settings "
+                                        "are disabled. Install QCA and "
+                                        "recompile Mailody or contact your "
+                                        "distribution"),
+                                 QString::null, "TLS_SSL_DISABLED");
+    }
 }
 
 SetupAccount::~SetupAccount()
--- trunk/playground/pim/mailody/src/socketsafe.cpp #602296:602297
@@ -32,6 +32,7 @@
 #include <qca.h>
 
 #include "db.h"
+#include "global.h"
 #include "socketsafe.h"
 
 SocketSafe::SocketSafe(QObject* parent, const QString& server,
@@ -44,12 +45,6 @@
     , m_gather(false)
     , m_crypted(false)
 {
-    if(!QCA::isSupported(QCA::CAP_TLS))
-    {
-        kdDebug() << "TLS not supported!" << endl;
-        return;
-    }
-
     m_server = server;
     m_port = port;
     m_safe = safe;
@@ -68,6 +63,15 @@
             << "TLS: " <<  (m_safe == TLS) << endl;
 #endif
 
+    if(!Global::cryptoConnectionSupported())
+    {
+        kdDebug() << "Crypto not supported!" << endl;
+        if (m_safe == TLS || m_safe == SSL)
+            emit error(i18n("You requested TLS/SSL, but your "
+                    "system does not seem to be setup for that."));
+        return;
+    }
+
     m_crypted=false;
 
     if (!m_socket)