Bug 136460 - qmail mailserver does not work
Summary: qmail mailserver does not work
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-29 15:48 UTC by Tom Albers
Modified: 2006-11-05 18:09 UTC (History)
1 user (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 Tom Albers 2006-10-29 15:48:04 UTC
Version:           0.2.0-beta1 (using KDE 3.5.4, Kubuntu (edgy) 4:3.5.4-0ubuntu18)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.17-6-k7

import:
> i entered the (correct) data for my mailserver, but mailody just shows an
> empty window...
> no progressbars, no errors. i tried getting the mailbox list and syncing, but
> it never seems to do anything at all (at least not obvious to the user). any
> clue?

Can you paste the output from Konsole?
Comment 1 Tom Albers 2006-11-03 00:24:00 UTC
any news on this?
Comment 2 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)