author | harlekin <harlekin> | 2003-12-10 02:02:53 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-12-10 02:02:53 (UTC) |
commit | 1f0b92e554b76852af210ceb277b3e9ecb09a43d (patch) (unidiff) | |
tree | a813761b2f0d1a2b8a9a1a996d6e37d511d24f0f /noncore/net | |
parent | a908d0ffdb5cee72b7823fc411119b8e1e3faad8 (diff) | |
download | opie-1f0b92e554b76852af210ceb277b3e9ecb09a43d.zip opie-1f0b92e554b76852af210ceb277b3e9ecb09a43d.tar.gz opie-1f0b92e554b76852af210ceb277b3e9ecb09a43d.tar.bz2 |
ssl for imap now working
-rw-r--r-- | noncore/net/mail/imapwrapper.cpp | 6 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 6 | ||||
-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 2 |
3 files changed, 13 insertions, 1 deletions
diff --git a/noncore/net/mail/imapwrapper.cpp b/noncore/net/mail/imapwrapper.cpp index eae85a7..dc02780 100644 --- a/noncore/net/mail/imapwrapper.cpp +++ b/noncore/net/mail/imapwrapper.cpp | |||
@@ -26,25 +26,31 @@ void IMAPwrapper::login() | |||
26 | logout(); | 26 | logout(); |
27 | const char *server, *user, *pass; | 27 | const char *server, *user, *pass; |
28 | uint16_t port; | 28 | uint16_t port; |
29 | int err = MAILIMAP_NO_ERROR; | 29 | int err = MAILIMAP_NO_ERROR; |
30 | 30 | ||
31 | server = account->getServer().latin1(); | 31 | server = account->getServer().latin1(); |
32 | port = account->getPort().toUInt(); | 32 | port = account->getPort().toUInt(); |
33 | user = account->getUser().latin1(); | 33 | user = account->getUser().latin1(); |
34 | pass = account->getPassword().latin1(); | 34 | pass = account->getPassword().latin1(); |
35 | 35 | ||
36 | m_imap = mailimap_new( 20, &imap_progress ); | 36 | m_imap = mailimap_new( 20, &imap_progress ); |
37 | /* connect */ | 37 | /* connect */ |
38 | // err = mailimap_socket_connect( m_imap, (char*)server, port ); | ||
39 | if (account->getSSL()) { | ||
40 | err = mailimap_ssl_connect( m_imap, (char*)server, port ); | ||
41 | } else { | ||
38 | err = mailimap_socket_connect( m_imap, (char*)server, port ); | 42 | err = mailimap_socket_connect( m_imap, (char*)server, port ); |
43 | } | ||
44 | |||
39 | if ( err != MAILIMAP_NO_ERROR && | 45 | if ( err != MAILIMAP_NO_ERROR && |
40 | err != MAILIMAP_NO_ERROR_AUTHENTICATED && | 46 | err != MAILIMAP_NO_ERROR_AUTHENTICATED && |
41 | err != MAILIMAP_NO_ERROR_NON_AUTHENTICATED ) { | 47 | err != MAILIMAP_NO_ERROR_NON_AUTHENTICATED ) { |
42 | qDebug("error connecting server: %s",m_imap->response); | 48 | qDebug("error connecting server: %s",m_imap->response); |
43 | mailimap_free( m_imap ); | 49 | mailimap_free( m_imap ); |
44 | m_imap = 0; | 50 | m_imap = 0; |
45 | return; | 51 | return; |
46 | } | 52 | } |
47 | 53 | ||
48 | /* login */ | 54 | /* login */ |
49 | err = mailimap_login_simple( m_imap, (char*)user, (char*)pass ); | 55 | err = mailimap_login_simple( m_imap, (char*)user, (char*)pass ); |
50 | if ( err != MAILIMAP_NO_ERROR ) { | 56 | if ( err != MAILIMAP_NO_ERROR ) { |
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index eae85a7..dc02780 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp | |||
@@ -26,25 +26,31 @@ void IMAPwrapper::login() | |||
26 | logout(); | 26 | logout(); |
27 | const char *server, *user, *pass; | 27 | const char *server, *user, *pass; |
28 | uint16_t port; | 28 | uint16_t port; |
29 | int err = MAILIMAP_NO_ERROR; | 29 | int err = MAILIMAP_NO_ERROR; |
30 | 30 | ||
31 | server = account->getServer().latin1(); | 31 | server = account->getServer().latin1(); |
32 | port = account->getPort().toUInt(); | 32 | port = account->getPort().toUInt(); |
33 | user = account->getUser().latin1(); | 33 | user = account->getUser().latin1(); |
34 | pass = account->getPassword().latin1(); | 34 | pass = account->getPassword().latin1(); |
35 | 35 | ||
36 | m_imap = mailimap_new( 20, &imap_progress ); | 36 | m_imap = mailimap_new( 20, &imap_progress ); |
37 | /* connect */ | 37 | /* connect */ |
38 | // err = mailimap_socket_connect( m_imap, (char*)server, port ); | ||
39 | if (account->getSSL()) { | ||
40 | err = mailimap_ssl_connect( m_imap, (char*)server, port ); | ||
41 | } else { | ||
38 | err = mailimap_socket_connect( m_imap, (char*)server, port ); | 42 | err = mailimap_socket_connect( m_imap, (char*)server, port ); |
43 | } | ||
44 | |||
39 | if ( err != MAILIMAP_NO_ERROR && | 45 | if ( err != MAILIMAP_NO_ERROR && |
40 | err != MAILIMAP_NO_ERROR_AUTHENTICATED && | 46 | err != MAILIMAP_NO_ERROR_AUTHENTICATED && |
41 | err != MAILIMAP_NO_ERROR_NON_AUTHENTICATED ) { | 47 | err != MAILIMAP_NO_ERROR_NON_AUTHENTICATED ) { |
42 | qDebug("error connecting server: %s",m_imap->response); | 48 | qDebug("error connecting server: %s",m_imap->response); |
43 | mailimap_free( m_imap ); | 49 | mailimap_free( m_imap ); |
44 | m_imap = 0; | 50 | m_imap = 0; |
45 | return; | 51 | return; |
46 | } | 52 | } |
47 | 53 | ||
48 | /* login */ | 54 | /* login */ |
49 | err = mailimap_login_simple( m_imap, (char*)user, (char*)pass ); | 55 | err = mailimap_login_simple( m_imap, (char*)user, (char*)pass ); |
50 | if ( err != MAILIMAP_NO_ERROR ) { | 56 | if ( err != MAILIMAP_NO_ERROR ) { |
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp index 3edfff1..6d13a8b 100644 --- a/noncore/net/mail/mainwindow.cpp +++ b/noncore/net/mail/mainwindow.cpp | |||
@@ -6,25 +6,25 @@ | |||
6 | 6 | ||
7 | #include <qpe/qpeapplication.h> | 7 | #include <qpe/qpeapplication.h> |
8 | 8 | ||
9 | #include "defines.h" | 9 | #include "defines.h" |
10 | #include "mainwindow.h" | 10 | #include "mainwindow.h" |
11 | #include "viewmail.h" | 11 | #include "viewmail.h" |
12 | #include "mailtypes.h" | 12 | #include "mailtypes.h" |
13 | #include "mailistviewitem.h" | 13 | #include "mailistviewitem.h" |
14 | 14 | ||
15 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | 15 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) |
16 | : QMainWindow( parent, name, flags ) | 16 | : QMainWindow( parent, name, flags ) |
17 | { | 17 | { |
18 | setCaption( tr( "Opie-Mail" ) ); | 18 | setCaption( tr( "Mail" ) ); |
19 | setToolBarsMovable( false ); | 19 | setToolBarsMovable( false ); |
20 | 20 | ||
21 | toolBar = new QToolBar( this ); | 21 | toolBar = new QToolBar( this ); |
22 | menuBar = new QMenuBar( toolBar ); | 22 | menuBar = new QMenuBar( toolBar ); |
23 | mailMenu = new QPopupMenu( menuBar ); | 23 | mailMenu = new QPopupMenu( menuBar ); |
24 | menuBar->insertItem( tr( "Mail" ), mailMenu ); | 24 | menuBar->insertItem( tr( "Mail" ), mailMenu ); |
25 | settingsMenu = new QPopupMenu( menuBar ); | 25 | settingsMenu = new QPopupMenu( menuBar ); |
26 | menuBar->insertItem( tr( "Settings" ), settingsMenu ); | 26 | menuBar->insertItem( tr( "Settings" ), settingsMenu ); |
27 | 27 | ||
28 | addToolBar( toolBar ); | 28 | addToolBar( toolBar ); |
29 | toolBar->setHorizontalStretchable( true ); | 29 | toolBar->setHorizontalStretchable( true ); |
30 | 30 | ||