author | zautrix <zautrix> | 2005-03-10 21:14:19 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-10 21:14:19 (UTC) |
commit | 6e3c3178fa8e0c421753c08506b4a91bbcecc26f (patch) (unidiff) | |
tree | ff9c2b22376e71e135f59154c6aeeb8ed95f10ce | |
parent | 3a1891136e7b1290a6b3ddd573a863e51bd3047b (diff) | |
download | kdepimpi-6e3c3178fa8e0c421753c08506b4a91bbcecc26f.zip kdepimpi-6e3c3178fa8e0c421753c08506b4a91bbcecc26f.tar.gz kdepimpi-6e3c3178fa8e0c421753c08506b4a91bbcecc26f.tar.bz2 |
smtp ompi fix
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 5 | ||||
-rw-r--r-- | kmicromail/editaccounts.cpp | 24 | ||||
-rw-r--r-- | kmicromail/libetpan/tools/mailstream_socket.c | 2 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/smtpwrapper.cpp | 8 |
4 files changed, 25 insertions, 14 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 5661955..65f9168 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,71 +1,76 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.0.15 ************ | 3 | ********** VERSION 2.0.15 ************ |
4 | 4 | ||
5 | PwM/Pi: | 5 | PwM/Pi: |
6 | Added keyboard shorcuts for | 6 | Added keyboard shorcuts for |
7 | - toggling summary view (space bar) | 7 | - toggling summary view (space bar) |
8 | - delete item (delete + backspace key) | 8 | - delete item (delete + backspace key) |
9 | - add new item ( i + n key) | 9 | - add new item ( i + n key) |
10 | Fixed length of info in the title. | 10 | Fixed length of info in the title. |
11 | 11 | ||
12 | KO/Pi-KA/Pi: | 12 | KO/Pi-KA/Pi: |
13 | Changed "ME" menu bar entry to an icon. | 13 | Changed "ME" menu bar entry to an icon. |
14 | 14 | ||
15 | KO/Pi: | 15 | KO/Pi: |
16 | Fixed two minor bugs in displaying todos. | 16 | Fixed two minor bugs in displaying todos. |
17 | If in month view a cell is selected, the key shortcut "d" shows now that date. | 17 | If in month view a cell is selected, the key shortcut "d" shows now that date. |
18 | Added complete info for a todo in month view as an icon left of the text. | 18 | Added complete info for a todo in month view as an icon left of the text. |
19 | Fixed problems of displaying data when "<" or ">" were used in summary/location/description. | 19 | Fixed problems of displaying data when "<" or ">" were used in summary/location/description. |
20 | Fixed problem of search dialog size when switching displays. | 20 | Fixed problem of search dialog size when switching displays. |
21 | Cancel key now closes date picker. | 21 | Cancel key now closes date picker. |
22 | Rearranged KO/Pi file menu structure. | 22 | Rearranged KO/Pi file menu structure. |
23 | 23 | ||
24 | OM/Pi: | ||
25 | Added to the SMTP account setting the option | ||
26 | "No secure connection". | ||
27 | You have to configure your SMTP accounts again, sorry. | ||
28 | |||
24 | 29 | ||
25 | ********** VERSION 2.0.14 ************ | 30 | ********** VERSION 2.0.14 ************ |
26 | 31 | ||
27 | Made Passwordmanager PwM/Pi more userfriendly: | 32 | Made Passwordmanager PwM/Pi more userfriendly: |
28 | Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. | 33 | Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. |
29 | Fixed bug in KO/Pi todo printing. | 34 | Fixed bug in KO/Pi todo printing. |
30 | Made Qtopia calendar import possible on desktop . | 35 | Made Qtopia calendar import possible on desktop . |
31 | 36 | ||
32 | ********** VERSION 2.0.13 ************ | 37 | ********** VERSION 2.0.13 ************ |
33 | 38 | ||
34 | Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter. | 39 | Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter. |
35 | 40 | ||
36 | In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down". | 41 | In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down". |
37 | 42 | ||
38 | OM/Pi: | 43 | OM/Pi: |
39 | Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails. | 44 | Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails. |
40 | Added missing German translation. | 45 | Added missing German translation. |
41 | Added warning if path is specified in local folder settings of account config. | 46 | Added warning if path is specified in local folder settings of account config. |
42 | 47 | ||
43 | ********** VERSION 2.0.12 ************ | 48 | ********** VERSION 2.0.12 ************ |
44 | 49 | ||
45 | KO/Pi: | 50 | KO/Pi: |
46 | Fixed a bug in todo start/due date handling for non recurring todos with a start and due date. | 51 | Fixed a bug in todo start/due date handling for non recurring todos with a start and due date. |
47 | Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes. | 52 | Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes. |
48 | Fixed several problems of the keyboard focus in the desktop versions when opening the search dialog/event viewer. | 53 | Fixed several problems of the keyboard focus in the desktop versions when opening the search dialog/event viewer. |
49 | 54 | ||
50 | Fixed problem in pi-sync mode when wrong password was sent. | 55 | Fixed problem in pi-sync mode when wrong password was sent. |
51 | 56 | ||
52 | OM/Pi: | 57 | OM/Pi: |
53 | Fixed a crash when displaying mails with "Show mail as html" was checked in the config. | 58 | Fixed a crash when displaying mails with "Show mail as html" was checked in the config. |
54 | Added a check before displaying the mail if the mail is in html format, if "Show mail as html" is enabled. | 59 | Added a check before displaying the mail if the mail is in html format, if "Show mail as html" is enabled. |
55 | 60 | ||
56 | ********** VERSION 2.0.11 ************ | 61 | ********** VERSION 2.0.11 ************ |
57 | 62 | ||
58 | Fixed some problems in pi-sync mode | 63 | Fixed some problems in pi-sync mode |
59 | (e.g. details of events were not synced properly) | 64 | (e.g. details of events were not synced properly) |
60 | 65 | ||
61 | ********** VERSION 2.0.10 ************ | 66 | ********** VERSION 2.0.10 ************ |
62 | 67 | ||
63 | KO/Pi: | 68 | KO/Pi: |
64 | In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view. | 69 | In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view. |
65 | This is fixed. | 70 | This is fixed. |
66 | Changed the search dialog a bit to make it more user friendly. | 71 | Changed the search dialog a bit to make it more user friendly. |
67 | (E.g.: Removed message box about "no items found" and set key focus to search line edit after search). | 72 | (E.g.: Removed message box about "no items found" and set key focus to search line edit after search). |
68 | 73 | ||
69 | Added config option to hide the week number in KO/Pi toolbar. | 74 | Added config option to hide the week number in KO/Pi toolbar. |
70 | 75 | ||
71 | ********** VERSION 2.0.9 ************ | 76 | ********** VERSION 2.0.9 ************ |
diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp index f1075c0..49049f6 100644 --- a/kmicromail/editaccounts.cpp +++ b/kmicromail/editaccounts.cpp | |||
@@ -285,272 +285,276 @@ void EditAccounts::slotDeleteNews() | |||
285 | 285 | ||
286 | void EditAccounts::slotAdjustColumns() | 286 | void EditAccounts::slotAdjustColumns() |
287 | { | 287 | { |
288 | int currPage = configTab->currentPageIndex(); | 288 | int currPage = configTab->currentPageIndex(); |
289 | 289 | ||
290 | configTab->showPage( mailTab ); | 290 | configTab->showPage( mailTab ); |
291 | mailList->setColumnWidth( 0, mailList->visibleWidth() - 50 ); | 291 | mailList->setColumnWidth( 0, mailList->visibleWidth() - 50 ); |
292 | mailList->setColumnWidth( 1, 50 ); | 292 | mailList->setColumnWidth( 1, 50 ); |
293 | 293 | ||
294 | configTab->showPage( newsTab ); | 294 | configTab->showPage( newsTab ); |
295 | newsList->setColumnWidth( 0, newsList->visibleWidth() ); | 295 | newsList->setColumnWidth( 0, newsList->visibleWidth() ); |
296 | 296 | ||
297 | configTab->setCurrentPage( currPage ); | 297 | configTab->setCurrentPage( currPage ); |
298 | } | 298 | } |
299 | 299 | ||
300 | void EditAccounts::accept() | 300 | void EditAccounts::accept() |
301 | { | 301 | { |
302 | settings->saveAccounts(); | 302 | settings->saveAccounts(); |
303 | 303 | ||
304 | QDialog::accept(); | 304 | QDialog::accept(); |
305 | } | 305 | } |
306 | 306 | ||
307 | /** | 307 | /** |
308 | * SelectMailType | 308 | * SelectMailType |
309 | */ | 309 | */ |
310 | 310 | ||
311 | SelectMailType::SelectMailType( QString *selection, QWidget *parent, const char *name, bool modal, WFlags flags ) | 311 | SelectMailType::SelectMailType( QString *selection, QWidget *parent, const char *name, bool modal, WFlags flags ) |
312 | : SelectMailTypeUI( parent, name, modal, flags ) | 312 | : SelectMailTypeUI( parent, name, modal, flags ) |
313 | { | 313 | { |
314 | selected = selection; | 314 | selected = selection; |
315 | selected->replace( 0, selected->length(), typeBox->currentText() ); | 315 | selected->replace( 0, selected->length(), typeBox->currentText() ); |
316 | connect( typeBox, SIGNAL( activated(const QString&) ), SLOT( slotSelection(const QString&) ) ); | 316 | connect( typeBox, SIGNAL( activated(const QString&) ), SLOT( slotSelection(const QString&) ) ); |
317 | } | 317 | } |
318 | 318 | ||
319 | void SelectMailType::slotSelection( const QString &sel ) | 319 | void SelectMailType::slotSelection( const QString &sel ) |
320 | { | 320 | { |
321 | selected->replace( 0, selected->length(), sel ); | 321 | selected->replace( 0, selected->length(), sel ); |
322 | } | 322 | } |
323 | 323 | ||
324 | /** | 324 | /** |
325 | * IMAPconfig | 325 | * IMAPconfig |
326 | */ | 326 | */ |
327 | 327 | ||
328 | IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) | 328 | IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) |
329 | : IMAPconfigUI( parent, name, modal, flags ) | 329 | : IMAPconfigUI( parent, name, modal, flags ) |
330 | { | 330 | { |
331 | data = account; | 331 | data = account; |
332 | 332 | ||
333 | fillValues(); | 333 | //fillValues(); |
334 | 334 | ||
335 | connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); | 335 | connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); |
336 | ComboBox1->insertItem( "Only if available", 0 ); | 336 | ComboBox1->insertItem( "Only if available", 0 ); |
337 | ComboBox1->insertItem( "Always, Negotiated", 1 ); | 337 | ComboBox1->insertItem( "Always, Negotiated", 1 ); |
338 | ComboBox1->insertItem( "Connect on secure port", 2 ); | 338 | ComboBox1->insertItem( "Connect on secure port", 2 ); |
339 | ComboBox1->insertItem( "Run command instead", 3 ); | 339 | ComboBox1->insertItem( "Run command instead", 3 ); |
340 | CommandEdit->hide(); | 340 | CommandEdit->hide(); |
341 | ComboBox1->setCurrentItem( data->ConnectionType() ); | 341 | fillValues(); |
342 | // ComboBox1->setCurrentItem( data->ConnectionType() ); | ||
342 | } | 343 | } |
343 | 344 | ||
344 | void IMAPconfig::slotConnectionToggle( int index ) | 345 | void IMAPconfig::slotConnectionToggle( int index ) |
345 | { | 346 | { |
346 | if ( index == 2 ) | 347 | if ( index == 2 ) |
347 | { | 348 | { |
348 | portLine->setText( IMAP_SSL_PORT ); | 349 | portLine->setText( IMAP_SSL_PORT ); |
349 | } | 350 | } |
350 | else if ( index == 3 ) | 351 | else if ( index == 3 ) |
351 | { | 352 | { |
352 | portLine->setText( IMAP_PORT ); | 353 | portLine->setText( IMAP_PORT ); |
353 | CommandEdit->show(); | 354 | CommandEdit->show(); |
354 | } | 355 | } |
355 | else | 356 | else |
356 | { | 357 | { |
357 | portLine->setText( IMAP_PORT ); | 358 | portLine->setText( IMAP_PORT ); |
358 | } | 359 | } |
359 | } | 360 | } |
360 | 361 | ||
361 | void IMAPconfig::fillValues() | 362 | void IMAPconfig::fillValues() |
362 | { | 363 | { |
363 | accountLine->setText( data->getAccountName() ); | 364 | accountLine->setText( data->getAccountName() ); |
364 | serverLine->setText( data->getServer() ); | 365 | serverLine->setText( data->getServer() ); |
365 | portLine->setText( data->getPort() ); | 366 | portLine->setText( data->getPort() ); |
366 | ComboBox1->setCurrentItem( data->ConnectionType() ); | 367 | ComboBox1->setCurrentItem( data->ConnectionType() ); |
367 | userLine->setText( data->getUser() ); | 368 | userLine->setText( data->getUser() ); |
368 | passLine->setText( data->getPassword() ); | 369 | passLine->setText( data->getPassword() ); |
369 | prefixLine->setText(data->getPrefix()); | 370 | prefixLine->setText(data->getPrefix()); |
370 | localFolder->setText( data->getLocalFolder() ); | 371 | localFolder->setText( data->getLocalFolder() ); |
371 | int max = data->getMaxMailSize() ; | 372 | int max = data->getMaxMailSize() ; |
372 | if ( max ) { | 373 | if ( max ) { |
373 | CheckBoxDown->setChecked( true ); | 374 | CheckBoxDown->setChecked( true ); |
374 | SpinBoxDown->setValue ( max ); | 375 | SpinBoxDown->setValue ( max ); |
375 | } else { | 376 | } else { |
376 | CheckBoxDown->setChecked( false ); | 377 | CheckBoxDown->setChecked( false ); |
377 | SpinBoxDown->setValue ( 5 ); | 378 | SpinBoxDown->setValue ( 5 ); |
378 | } | 379 | } |
379 | CheckBoxLeaveOn->setChecked( data->getLeaveOnServer() ); | 380 | CheckBoxLeaveOn->setChecked( data->getLeaveOnServer() ); |
380 | } | 381 | } |
381 | 382 | ||
382 | void IMAPconfig::accept() | 383 | void IMAPconfig::accept() |
383 | { | 384 | { |
384 | if ( localFolder->text().contains("/") ||localFolder->text().contains("\\") ) { | 385 | if ( localFolder->text().contains("/") ||localFolder->text().contains("\\") ) { |
385 | QMessageBox::information( this, i18n( "Error" ), | 386 | QMessageBox::information( this, i18n( "Error" ), |
386 | i18n( "No paths allowed in\nlocal folder settings.\nPlease specify a folder\nname or leave empty\nto create local folder\nwith account name\nautomatically." ), | 387 | i18n( "No paths allowed in\nlocal folder settings.\nPlease specify a folder\nname or leave empty\nto create local folder\nwith account name\nautomatically." ), |
387 | i18n( "Ok" ) ); | 388 | i18n( "Ok" ) ); |
388 | return; | 389 | return; |
389 | } | 390 | } |
390 | data->setAccountName( accountLine->text() ); | 391 | data->setAccountName( accountLine->text() ); |
391 | data->setServer( serverLine->text() ); | 392 | data->setServer( serverLine->text() ); |
392 | data->setPort( portLine->text() ); | 393 | data->setPort( portLine->text() ); |
393 | data->setConnectionType( ComboBox1->currentItem() ); | 394 | data->setConnectionType( ComboBox1->currentItem() ); |
394 | data->setUser( userLine->text() ); | 395 | data->setUser( userLine->text() ); |
395 | data->setPassword( passLine->text() ); | 396 | data->setPassword( passLine->text() ); |
396 | data->setPrefix(prefixLine->text()); | 397 | data->setPrefix(prefixLine->text()); |
397 | data->setLocalFolder( localFolder->text() ); | 398 | data->setLocalFolder( localFolder->text() ); |
398 | data->setMaxMailSize( CheckBoxDown->isChecked()?SpinBoxDown->value():0 ) ; | 399 | data->setMaxMailSize( CheckBoxDown->isChecked()?SpinBoxDown->value():0 ) ; |
399 | data->setLeaveOnServer( CheckBoxLeaveOn->isChecked() ); | 400 | data->setLeaveOnServer( CheckBoxLeaveOn->isChecked() ); |
400 | 401 | ||
401 | QDialog::accept(); | 402 | QDialog::accept(); |
402 | } | 403 | } |
403 | 404 | ||
404 | /** | 405 | /** |
405 | * POP3config | 406 | * POP3config |
406 | */ | 407 | */ |
407 | 408 | ||
408 | POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, WFlags flags ) | 409 | POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, WFlags flags ) |
409 | : POP3configUI( parent, name, modal, flags ) | 410 | : POP3configUI( parent, name, modal, flags ) |
410 | { | 411 | { |
411 | data = account; | 412 | data = account; |
412 | fillValues(); | 413 | //fillValues(); |
413 | 414 | ||
414 | connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); | 415 | connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); |
415 | ComboBox1->insertItem( "Only if available", 0 ); | 416 | ComboBox1->insertItem( "Only if available", 0 ); |
416 | ComboBox1->insertItem( "Always, Negotiated", 1 ); | 417 | ComboBox1->insertItem( "Always, Negotiated", 1 ); |
417 | ComboBox1->insertItem( "Connect on secure port", 2 ); | 418 | ComboBox1->insertItem( "Connect on secure port", 2 ); |
418 | ComboBox1->insertItem( "Run command instead", 3 ); | 419 | ComboBox1->insertItem( "Run command instead", 3 ); |
419 | CommandEdit->hide(); | 420 | CommandEdit->hide(); |
420 | ComboBox1->setCurrentItem( data->ConnectionType() ); | 421 | fillValues(); |
422 | //ComboBox1->setCurrentItem( data->ConnectionType() ); | ||
421 | } | 423 | } |
422 | 424 | ||
423 | void POP3config::slotConnectionToggle( int index ) | 425 | void POP3config::slotConnectionToggle( int index ) |
424 | { | 426 | { |
425 | // 2 is ssl connection | 427 | // 2 is ssl connection |
426 | if ( index == 2 ) | 428 | if ( index == 2 ) |
427 | { | 429 | { |
428 | portLine->setText( POP3_SSL_PORT ); | 430 | portLine->setText( POP3_SSL_PORT ); |
429 | } | 431 | } |
430 | else if ( index == 3 ) | 432 | else if ( index == 3 ) |
431 | { | 433 | { |
432 | portLine->setText( POP3_PORT ); | 434 | portLine->setText( POP3_PORT ); |
433 | CommandEdit->show(); | 435 | CommandEdit->show(); |
434 | } | 436 | } |
435 | else | 437 | else |
436 | { | 438 | { |
437 | portLine->setText( POP3_PORT ); | 439 | portLine->setText( POP3_PORT ); |
438 | } | 440 | } |
439 | } | 441 | } |
440 | 442 | ||
441 | void POP3config::fillValues() | 443 | void POP3config::fillValues() |
442 | { | 444 | { |
443 | accountLine->setText( data->getAccountName() ); | 445 | accountLine->setText( data->getAccountName() ); |
444 | serverLine->setText( data->getServer() ); | 446 | serverLine->setText( data->getServer() ); |
445 | portLine->setText( data->getPort() ); | 447 | portLine->setText( data->getPort() ); |
446 | ComboBox1->setCurrentItem( data->ConnectionType() ); | 448 | ComboBox1->setCurrentItem( data->ConnectionType() ); |
447 | userLine->setText( data->getUser() ); | 449 | userLine->setText( data->getUser() ); |
448 | passLine->setText( data->getPassword() ); | 450 | passLine->setText( data->getPassword() ); |
449 | localFolder->setText( data->getLocalFolder() ); | 451 | localFolder->setText( data->getLocalFolder() ); |
450 | int max = data->getMaxMailSize() ; | 452 | int max = data->getMaxMailSize() ; |
451 | if ( max ) { | 453 | if ( max ) { |
452 | CheckBoxDown->setChecked( true ); | 454 | CheckBoxDown->setChecked( true ); |
453 | SpinBoxDown->setValue ( max ); | 455 | SpinBoxDown->setValue ( max ); |
454 | } else { | 456 | } else { |
455 | CheckBoxDown->setChecked( false ); | 457 | CheckBoxDown->setChecked( false ); |
456 | SpinBoxDown->setValue ( 5 ); | 458 | SpinBoxDown->setValue ( 5 ); |
457 | } | 459 | } |
458 | CheckBoxLeaveOn->setChecked( data->getLeaveOnServer() ); | 460 | CheckBoxLeaveOn->setChecked( data->getLeaveOnServer() ); |
459 | } | 461 | } |
460 | 462 | ||
461 | void POP3config::accept() | 463 | void POP3config::accept() |
462 | { | 464 | { |
463 | if ( localFolder->text().contains("/") ||localFolder->text().contains("\\") ) { | 465 | if ( localFolder->text().contains("/") ||localFolder->text().contains("\\") ) { |
464 | QMessageBox::information( this, i18n( "Error" ), | 466 | QMessageBox::information( this, i18n( "Error" ), |
465 | i18n( "No paths allowed in\nlocal folder settings.\nPlease specify a folder\nname or leave empty\nto create local folder\nwith account name\nautomatically." ), | 467 | i18n( "No paths allowed in\nlocal folder settings.\nPlease specify a folder\nname or leave empty\nto create local folder\nwith account name\nautomatically." ), |
466 | i18n( "Ok" ) ); | 468 | i18n( "Ok" ) ); |
467 | return; | 469 | return; |
468 | } | 470 | } |
469 | data->setAccountName( accountLine->text() ); | 471 | data->setAccountName( accountLine->text() ); |
470 | data->setServer( serverLine->text() ); | 472 | data->setServer( serverLine->text() ); |
471 | data->setPort( portLine->text() ); | 473 | data->setPort( portLine->text() ); |
472 | data->setConnectionType( ComboBox1->currentItem() ); | 474 | data->setConnectionType( ComboBox1->currentItem() ); |
473 | data->setUser( userLine->text() ); | 475 | data->setUser( userLine->text() ); |
474 | data->setPassword( passLine->text() ); | 476 | data->setPassword( passLine->text() ); |
475 | data->setLocalFolder( localFolder->text() ); | 477 | data->setLocalFolder( localFolder->text() ); |
476 | data->setMaxMailSize( CheckBoxDown->isChecked()?SpinBoxDown->value():0 ) ; | 478 | data->setMaxMailSize( CheckBoxDown->isChecked()?SpinBoxDown->value():0 ) ; |
477 | data->setLeaveOnServer( CheckBoxLeaveOn->isChecked() ); | 479 | data->setLeaveOnServer( CheckBoxLeaveOn->isChecked() ); |
478 | 480 | ||
479 | QDialog::accept(); | 481 | QDialog::accept(); |
480 | } | 482 | } |
481 | 483 | ||
482 | /** | 484 | /** |
483 | * SMTPconfig | 485 | * SMTPconfig |
484 | */ | 486 | */ |
485 | 487 | ||
486 | SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) | 488 | SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) |
487 | : SMTPconfigUI( parent, name, modal, flags ) | 489 | : SMTPconfigUI( parent, name, modal, flags ) |
488 | { | 490 | { |
489 | data = account; | 491 | data = account; |
490 | 492 | ||
491 | connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); | 493 | connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); |
492 | connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); | 494 | connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); |
493 | 495 | ||
494 | fillValues(); | 496 | // fillValues(); |
495 | QIconSet icon; | 497 | QIconSet icon; |
496 | //icon = SmallIcon("fileexport"); | 498 | //icon = SmallIcon("fileexport"); |
497 | icon = SmallIcon("fileopen"); | 499 | icon = SmallIcon("fileopen"); |
498 | SignaturButton->setText(""); | 500 | SignaturButton->setText(""); |
499 | SignaturButton->setIconSet (icon ) ; | 501 | SignaturButton->setIconSet (icon ) ; |
500 | SignaturButton->setMaximumSize ( SignaturButton->sizeHint().height()+4,SignaturButton->sizeHint().height()) ; | 502 | SignaturButton->setMaximumSize ( SignaturButton->sizeHint().height()+4,SignaturButton->sizeHint().height()) ; |
501 | connect( SignaturButton, SIGNAL( clicked() ), this, SLOT( chooseSig() ) ); | 503 | connect( SignaturButton, SIGNAL( clicked() ), this, SLOT( chooseSig() ) ); |
502 | connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); | 504 | connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); |
503 | ComboBox1->insertItem( "Only if available", 0 ); | 505 | ComboBox1->insertItem( "No secure connection, no TLS", 0 ); |
504 | ComboBox1->insertItem( "Always, Negotiated", 1 ); | 506 | ComboBox1->insertItem( "Only if available, try TLS", 1 ); |
505 | ComboBox1->insertItem( "Connect on secure port", 2 ); | 507 | ComboBox1->insertItem( "Always, use TLS", 2 ); |
506 | ComboBox1->insertItem( "Run command instead", 3 ); | 508 | ComboBox1->insertItem( "Connect on secure port (SSL)", 3 ); |
509 | ComboBox1->insertItem( "Run command instead", 4 ); | ||
507 | CommandEdit->hide(); | 510 | CommandEdit->hide(); |
508 | ComboBox1->setCurrentItem( data->ConnectionType() ); | 511 | fillValues(); |
512 | //ComboBox1->setCurrentItem( data->ConnectionType() ); | ||
509 | } | 513 | } |
510 | void SMTPconfig::chooseSig() | 514 | void SMTPconfig::chooseSig() |
511 | { | 515 | { |
512 | QString lnk = KFileDialog::getOpenFileName( "", "Choose Signatur File", this ); | 516 | QString lnk = KFileDialog::getOpenFileName( "", "Choose Signatur File", this ); |
513 | if ( !lnk.isEmpty() ) { | 517 | if ( !lnk.isEmpty() ) { |
514 | SignaturEdit->setText( lnk ); | 518 | SignaturEdit->setText( lnk ); |
515 | } | 519 | } |
516 | } | 520 | } |
517 | void SMTPconfig::slotConnectionToggle( int index ) | 521 | void SMTPconfig::slotConnectionToggle( int index ) |
518 | { | 522 | { |
519 | // 2 is ssl connection | 523 | // 2 is ssl connection |
520 | if ( index == 2 ) | 524 | if ( index == 2 ) |
521 | { | 525 | { |
522 | portLine->setText( SMTP_SSL_PORT ); | 526 | portLine->setText( SMTP_SSL_PORT ); |
523 | } | 527 | } |
524 | else if ( index == 3 ) | 528 | else if ( index == 3 ) |
525 | { | 529 | { |
526 | portLine->setText( SMTP_PORT ); | 530 | portLine->setText( SMTP_PORT ); |
527 | CommandEdit->show(); | 531 | CommandEdit->show(); |
528 | } | 532 | } |
529 | else | 533 | else |
530 | { | 534 | { |
531 | portLine->setText( SMTP_PORT ); | 535 | portLine->setText( SMTP_PORT ); |
532 | } | 536 | } |
533 | } | 537 | } |
534 | 538 | ||
535 | void SMTPconfig::fillValues() | 539 | void SMTPconfig::fillValues() |
536 | { | 540 | { |
537 | accountLine->setText( data->getAccountName() ); | 541 | accountLine->setText( data->getAccountName() ); |
538 | serverLine->setText( data->getServer() ); | 542 | serverLine->setText( data->getServer() ); |
539 | portLine->setText( data->getPort() ); | 543 | portLine->setText( data->getPort() ); |
540 | ComboBox1->setCurrentItem( data->ConnectionType() ); | 544 | ComboBox1->setCurrentItem( data->ConnectionType() ); |
541 | loginBox->setChecked( data->getLogin() ); | 545 | loginBox->setChecked( data->getLogin() ); |
542 | userLine->setText( data->getUser() ); | 546 | userLine->setText( data->getUser() ); |
543 | passLine->setText( data->getPassword() ); | 547 | passLine->setText( data->getPassword() ); |
544 | SignaturEdit->setText( data->getSigFile() ); | 548 | SignaturEdit->setText( data->getSigFile() ); |
545 | } | 549 | } |
546 | 550 | ||
547 | void SMTPconfig::accept() | 551 | void SMTPconfig::accept() |
548 | { | 552 | { |
549 | data->setAccountName( accountLine->text() ); | 553 | data->setAccountName( accountLine->text() ); |
550 | data->setServer( serverLine->text() ); | 554 | data->setServer( serverLine->text() ); |
551 | data->setPort( portLine->text() ); | 555 | data->setPort( portLine->text() ); |
552 | data->setConnectionType( ComboBox1->currentItem() ); | 556 | data->setConnectionType( ComboBox1->currentItem() ); |
553 | data->setLogin( loginBox->isChecked() ); | 557 | data->setLogin( loginBox->isChecked() ); |
554 | data->setUser( userLine->text() ); | 558 | data->setUser( userLine->text() ); |
555 | data->setPassword( passLine->text() ); | 559 | data->setPassword( passLine->text() ); |
556 | data->setSigFile( SignaturEdit->text() ); | 560 | data->setSigFile( SignaturEdit->text() ); |
diff --git a/kmicromail/libetpan/tools/mailstream_socket.c b/kmicromail/libetpan/tools/mailstream_socket.c index 04a6f48..fd2c758 100644 --- a/kmicromail/libetpan/tools/mailstream_socket.c +++ b/kmicromail/libetpan/tools/mailstream_socket.c | |||
@@ -161,86 +161,86 @@ static ssize_t mailstream_low_socket_read(mailstream_low * s, | |||
161 | fd_set fds_read; | 161 | fd_set fds_read; |
162 | fd_set fds_excp; | 162 | fd_set fds_excp; |
163 | struct timeval timeout; | 163 | struct timeval timeout; |
164 | int r; | 164 | int r; |
165 | 165 | ||
166 | timeout = mailstream_network_delay; | 166 | timeout = mailstream_network_delay; |
167 | 167 | ||
168 | FD_ZERO(&fds_read); | 168 | FD_ZERO(&fds_read); |
169 | FD_SET(socket_data->fd, &fds_read); | 169 | FD_SET(socket_data->fd, &fds_read); |
170 | FD_ZERO(&fds_excp); | 170 | FD_ZERO(&fds_excp); |
171 | FD_SET(socket_data->fd, &fds_excp); | 171 | FD_SET(socket_data->fd, &fds_excp); |
172 | // LUTZ for safety I insert here a max val as well | 172 | // LUTZ for safety I insert here a max val as well |
173 | if ( timeout.tv_sec > DEFAULT_NETWORK_TIMEOUT ) | 173 | if ( timeout.tv_sec > DEFAULT_NETWORK_TIMEOUT ) |
174 | timeout.tv_sec = DEFAULT_NETWORK_TIMEOUT; | 174 | timeout.tv_sec = DEFAULT_NETWORK_TIMEOUT; |
175 | r = select(socket_data->fd + 1, &fds_read, NULL, &fds_excp, &timeout); | 175 | r = select(socket_data->fd + 1, &fds_read, NULL, &fds_excp, &timeout); |
176 | if (r < 1 ) | 176 | if (r < 1 ) |
177 | return -1; | 177 | return -1; |
178 | if (FD_ISSET(socket_data->fd, &fds_excp)) | 178 | if (FD_ISSET(socket_data->fd, &fds_excp)) |
179 | return -1; | 179 | return -1; |
180 | if (!FD_ISSET(socket_data->fd, &fds_read)) | 180 | if (!FD_ISSET(socket_data->fd, &fds_read)) |
181 | return 0; | 181 | return 0; |
182 | } | 182 | } |
183 | return recv(socket_data->fd,buf,count,MSG_NOSIGNAL); | 183 | return recv(socket_data->fd,buf,count,MSG_NOSIGNAL); |
184 | //return read(socket_data->fd, buf, count); | 184 | //return read(socket_data->fd, buf, count); |
185 | } | 185 | } |
186 | #include <stdio.h> | 186 | #include <stdio.h> |
187 | static ssize_t mailstream_low_socket_write(mailstream_low * s, | 187 | static ssize_t mailstream_low_socket_write(mailstream_low * s, |
188 | const void * buf, size_t count) | 188 | const void * buf, size_t count) |
189 | { | 189 | { |
190 | struct mailstream_socket_data * socket_data; | 190 | struct mailstream_socket_data * socket_data; |
191 | 191 | ||
192 | socket_data = (struct mailstream_socket_data *) s->data; | 192 | socket_data = (struct mailstream_socket_data *) s->data; |
193 | /* timeout */ | 193 | /* timeout */ |
194 | { | 194 | { |
195 | fd_set fds_write; | 195 | fd_set fds_write; |
196 | fd_set fds_excp; | 196 | fd_set fds_excp; |
197 | struct timeval timeout; | 197 | struct timeval timeout; |
198 | int r; | 198 | int r; |
199 | 199 | ||
200 | timeout = mailstream_network_delay; | 200 | timeout = mailstream_network_delay; |
201 | 201 | ||
202 | FD_ZERO(&fds_write); | 202 | FD_ZERO(&fds_write); |
203 | FD_SET(socket_data->fd, &fds_write); | 203 | FD_SET(socket_data->fd, &fds_write); |
204 | FD_ZERO(&fds_excp); | 204 | FD_ZERO(&fds_excp); |
205 | FD_SET(socket_data->fd, &fds_excp); | 205 | FD_SET(socket_data->fd, &fds_excp); |
206 | // LUTZ next line blocks sometimes | 206 | // LUTZ next line blocks sometimes |
207 | if ( timeout.tv_sec > DEFAULT_NETWORK_TIMEOUT ) | 207 | if ( timeout.tv_sec > DEFAULT_NETWORK_TIMEOUT ) |
208 | timeout.tv_sec = DEFAULT_NETWORK_TIMEOUT; | 208 | timeout.tv_sec = DEFAULT_NETWORK_TIMEOUT; |
209 | fprintf(stderr,"fd %d to secs %d \n", socket_data->fd, timeout.tv_sec ); | 209 | //fprintf(stderr,"fd %d to secs %d \n", socket_data->fd, timeout.tv_sec ); |
210 | r = select(socket_data->fd + 1, NULL, &fds_write, &fds_excp, &timeout); | 210 | r = select(socket_data->fd + 1, NULL, &fds_write, &fds_excp, &timeout); |
211 | if (r < 1) | 211 | if (r < 1) |
212 | return -1; | 212 | return -1; |
213 | if (FD_ISSET(socket_data->fd, &fds_excp)) | 213 | if (FD_ISSET(socket_data->fd, &fds_excp)) |
214 | return -1; | 214 | return -1; |
215 | if (!FD_ISSET(socket_data->fd, &fds_write)) | 215 | if (!FD_ISSET(socket_data->fd, &fds_write)) |
216 | return 0; | 216 | return 0; |
217 | } | 217 | } |
218 | 218 | ||
219 | return send(socket_data->fd,buf,count,MSG_NOSIGNAL); | 219 | return send(socket_data->fd,buf,count,MSG_NOSIGNAL); |
220 | //return write(socket_data->fd, buf, count); | 220 | //return write(socket_data->fd, buf, count); |
221 | } | 221 | } |
222 | 222 | ||
223 | 223 | ||
224 | /* mailstream */ | 224 | /* mailstream */ |
225 | 225 | ||
226 | mailstream * mailstream_socket_open(int fd) | 226 | mailstream * mailstream_socket_open(int fd) |
227 | { | 227 | { |
228 | mailstream_low * low; | 228 | mailstream_low * low; |
229 | mailstream * s; | 229 | mailstream * s; |
230 | 230 | ||
231 | low = mailstream_low_socket_open(fd); | 231 | low = mailstream_low_socket_open(fd); |
232 | if (low == NULL) | 232 | if (low == NULL) |
233 | goto err; | 233 | goto err; |
234 | 234 | ||
235 | s = mailstream_new(low, 8192); | 235 | s = mailstream_new(low, 8192); |
236 | if (s == NULL) | 236 | if (s == NULL) |
237 | goto free_low; | 237 | goto free_low; |
238 | 238 | ||
239 | return s; | 239 | return s; |
240 | 240 | ||
241 | free_low: | 241 | free_low: |
242 | mailstream_low_close(low); | 242 | mailstream_low_close(low); |
243 | err: | 243 | err: |
244 | return NULL; | 244 | return NULL; |
245 | } | 245 | } |
246 | 246 | ||
diff --git a/kmicromail/libmailwrapper/smtpwrapper.cpp b/kmicromail/libmailwrapper/smtpwrapper.cpp index 5096f67..872a460 100644 --- a/kmicromail/libmailwrapper/smtpwrapper.cpp +++ b/kmicromail/libmailwrapper/smtpwrapper.cpp | |||
@@ -148,109 +148,111 @@ bool SMTPwrapper::smtpSend( mailmime *mail,bool later) { | |||
148 | if (from) { | 148 | if (from) { |
149 | free(from); | 149 | free(from); |
150 | } | 150 | } |
151 | if (rcpts) | 151 | if (rcpts) |
152 | smtp_address_list_free( rcpts ); | 152 | smtp_address_list_free( rcpts ); |
153 | return result; | 153 | return result; |
154 | } | 154 | } |
155 | 155 | ||
156 | void SMTPwrapper::storeFailedMail(const char*data,unsigned int size, const char*failuremessage) | 156 | void SMTPwrapper::storeFailedMail(const char*data,unsigned int size, const char*failuremessage) |
157 | { | 157 | { |
158 | if (data) { | 158 | if (data) { |
159 | storeMail(data,size,"Sendfailed"); | 159 | storeMail(data,size,"Sendfailed"); |
160 | } | 160 | } |
161 | if (failuremessage) { | 161 | if (failuremessage) { |
162 | QMessageBox::critical(0,i18n("Error sending mail"), | 162 | QMessageBox::critical(0,i18n("Error sending mail"), |
163 | failuremessage); | 163 | failuremessage); |
164 | } | 164 | } |
165 | } | 165 | } |
166 | 166 | ||
167 | int SMTPwrapper::start_smtp_tls() | 167 | int SMTPwrapper::start_smtp_tls() |
168 | { | 168 | { |
169 | if (!m_smtp) { | 169 | if (!m_smtp) { |
170 | return MAILSMTP_ERROR_IN_PROCESSING; | 170 | return MAILSMTP_ERROR_IN_PROCESSING; |
171 | } | 171 | } |
172 | int err = mailesmtp_starttls(m_smtp); | 172 | int err = mailesmtp_starttls(m_smtp); |
173 | if (err != MAILSMTP_NO_ERROR) return err; | 173 | if (err != MAILSMTP_NO_ERROR) return err; |
174 | mailstream_low * low; | 174 | mailstream_low * low; |
175 | mailstream_low * new_low; | 175 | mailstream_low * new_low; |
176 | low = mailstream_get_low(m_smtp->stream); | 176 | low = mailstream_get_low(m_smtp->stream); |
177 | if (!low) { | 177 | if (!low) { |
178 | return MAILSMTP_ERROR_IN_PROCESSING; | 178 | return MAILSMTP_ERROR_IN_PROCESSING; |
179 | } | 179 | } |
180 | int fd = mailstream_low_get_fd(low); | 180 | int fd = mailstream_low_get_fd(low); |
181 | if (fd > -1 && (new_low = mailstream_low_ssl_open(fd))!=0) { | 181 | if (fd > -1 && (new_low = mailstream_low_ssl_open(fd))!=0) { |
182 | mailstream_low_free(low); | 182 | mailstream_low_free(low); |
183 | mailstream_set_low(m_smtp->stream, new_low); | 183 | mailstream_set_low(m_smtp->stream, new_low); |
184 | } else { | 184 | } else { |
185 | return MAILSMTP_ERROR_IN_PROCESSING; | 185 | return MAILSMTP_ERROR_IN_PROCESSING; |
186 | } | 186 | } |
187 | return err; | 187 | return err; |
188 | } | 188 | } |
189 | 189 | ||
190 | void SMTPwrapper::connect_server() | 190 | void SMTPwrapper::connect_server() |
191 | { | 191 | { |
192 | QString server, user, pass; | 192 | QString server, user, pass; |
193 | bool ssl; | 193 | bool ssl; |
194 | uint16_t port; | 194 | uint16_t port; |
195 | ssl = false; | 195 | ssl = false; |
196 | bool try_tls = true; | 196 | bool try_tls = false; |
197 | bool force_tls=false; | 197 | bool force_tls=false; |
198 | QString failuretext = ""; | 198 | QString failuretext = ""; |
199 | 199 | ||
200 | if (m_smtp || !m_SmtpAccount) { | 200 | if (m_smtp || !m_SmtpAccount) { |
201 | return; | 201 | return; |
202 | } | 202 | } |
203 | server = m_SmtpAccount->getServer(); | 203 | server = m_SmtpAccount->getServer(); |
204 | if ( m_SmtpAccount->ConnectionType() == 2 ) { | 204 | if ( m_SmtpAccount->ConnectionType() == 3 ) { |
205 | ssl = true; | 205 | ssl = true; |
206 | try_tls = false; | 206 | try_tls = false; |
207 | } else if (m_SmtpAccount->ConnectionType() == 1) { | 207 | } else if (m_SmtpAccount->ConnectionType() == 2) { |
208 | force_tls = true; | 208 | force_tls = true; |
209 | } else if (m_SmtpAccount->ConnectionType() == 1) { | ||
210 | try_tls = true; | ||
209 | } | 211 | } |
210 | int result = 1; | 212 | int result = 1; |
211 | port = m_SmtpAccount->getPort().toUInt(); | 213 | port = m_SmtpAccount->getPort().toUInt(); |
212 | 214 | ||
213 | m_smtp = mailsmtp_new( 20, &progress ); | 215 | m_smtp = mailsmtp_new( 20, &progress ); |
214 | if ( m_smtp == NULL ) { | 216 | if ( m_smtp == NULL ) { |
215 | /* no failure message cause this happens when problems with memory - than we | 217 | /* no failure message cause this happens when problems with memory - than we |
216 | we can not display any messagebox */ | 218 | we can not display any messagebox */ |
217 | return; | 219 | return; |
218 | } | 220 | } |
219 | 221 | ||
220 | int err = MAILSMTP_NO_ERROR; | 222 | int err = MAILSMTP_NO_ERROR; |
221 | ; // odebug << "Servername " << server << " at port " << port << "" << oendl; | 223 | ; // odebug << "Servername " << server << " at port " << port << "" << oendl; |
222 | if ( ssl ) { | 224 | if ( ssl ) { |
223 | qDebug("smtp: ssl_connect "); | 225 | qDebug("smtp: ssl_connect "); |
224 | err = mailsmtp_ssl_connect( m_smtp, server.latin1(), port ); | 226 | err = mailsmtp_ssl_connect( m_smtp, server.latin1(), port ); |
225 | } else { | 227 | } else { |
226 | ; // odebug << "No SSL session" << oendl; | 228 | ; // odebug << "No SSL session" << oendl; |
227 | err = mailsmtp_socket_connect( m_smtp, server.latin1(), port ); | 229 | err = mailsmtp_socket_connect( m_smtp, server.latin1(), port ); |
228 | } | 230 | } |
229 | if ( err != MAILSMTP_NO_ERROR ) { | 231 | if ( err != MAILSMTP_NO_ERROR ) { |
230 | qDebug("Error init SMTP connection" ); | 232 | qDebug("Error init SMTP connection" ); |
231 | failuretext = i18n("Error init SMTP connection:\n%1").arg(mailsmtpError(err)); | 233 | failuretext = i18n("Error init SMTP connection:\n%1").arg(mailsmtpError(err)); |
232 | result = 0; | 234 | result = 0; |
233 | } | 235 | } |
234 | 236 | ||
235 | qDebug("SMTP connection inited "); | 237 | qDebug("SMTP connection inited "); |
236 | /* switch to tls after init 'cause there it will send the ehlo */ | 238 | /* switch to tls after init 'cause there it will send the ehlo */ |
237 | if (result) { | 239 | if (result) { |
238 | err = mailsmtp_init( m_smtp ); | 240 | err = mailsmtp_init( m_smtp ); |
239 | if (err != MAILSMTP_NO_ERROR) { | 241 | if (err != MAILSMTP_NO_ERROR) { |
240 | result = 0; | 242 | result = 0; |
241 | qDebug("Error init SMTP connection "); | 243 | qDebug("Error init SMTP connection "); |
242 | failuretext = i18n("Error init SMTP connection:\n%1").arg(mailsmtpError(err)); | 244 | failuretext = i18n("Error init SMTP connection:\n%1").arg(mailsmtpError(err)); |
243 | } | 245 | } |
244 | } | 246 | } |
245 | if (try_tls) { | 247 | if (try_tls) { |
246 | qDebug("Smpt: Try tls "); | 248 | qDebug("Smpt: Try tls "); |
247 | err = start_smtp_tls(); | 249 | err = start_smtp_tls(); |
248 | if (err != MAILSMTP_NO_ERROR) { | 250 | if (err != MAILSMTP_NO_ERROR) { |
249 | try_tls = false; | 251 | try_tls = false; |
250 | qDebug("no tls "); | 252 | qDebug("no tls "); |
251 | } else { | 253 | } else { |
252 | err = mailesmtp_ehlo(m_smtp); | 254 | err = mailesmtp_ehlo(m_smtp); |
253 | } | 255 | } |
254 | } | 256 | } |
255 | //qDebug("mailesmtp_ehlo %d ",err ); | 257 | //qDebug("mailesmtp_ehlo %d ",err ); |
256 | if (!try_tls && force_tls) { | 258 | if (!try_tls && force_tls) { |