summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper
authorharlekin <harlekin>2004-01-10 00:32:04 (UTC)
committer harlekin <harlekin>2004-01-10 00:32:04 (UTC)
commit76cf4990cb4171a747ac31e9832f4ee694ced2cc (patch) (unidiff)
treece97c1b6b6e9f832cc09a71fe3e8e87551bb01bd /noncore/net/mail/libmailwrapper
parent241fb3509f6b62efda3c89f5bf9cec0dfba86b43 (diff)
downloadopie-76cf4990cb4171a747ac31e9832f4ee694ced2cc.zip
opie-76cf4990cb4171a747ac31e9832f4ee694ced2cc.tar.gz
opie-76cf4990cb4171a747ac31e9832f4ee694ced2cc.tar.bz2
new connection setting stuff for imap too
Diffstat (limited to 'noncore/net/mail/libmailwrapper') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.cpp12
-rw-r--r--noncore/net/mail/libmailwrapper/settings.cpp2
2 files changed, 13 insertions, 1 deletions
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
index 4b633ea..1c22c26 100644
--- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
@@ -77,14 +77,24 @@ void IMAPwrapper::login()
77 user = account->getUser().latin1(); 77 user = account->getUser().latin1();
78 pass = account->getPassword().latin1(); 78 pass = account->getPassword().latin1();
79 } 79 }
80 80
81 m_imap = mailimap_new( 20, &imap_progress ); 81 m_imap = mailimap_new( 20, &imap_progress );
82 82
83
84
83 /* connect */ 85 /* connect */
84 if (account->getSSL()) { 86
87 bool ssl = false;
88
89 if ( account->ConnectionType() == 2 ) {
90 ssl = true;
91 }
92
93 if ( ssl ) {
94 qDebug( "using ssl" );
85 err = mailimap_ssl_connect( m_imap, (char*)server, port ); 95 err = mailimap_ssl_connect( m_imap, (char*)server, port );
86 } else { 96 } else {
87 err = mailimap_socket_connect( m_imap, (char*)server, port ); 97 err = mailimap_socket_connect( m_imap, (char*)server, port );
88 } 98 }
89 99
90 if ( err != MAILIMAP_NO_ERROR && 100 if ( err != MAILIMAP_NO_ERROR &&
diff --git a/noncore/net/mail/libmailwrapper/settings.cpp b/noncore/net/mail/libmailwrapper/settings.cpp
index 7b6a58d..3279f39 100644
--- a/noncore/net/mail/libmailwrapper/settings.cpp
+++ b/noncore/net/mail/libmailwrapper/settings.cpp
@@ -161,12 +161,13 @@ void IMAPaccount::read()
161 accountName = conf->readEntry( "Account","" ); 161 accountName = conf->readEntry( "Account","" );
162 if (accountName.isNull()) accountName = ""; 162 if (accountName.isNull()) accountName = "";
163 server = conf->readEntry( "Server","" ); 163 server = conf->readEntry( "Server","" );
164 if (server.isNull()) server=""; 164 if (server.isNull()) server="";
165 port = conf->readEntry( "Port","" ); 165 port = conf->readEntry( "Port","" );
166 if (port.isNull()) port="143"; 166 if (port.isNull()) port="143";
167 connectionType = conf->readNumEntry( "ConnectionType" );
167 ssl = conf->readBoolEntry( "SSL",false ); 168 ssl = conf->readBoolEntry( "SSL",false );
168 user = conf->readEntry( "User","" ); 169 user = conf->readEntry( "User","" );
169 if (user.isNull()) user = ""; 170 if (user.isNull()) user = "";
170 password = conf->readEntryCrypt( "Password","" ); 171 password = conf->readEntryCrypt( "Password","" );
171 if (password.isNull()) password = ""; 172 if (password.isNull()) password = "";
172 prefix = conf->readEntry("MailPrefix",""); 173 prefix = conf->readEntry("MailPrefix","");
@@ -183,12 +184,13 @@ void IMAPaccount::save()
183 Config *conf = new Config( getFileName(), Config::File ); 184 Config *conf = new Config( getFileName(), Config::File );
184 conf->setGroup( "IMAP Account" ); 185 conf->setGroup( "IMAP Account" );
185 conf->writeEntry( "Account", accountName ); 186 conf->writeEntry( "Account", accountName );
186 conf->writeEntry( "Server", server ); 187 conf->writeEntry( "Server", server );
187 conf->writeEntry( "Port", port ); 188 conf->writeEntry( "Port", port );
188 conf->writeEntry( "SSL", ssl ); 189 conf->writeEntry( "SSL", ssl );
190 conf->writeEntry( "ConnectionType", connectionType );
189 conf->writeEntry( "User", user ); 191 conf->writeEntry( "User", user );
190 conf->writeEntryCrypt( "Password", password ); 192 conf->writeEntryCrypt( "Password", password );
191 conf->writeEntry( "MailPrefix",prefix); 193 conf->writeEntry( "MailPrefix",prefix);
192 conf->writeEntry( "Offline",offline); 194 conf->writeEntry( "Offline",offline);
193 conf->write(); 195 conf->write();
194 delete conf; 196 delete conf;