summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper
Unidiff
Diffstat (limited to 'noncore/net/mail/libmailwrapper') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/.cvsignore6
-rw-r--r--noncore/net/mail/libmailwrapper/config.in4
-rw-r--r--noncore/net/mail/libmailwrapper/libmailwrapper.pro44
-rw-r--r--noncore/net/mail/libmailwrapper/mailwrapper.cpp15
-rw-r--r--noncore/net/mail/libmailwrapper/settings.cpp36
-rw-r--r--noncore/net/mail/libmailwrapper/smtpwrapper.cpp4
6 files changed, 93 insertions, 16 deletions
diff --git a/noncore/net/mail/libmailwrapper/.cvsignore b/noncore/net/mail/libmailwrapper/.cvsignore
new file mode 100644
index 0000000..581c299
--- a/dev/null
+++ b/noncore/net/mail/libmailwrapper/.cvsignore
@@ -0,0 +1,6 @@
1logindialogui.cpp
2logindialogui.h
3sendmailprogressui.cpp
4sendmailprogressui.h
5.moc
6Makefile
diff --git a/noncore/net/mail/libmailwrapper/config.in b/noncore/net/mail/libmailwrapper/config.in
new file mode 100644
index 0000000..790891e
--- a/dev/null
+++ b/noncore/net/mail/libmailwrapper/config.in
@@ -0,0 +1,4 @@
1 config LIBMAILWRAPPER
2 boolean "libmailwrapper ( wrapper arround libetpan needed by mail3"
3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE
diff --git a/noncore/net/mail/libmailwrapper/libmailwrapper.pro b/noncore/net/mail/libmailwrapper/libmailwrapper.pro
new file mode 100644
index 0000000..4b4a4f1
--- a/dev/null
+++ b/noncore/net/mail/libmailwrapper/libmailwrapper.pro
@@ -0,0 +1,44 @@
1TEMPLATE = lib
2CONFIG += qt warn_on debug
3
4HEADERS = mailwrapper.h \
5 imapwrapper.h \
6 mailtypes.h \
7 pop3wrapper.h \
8 abstractmail.h \
9 smtpwrapper.h \
10 genericwrapper.h \
11 mboxwrapper.h \
12 settings.h \
13 logindialog.h \
14 sendmailprogress.h
15
16SOURCES = imapwrapper.cpp \
17 mailwrapper.cpp \
18 mailtypes.cpp \
19 pop3wrapper.cpp \
20 abstractmail.cpp \
21 smtpwrapper.cpp \
22 genericwrapper.cpp \
23 mboxwrapper.cpp \
24 settings.cpp \
25 logindialog.cpp \
26 sendmailprogress.cpp
27
28 INTERFACES = logindialogui.ui \
29 sendmailprogressui.ui
30
31
32INCLUDEPATH += $(OPIEDIR)/include
33
34CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX )
35contains( CONFTEST, y ){
36 LIBS += -lqpe -letpan -lssl -lcrypto -liconv
37}else{
38 LIBS += -lqpe -letpan -lssl -lcrypto
39}
40
41DESTDIR = $(OPIEDIR)/lib$(PROJMAK)
42TARGET = mailwrapper
43
44include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.cpp b/noncore/net/mail/libmailwrapper/mailwrapper.cpp
index 9398823..75b9343 100644
--- a/noncore/net/mail/libmailwrapper/mailwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mailwrapper.cpp
@@ -7,8 +7,19 @@
7#include <qdir.h> 7#include <qdir.h>
8 8
9#include "mailwrapper.h" 9#include "mailwrapper.h"
10#include "logindialog.h" 10//#include "logindialog.h"
11#include "defines.h" 11//#include "defines.h"
12
13#define UNDEFINED 64
14#define MAXLINE 76
15#define UTF16MASK 0x03FFUL
16#define UTF16SHIFT 10
17#define UTF16BASE 0x10000UL
18#define UTF16HIGHSTART 0xD800UL
19#define UTF16HIGHEND 0xDBFFUL
20#define UTF16LOSTART 0xDC00UL
21#define UTF16LOEND 0xDFFFUL
22
12 23
13Attachment::Attachment( DocLnk lnk ) 24Attachment::Attachment( DocLnk lnk )
14{ 25{
diff --git a/noncore/net/mail/libmailwrapper/settings.cpp b/noncore/net/mail/libmailwrapper/settings.cpp
index 17aa1b0..c5187f5 100644
--- a/noncore/net/mail/libmailwrapper/settings.cpp
+++ b/noncore/net/mail/libmailwrapper/settings.cpp
@@ -4,7 +4,17 @@
4#include <qpe/config.h> 4#include <qpe/config.h>
5 5
6#include "settings.h" 6#include "settings.h"
7#include "defines.h" 7//#include "defines.h"
8
9#define IMAP_PORT "143"
10#define IMAP_SSL_PORT "993"
11#define SMTP_PORT "25"
12#define SMTP_SSL_PORT "465"
13#define POP3_PORT "110"
14#define POP3_SSL_PORT "995"
15#define NNTP_PORT "119"
16#define NNTP_SSL_PORT "563"
17
8 18
9Settings::Settings() 19Settings::Settings()
10 : QObject() 20 : QObject()
@@ -62,20 +72,20 @@ void Settings::updateAccounts()
62 SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") ); 72 SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") );
63 accounts.append( account ); 73 accounts.append( account );
64 } 74 }
65 75
66 QStringList nntp = dir.entryList( "nntp-*" ); 76 QStringList nntp = dir.entryList( "nntp-*" );
67 for ( it = nntp.begin(); it != nntp.end(); it++ ) { 77 for ( it = nntp.begin(); it != nntp.end(); it++ ) {
68 qDebug( "Added NNTP account" ); 78 qDebug( "Added NNTP account" );
69 NNTPaccount *account = new NNTPaccount( (*it).replace(0, 5, "") ); 79 NNTPaccount *account = new NNTPaccount( (*it).replace(0, 5, "") );
70 accounts.append( account ); 80 accounts.append( account );
71 } 81 }
72 82
73 readAccounts(); 83 readAccounts();
74} 84}
75 85
76void Settings::saveAccounts() 86void Settings::saveAccounts()
77{ 87{
78 checkDirectory(); 88 checkDirectory();
79 Account *it; 89 Account *it;
80 90
81 for ( it = accounts.first(); it; it = accounts.next() ) { 91 for ( it = accounts.first(); it; it = accounts.next() ) {
@@ -85,7 +95,7 @@ void Settings::saveAccounts()
85 95
86void Settings::readAccounts() 96void Settings::readAccounts()
87{ 97{
88 checkDirectory(); 98 checkDirectory();
89 Account *it; 99 Account *it;
90 100
91 for ( it = accounts.first(); it; it = accounts.next() ) { 101 for ( it = accounts.first(); it; it = accounts.next() ) {
@@ -130,7 +140,7 @@ QString IMAPaccount::getUniqueFileName()
130{ 140{
131 int num = 0; 141 int num = 0;
132 QString unique; 142 QString unique;
133 143
134 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); 144 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" );
135 145
136 QStringList imap = dir.entryList( "imap-*" ); 146 QStringList imap = dir.entryList( "imap-*" );
@@ -164,7 +174,7 @@ void IMAPaccount::save()
164{ 174{
165 qDebug( "saving " + getFileName() ); 175 qDebug( "saving " + getFileName() );
166 Settings::checkDirectory(); 176 Settings::checkDirectory();
167 177
168 Config *conf = new Config( getFileName(), Config::File ); 178 Config *conf = new Config( getFileName(), Config::File );
169 conf->setGroup( "IMAP Account" ); 179 conf->setGroup( "IMAP Account" );
170 conf->writeEntry( "Account", accountName ); 180 conf->writeEntry( "Account", accountName );
@@ -207,7 +217,7 @@ QString POP3account::getUniqueFileName()
207{ 217{
208 int num = 0; 218 int num = 0;
209 QString unique; 219 QString unique;
210 220
211 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); 221 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" );
212 222
213 QStringList imap = dir.entryList( "pop3-*" ); 223 QStringList imap = dir.entryList( "pop3-*" );
@@ -234,7 +244,7 @@ void POP3account::save()
234{ 244{
235 qDebug( "saving " + getFileName() ); 245 qDebug( "saving " + getFileName() );
236 Settings::checkDirectory(); 246 Settings::checkDirectory();
237 247
238 Config *conf = new Config( getFileName(), Config::File ); 248 Config *conf = new Config( getFileName(), Config::File );
239 conf->setGroup( "POP3 Account" ); 249 conf->setGroup( "POP3 Account" );
240 conf->writeEntry( "Account", accountName ); 250 conf->writeEntry( "Account", accountName );
@@ -281,7 +291,7 @@ QString SMTPaccount::getUniqueFileName()
281{ 291{
282 int num = 0; 292 int num = 0;
283 QString unique; 293 QString unique;
284 294
285 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); 295 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" );
286 296
287 QStringList imap = dir.entryList( "smtp-*" ); 297 QStringList imap = dir.entryList( "smtp-*" );
@@ -309,7 +319,7 @@ void SMTPaccount::save()
309{ 319{
310 qDebug( "saving " + getFileName() ); 320 qDebug( "saving " + getFileName() );
311 Settings::checkDirectory(); 321 Settings::checkDirectory();
312 322
313 Config *conf = new Config( getFileName(), Config::File ); 323 Config *conf = new Config( getFileName(), Config::File );
314 conf->setGroup( "SMTP Account" ); 324 conf->setGroup( "SMTP Account" );
315 conf->writeEntry( "Account", accountName ); 325 conf->writeEntry( "Account", accountName );
@@ -354,7 +364,7 @@ QString NNTPaccount::getUniqueFileName()
354{ 364{
355 int num = 0; 365 int num = 0;
356 QString unique; 366 QString unique;
357 367
358 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); 368 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" );
359 369
360 QStringList imap = dir.entryList( "nntp-*" ); 370 QStringList imap = dir.entryList( "nntp-*" );
@@ -382,7 +392,7 @@ void NNTPaccount::save()
382{ 392{
383 qDebug( "saving " + getFileName() ); 393 qDebug( "saving " + getFileName() );
384 Settings::checkDirectory(); 394 Settings::checkDirectory();
385 395
386 Config *conf = new Config( getFileName(), Config::File ); 396 Config *conf = new Config( getFileName(), Config::File );
387 conf->setGroup( "NNTP Account" ); 397 conf->setGroup( "NNTP Account" );
388 conf->writeEntry( "Account", accountName ); 398 conf->writeEntry( "Account", accountName );
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
index 7e03af9..b9c4ff2 100644
--- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
@@ -17,9 +17,11 @@
17#include "mboxwrapper.h" 17#include "mboxwrapper.h"
18#include "logindialog.h" 18#include "logindialog.h"
19#include "mailtypes.h" 19#include "mailtypes.h"
20#include "defines.h" 20//#include "defines.h"
21#include "sendmailprogress.h" 21#include "sendmailprogress.h"
22 22
23#define USER_AGENT "OpieMail v0.1"
24
23progressMailSend*SMTPwrapper::sendProgress = 0; 25progressMailSend*SMTPwrapper::sendProgress = 0;
24 26
25SMTPwrapper::SMTPwrapper( Settings *s ) 27SMTPwrapper::SMTPwrapper( Settings *s )