summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/editaccounts.cpp21
-rw-r--r--noncore/net/mail/editaccounts.h2
-rw-r--r--noncore/net/mail/imapconfigui.ui159
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.cpp36
-rw-r--r--noncore/net/mail/libmailwrapper/settings.cpp2
5 files changed, 129 insertions, 91 deletions
diff --git a/noncore/net/mail/editaccounts.cpp b/noncore/net/mail/editaccounts.cpp
index 9fc97e8..1cb202e 100644
--- a/noncore/net/mail/editaccounts.cpp
+++ b/noncore/net/mail/editaccounts.cpp
@@ -268,9 +268,18 @@ IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name,
268 268
269 connect( sslBox, SIGNAL( toggled( bool ) ), SLOT( slotSSL( bool ) ) ); 269 connect( ComboBox1, SIGNAL( activated( int ) ), SLOT( slotConnectionToggle( int ) ) );
270 ComboBox1->insertItem( "Only if available", 0 );
271 ComboBox1->insertItem( "Always, Negotiated", 1 );
272 ComboBox1->insertItem( "Connect on secure port", 2 );
273 ComboBox1->insertItem( "Run command instead", 3 );
274 CommandEdit->hide();
275 ComboBox1->setCurrentItem( data->ConnectionType() );
270} 276}
271 277
272void IMAPconfig::slotSSL( bool enabled ) 278void IMAPconfig::slotConnectionToggle( int index )
273{ 279{
274 if ( enabled ) { 280 if ( index == 2 ) {
275 portLine->setText( IMAP_SSL_PORT ); 281 portLine->setText( IMAP_SSL_PORT );
282 } else if ( index == 3 ) {
283 portLine->setText( IMAP_PORT );
284 CommandEdit->show();
276 } else { 285 } else {
@@ -285,3 +294,3 @@ void IMAPconfig::fillValues()
285 portLine->setText( data->getPort() ); 294 portLine->setText( data->getPort() );
286 sslBox->setChecked( data->getSSL() ); 295 ComboBox1->setCurrentItem( data->ConnectionType() );
287 userLine->setText( data->getUser() ); 296 userLine->setText( data->getUser() );
@@ -296,3 +305,3 @@ void IMAPconfig::accept()
296 data->setPort( portLine->text() ); 305 data->setPort( portLine->text() );
297 data->setSSL( sslBox->isChecked() ); 306 data->setConnectionType( ComboBox1->currentItem() );
298 data->setUser( userLine->text() ); 307 data->setUser( userLine->text() );
diff --git a/noncore/net/mail/editaccounts.h b/noncore/net/mail/editaccounts.h
index d51e299..d8e1219 100644
--- a/noncore/net/mail/editaccounts.h
+++ b/noncore/net/mail/editaccounts.h
@@ -81,3 +81,3 @@ public slots:
81protected slots: 81protected slots:
82 void slotSSL( bool enabled ); 82 void slotConnectionToggle( int index );
83 void accept(); 83 void accept();
diff --git a/noncore/net/mail/imapconfigui.ui b/noncore/net/mail/imapconfigui.ui
index ac0297f..a96c1a2 100644
--- a/noncore/net/mail/imapconfigui.ui
+++ b/noncore/net/mail/imapconfigui.ui
@@ -13,4 +13,4 @@
13 <y>0</y> 13 <y>0</y>
14 <width>228</width> 14 <width>425</width>
15 <height>320</height> 15 <height>428</height>
16 </rect> 16 </rect>
@@ -34,26 +34,4 @@
34 <name>spacing</name> 34 <name>spacing</name>
35 <number>2</number> 35 <number>3</number>
36 </property> 36 </property>
37 <widget row="6" column="0" >
38 <class>QLabel</class>
39 <property stdset="1">
40 <name>name</name>
41 <cstring>userLabel</cstring>
42 </property>
43 <property stdset="1">
44 <name>text</name>
45 <string>User</string>
46 </property>
47 </widget>
48 <widget row="4" column="1" >
49 <class>QCheckBox</class>
50 <property stdset="1">
51 <name>name</name>
52 <cstring>sslBox</cstring>
53 </property>
54 <property stdset="1">
55 <name>text</name>
56 <string>Use SSL</string>
57 </property>
58 </widget>
59 <widget row="2" column="1" > 37 <widget row="2" column="1" >
@@ -65,20 +43,2 @@
65 </widget> 43 </widget>
66 <widget row="6" column="1" >
67 <class>QLineEdit</class>
68 <property stdset="1">
69 <name>name</name>
70 <cstring>userLine</cstring>
71 </property>
72 </widget>
73 <widget row="7" column="0" >
74 <class>QLabel</class>
75 <property stdset="1">
76 <name>name</name>
77 <cstring>passLabel</cstring>
78 </property>
79 <property stdset="1">
80 <name>text</name>
81 <string>Password</string>
82 </property>
83 </widget>
84 <widget row="3" column="0" > 44 <widget row="3" column="0" >
@@ -112,3 +72,3 @@
112 </widget> 72 </widget>
113 <widget row="7" column="1" > 73 <widget row="0" column="1" >
114 <class>QLineEdit</class> 74 <class>QLineEdit</class>
@@ -116,10 +76,32 @@
116 <name>name</name> 76 <name>name</name>
117 <cstring>passLine</cstring> 77 <cstring>accountLine</cstring>
78 </property>
79 <property>
80 <name>toolTip</name>
81 <string>Name of the Account</string>
118 </property> 82 </property>
83 </widget>
84 <widget row="0" column="0" >
85 <class>QLabel</class>
119 <property stdset="1"> 86 <property stdset="1">
120 <name>echoMode</name> 87 <name>name</name>
121 <enum>Password</enum> 88 <cstring>accountLabel</cstring>
89 </property>
90 <property stdset="1">
91 <name>text</name>
92 <string>Account</string>
93 </property>
94 </widget>
95 <widget row="1" column="0" rowspan="1" colspan="2" >
96 <class>Line</class>
97 <property stdset="1">
98 <name>name</name>
99 <cstring>line1</cstring>
100 </property>
101 <property stdset="1">
102 <name>orientation</name>
103 <enum>Horizontal</enum>
122 </property> 104 </property>
123 </widget> 105 </widget>
124 <spacer row="10" column="1" > 106 <spacer row="12" column="1" >
125 <property> 107 <property>
@@ -144,3 +126,3 @@
144 </spacer> 126 </spacer>
145 <widget row="0" column="1" > 127 <widget row="8" column="1" >
146 <class>QLineEdit</class> 128 <class>QLineEdit</class>
@@ -148,32 +130,28 @@
148 <name>name</name> 130 <name>name</name>
149 <cstring>accountLine</cstring> 131 <cstring>userLine</cstring>
150 </property>
151 <property>
152 <name>toolTip</name>
153 <string>Name of the Account</string>
154 </property> 132 </property>
155 </widget> 133 </widget>
156 <widget row="0" column="0" > 134 <widget row="9" column="1" >
157 <class>QLabel</class> 135 <class>QLineEdit</class>
158 <property stdset="1"> 136 <property stdset="1">
159 <name>name</name> 137 <name>name</name>
160 <cstring>accountLabel</cstring> 138 <cstring>passLine</cstring>
161 </property> 139 </property>
162 <property stdset="1"> 140 <property stdset="1">
163 <name>text</name> 141 <name>echoMode</name>
164 <string>Account</string> 142 <enum>Password</enum>
165 </property> 143 </property>
166 </widget> 144 </widget>
167 <widget row="1" column="0" rowspan="1" colspan="2" > 145 <widget row="11" column="0" >
168 <class>Line</class> 146 <class>QLabel</class>
169 <property stdset="1"> 147 <property stdset="1">
170 <name>name</name> 148 <name>name</name>
171 <cstring>line1</cstring> 149 <cstring>prefixLabel</cstring>
172 </property> 150 </property>
173 <property stdset="1"> 151 <property stdset="1">
174 <name>orientation</name> 152 <name>text</name>
175 <enum>Horizontal</enum> 153 <string>Prefix</string>
176 </property> 154 </property>
177 </widget> 155 </widget>
178 <widget row="9" column="1" > 156 <widget row="11" column="1" >
179 <class>QLineEdit</class> 157 <class>QLineEdit</class>
@@ -184,3 +162,3 @@
184 </widget> 162 </widget>
185 <widget row="9" column="0" > 163 <widget row="8" column="0" >
186 <class>QLabel</class> 164 <class>QLabel</class>
@@ -188,3 +166,3 @@
188 <name>name</name> 166 <name>name</name>
189 <cstring>prefixLabel</cstring> 167 <cstring>userLabel</cstring>
190 </property> 168 </property>
@@ -192,6 +170,6 @@
192 <name>text</name> 170 <name>text</name>
193 <string>Prefix</string> 171 <string>User</string>
194 </property> 172 </property>
195 </widget> 173 </widget>
196 <widget row="5" column="0" rowspan="1" colspan="2" > 174 <widget row="7" column="0" rowspan="1" colspan="2" >
197 <class>Line</class> 175 <class>Line</class>
@@ -220,3 +198,3 @@
220 </widget> 198 </widget>
221 <widget row="8" column="0" rowspan="1" colspan="2" > 199 <widget row="10" column="0" rowspan="1" colspan="2" >
222 <class>Line</class> 200 <class>Line</class>
@@ -231,2 +209,42 @@
231 </widget> 209 </widget>
210 <widget row="9" column="0" >
211 <class>QLabel</class>
212 <property stdset="1">
213 <name>name</name>
214 <cstring>passLabel</cstring>
215 </property>
216 <property stdset="1">
217 <name>text</name>
218 <string>Password</string>
219 </property>
220 </widget>
221 <widget row="6" column="0" rowspan="1" colspan="2" >
222 <class>QLineEdit</class>
223 <property stdset="1">
224 <name>name</name>
225 <cstring>CommandEdit</cstring>
226 </property>
227 <property stdset="1">
228 <name>text</name>
229 <string>ssh $SERVER exec</string>
230 </property>
231 </widget>
232 <widget row="5" column="0" rowspan="1" colspan="2" >
233 <class>QComboBox</class>
234 <property stdset="1">
235 <name>name</name>
236 <cstring>ComboBox1</cstring>
237 </property>
238 </widget>
239 <widget row="4" column="0" rowspan="1" colspan="2" >
240 <class>QLabel</class>
241 <property stdset="1">
242 <name>name</name>
243 <cstring>TextLabel1</cstring>
244 </property>
245 <property stdset="1">
246 <name>text</name>
247 <string>Use secure sockets:</string>
248 </property>
249 </widget>
232 </grid> 250 </grid>
@@ -237,3 +255,2 @@
237 <tabstop>portLine</tabstop> 255 <tabstop>portLine</tabstop>
238 <tabstop>sslBox</tabstop>
239 <tabstop>userLine</tabstop> 256 <tabstop>userLine</tabstop>
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
@@ -82,4 +82,14 @@ void IMAPwrapper::login()
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 );
@@ -371,3 +381,3 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
371 qDebug(da.toString()); 381 qDebug(da.toString());
372#endif 382#endif
373 } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_RFC822_SIZE) { 383 } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_RFC822_SIZE) {
@@ -410,3 +420,3 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail)
410 } 420 }
411 421
412 /* the range has to start at 1!!! not with 0!!!! */ 422 /* the range has to start at 1!!! not with 0!!!! */
@@ -497,5 +507,5 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMail&mail,const QValueList<int>
497 set = mailimap_set_new_single(mail.getNumber()); 507 set = mailimap_set_new_single(mail.getNumber());
498 508
499 clist*id_list = 0; 509 clist*id_list = 0;
500 510
501 /* if path == empty then its a request for the whole rfc822 mail and generates 511 /* if path == empty then its a request for the whole rfc822 mail and generates
@@ -512,3 +522,3 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMail&mail,const QValueList<int>
512 } 522 }
513 523
514 section = mailimap_section_new(section_spec); 524 section = mailimap_section_new(section_spec);
@@ -516,5 +526,5 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMail&mail,const QValueList<int>
516 fetchType = mailimap_fetch_type_new_fetch_att(fetch_att); 526 fetchType = mailimap_fetch_type_new_fetch_att(fetch_att);
517 527
518 clist*result = 0; 528 clist*result = 0;
519 529
520 err = mailimap_fetch( m_imap, set, fetchType, &result ); 530 err = mailimap_fetch( m_imap, set, fetchType, &result );
@@ -522,3 +532,3 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMail&mail,const QValueList<int>
522 mailimap_fetch_type_free( fetchType ); 532 mailimap_fetch_type_free( fetchType );
523 533
524 if (err == MAILIMAP_NO_ERROR && (current=clist_begin(result)) ) { 534 if (err == MAILIMAP_NO_ERROR && (current=clist_begin(result)) ) {
@@ -537,3 +547,3 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMail&mail,const QValueList<int>
537 } 547 }
538 } 548 }
539 } else { 549 } else {
@@ -666,3 +676,3 @@ void IMAPwrapper::fillSingleMsgPart(RecPart&target_part,mailimap_body_type_msg*w
666 target_part.setLines(which->bd_lines); 676 target_part.setLines(which->bd_lines);
667 fillBodyFields(target_part,which->bd_fields); 677 fillBodyFields(target_part,which->bd_fields);
668} 678}
@@ -670,3 +680,3 @@ void IMAPwrapper::fillSingleMsgPart(RecPart&target_part,mailimap_body_type_msg*w
670void IMAPwrapper::fillMultiPart(RecPart&target_part,mailimap_body_type_mpart*which) 680void IMAPwrapper::fillMultiPart(RecPart&target_part,mailimap_body_type_mpart*which)
671{ 681{
672 if (!which) return; 682 if (!which) return;
@@ -682,3 +692,3 @@ void IMAPwrapper::fillMultiPart(RecPart&target_part,mailimap_body_type_mpart*whi
682 } 692 }
683 } 693 }
684 } 694 }
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
@@ -166,2 +166,3 @@ void IMAPaccount::read()
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 );
@@ -188,2 +189,3 @@ void IMAPaccount::save()
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 );