summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tdeioslave/imap4/imap4.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/tdeioslave/imap4/imap4.cc b/tdeioslave/imap4/imap4.cc
index 736807748..a50ab2f0f 100644
--- a/tdeioslave/imap4/imap4.cc
+++ b/tdeioslave/imap4/imap4.cc
@@ -95,6 +95,8 @@ extern "C" {
#define IMAP_PROTOCOL "imap"
#define IMAP_SSL_PROTOCOL "imaps"
+#define IMAP_PORT 143
+#define IMAPS_PORT 993
using namespace TDEIO;
@@ -631,7 +633,10 @@ IMAP4Protocol::setHost (const TQString & _host, int _port,
if (!myHost.isEmpty ())
closeConnection ();
myHost = _host;
- myPort = _port;
+ if (_port == 0)
+ myPort = (mySSL) ? IMAPS_PORT : IMAP_PORT;
+ else
+ myPort = _port;
myUser = _user;
myPass = _pass;
}