From 4aacbe5b9ef8a4188b8196d261e06ca2a7ce25e3 Mon Sep 17 00:00:00 2001 From: Jakub Stachowski Date: Sun, 4 May 2008 10:32:25 +0000 Subject: [PATCH] Default port for imap and imaps. Before after typing imap://server/ in konqueror, slave would try to connect to port 0. Cherry-picked from: b35c00016dd671aca964907d76aa5a2ed4bc15cc Signed-off-by: Luke Dashjr --- tdeioslave/imap4/imap4.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tdeioslave/imap4/imap4.cc b/tdeioslave/imap4/imap4.cc index 73680774..a50ab2f0 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; }