-rw-r--r-- | noncore/net/mail/libmailwrapper/smtpwrapper.cpp | 47 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/smtpwrapper.h | 2 | ||||
-rw-r--r-- | noncore/net/mail/opiemail.cpp | 5 | ||||
-rw-r--r-- | noncore/net/mail/smtpwrapper.cpp | 47 | ||||
-rw-r--r-- | noncore/net/mail/smtpwrapper.h | 2 |
5 files changed, 59 insertions, 44 deletions
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp index 770e2b8..a7e4837 100644 --- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp | |||
@@ -220,3 +220,3 @@ mailmime *SMTPwrapper::buildFilePart(const QString&filename,const QString&mimety | |||
220 | int pos = filename.findRev( '/' ); | 220 | int pos = filename.findRev( '/' ); |
221 | 221 | ||
222 | if (filename.length()>0) { | 222 | if (filename.length()>0) { |
@@ -230,6 +230,6 @@ mailmime *SMTPwrapper::buildFilePart(const QString&filename,const QString&mimety | |||
230 | int mechanism = MAILMIME_MECHANISM_BASE64; | 230 | int mechanism = MAILMIME_MECHANISM_BASE64; |
231 | 231 | ||
232 | if ( mimetype.startsWith( "text/" ) ) { | 232 | if ( mimetype.startsWith( "text/" ) ) { |
233 | param = mailmime_parameter_new( strdup( "charset" ), | 233 | param = mailmime_parameter_new( strdup( "charset" ), |
234 | strdup( "iso-8859-1" ) ); | 234 | strdup( "iso-8859-1" ) ); |
235 | disptype = MAILMIME_DISPOSITION_TYPE_INLINE; | 235 | disptype = MAILMIME_DISPOSITION_TYPE_INLINE; |
@@ -252,3 +252,3 @@ mailmime *SMTPwrapper::buildFilePart(const QString&filename,const QString&mimety | |||
252 | param = 0; | 252 | param = 0; |
253 | } | 253 | } |
254 | filePart = mailmime_new_empty( content, fields ); | 254 | filePart = mailmime_new_empty( content, fields ); |
@@ -550,3 +550,3 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later, SMTPaccount *smtp ) | |||
550 | from = data = 0; | 550 | from = data = 0; |
551 | 551 | ||
552 | QString file = getTmpFile(); | 552 | QString file = getTmpFile(); |
@@ -556,3 +556,3 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later, SMTPaccount *smtp ) | |||
556 | f.remove(); | 556 | f.remove(); |
557 | 557 | ||
558 | if (later) { | 558 | if (later) { |
@@ -574,3 +574,3 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,char*data,size_t size, SMTPaccou | |||
574 | int err,result; | 574 | int err,result; |
575 | 575 | ||
576 | result = 1; | 576 | result = 1; |
@@ -580,3 +580,3 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,char*data,size_t size, SMTPaccou | |||
580 | port = smtp->getPort().toUInt(); | 580 | port = smtp->getPort().toUInt(); |
581 | 581 | ||
582 | session = mailsmtp_new( 20, &progress ); | 582 | session = mailsmtp_new( 20, &progress ); |
@@ -646,5 +646,5 @@ void SMTPwrapper::sendMail(const Mail&mail,bool later ) | |||
646 | mailmime * mimeMail; | 646 | mailmime * mimeMail; |
647 | 647 | ||
648 | SMTPaccount *smtp = getAccount(mail.getName()); | 648 | SMTPaccount *smtp = getAccount(mail.getName()); |
649 | 649 | ||
650 | mimeMail = createMimeMail(mail ); | 650 | mimeMail = createMimeMail(mail ); |
@@ -654,3 +654,3 @@ void SMTPwrapper::sendMail(const Mail&mail,bool later ) | |||
654 | sendProgress = new progressMailSend(); | 654 | sendProgress = new progressMailSend(); |
655 | // sendProgress->showMaximized(); | 655 | // sendProgress->showMaximized(); |
656 | sendProgress->show(); | 656 | sendProgress->show(); |
@@ -678,3 +678,3 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which) | |||
678 | if (!data) return 0; | 678 | if (!data) return 0; |
679 | int err = mailimf_fields_parse( data, length, &curTok, &fields ); | 679 | int err = mailimf_fields_parse( data, length, &curTok, &fields ); |
680 | if (err != MAILIMF_NO_ERROR) { | 680 | if (err != MAILIMF_NO_ERROR) { |
@@ -684,3 +684,3 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which) | |||
684 | } | 684 | } |
685 | 685 | ||
686 | rcpts = createRcptList( fields ); | 686 | rcpts = createRcptList( fields ); |
@@ -688,3 +688,3 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which) | |||
688 | from = getFrom(ffrom); | 688 | from = getFrom(ffrom); |
689 | 689 | ||
690 | qDebug("Size: %i vs. %i",length,strlen(data)); | 690 | qDebug("Size: %i vs. %i",length,strlen(data)); |
@@ -697,6 +697,9 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which) | |||
697 | /* this is a special fun */ | 697 | /* this is a special fun */ |
698 | void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | 698 | bool SMTPwrapper::flushOutbox(SMTPaccount*smtp) |
699 | { | 699 | { |
700 | if (!smtp) return; | 700 | bool returnValue = true; |
701 | QString localfolders = (QString) getenv( "HOME" ) + QString("/Applications/opiemail/localmail/"); | 701 | |
702 | if (!smtp) return false; | ||
703 | |||
704 | QString localfolders = (QString) getenv( "HOME" ) + QString("/Applications/opiemail/localmail/"); | ||
702 | MBOXwrapper*wrap = new MBOXwrapper(localfolders); | 705 | MBOXwrapper*wrap = new MBOXwrapper(localfolders); |
@@ -704,3 +707,3 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
704 | qDebug("memory error"); | 707 | qDebug("memory error"); |
705 | return; | 708 | return false; |
706 | } | 709 | } |
@@ -712,3 +715,3 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
712 | delete wrap; | 715 | delete wrap; |
713 | return; | 716 | return false; |
714 | } | 717 | } |
@@ -716,3 +719,3 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
716 | sendProgress = new progressMailSend(); | 719 | sendProgress = new progressMailSend(); |
717 | // sendProgress->showMaximized(); | 720 | // sendProgress->showMaximized(); |
718 | sendProgress->show(); | 721 | sendProgress->show(); |
@@ -724,2 +727,4 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
724 | tr("Error sending queued mail - breaking")); | 727 | tr("Error sending queued mail - breaking")); |
728 | |||
729 | returnValue = false; | ||
725 | break; | 730 | break; |
@@ -736,2 +741,4 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
736 | delete wrap; | 741 | delete wrap; |
742 | return returnValue; | ||
743 | |||
737 | } | 744 | } |
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.h b/noncore/net/mail/libmailwrapper/smtpwrapper.h index baa353b..66180b7 100644 --- a/noncore/net/mail/libmailwrapper/smtpwrapper.h +++ b/noncore/net/mail/libmailwrapper/smtpwrapper.h | |||
@@ -30,3 +30,3 @@ public: | |||
30 | void sendMail(const Mail& mail,bool later=false ); | 30 | void sendMail(const Mail& mail,bool later=false ); |
31 | void flushOutbox(SMTPaccount*smtp); | 31 | bool flushOutbox(SMTPaccount*smtp); |
32 | 32 | ||
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index 833cac2..0dede90 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp | |||
@@ -70,4 +70,5 @@ void OpieMail::slotSendQueued() | |||
70 | SMTPwrapper * wrap = new SMTPwrapper(settings); | 70 | SMTPwrapper * wrap = new SMTPwrapper(settings); |
71 | wrap->flushOutbox(smtp); | 71 | if ( wrap->flushOutbox(smtp) ) { |
72 | QMessageBox::information(0,tr("Info"),tr("Mail queue flushed")); | 72 | QMessageBox::information(0,tr("Info"),tr("Mail queue flushed")); |
73 | } | ||
73 | } | 74 | } |
diff --git a/noncore/net/mail/smtpwrapper.cpp b/noncore/net/mail/smtpwrapper.cpp index 770e2b8..a7e4837 100644 --- a/noncore/net/mail/smtpwrapper.cpp +++ b/noncore/net/mail/smtpwrapper.cpp | |||
@@ -220,3 +220,3 @@ mailmime *SMTPwrapper::buildFilePart(const QString&filename,const QString&mimety | |||
220 | int pos = filename.findRev( '/' ); | 220 | int pos = filename.findRev( '/' ); |
221 | 221 | ||
222 | if (filename.length()>0) { | 222 | if (filename.length()>0) { |
@@ -230,6 +230,6 @@ mailmime *SMTPwrapper::buildFilePart(const QString&filename,const QString&mimety | |||
230 | int mechanism = MAILMIME_MECHANISM_BASE64; | 230 | int mechanism = MAILMIME_MECHANISM_BASE64; |
231 | 231 | ||
232 | if ( mimetype.startsWith( "text/" ) ) { | 232 | if ( mimetype.startsWith( "text/" ) ) { |
233 | param = mailmime_parameter_new( strdup( "charset" ), | 233 | param = mailmime_parameter_new( strdup( "charset" ), |
234 | strdup( "iso-8859-1" ) ); | 234 | strdup( "iso-8859-1" ) ); |
235 | disptype = MAILMIME_DISPOSITION_TYPE_INLINE; | 235 | disptype = MAILMIME_DISPOSITION_TYPE_INLINE; |
@@ -252,3 +252,3 @@ mailmime *SMTPwrapper::buildFilePart(const QString&filename,const QString&mimety | |||
252 | param = 0; | 252 | param = 0; |
253 | } | 253 | } |
254 | filePart = mailmime_new_empty( content, fields ); | 254 | filePart = mailmime_new_empty( content, fields ); |
@@ -550,3 +550,3 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later, SMTPaccount *smtp ) | |||
550 | from = data = 0; | 550 | from = data = 0; |
551 | 551 | ||
552 | QString file = getTmpFile(); | 552 | QString file = getTmpFile(); |
@@ -556,3 +556,3 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later, SMTPaccount *smtp ) | |||
556 | f.remove(); | 556 | f.remove(); |
557 | 557 | ||
558 | if (later) { | 558 | if (later) { |
@@ -574,3 +574,3 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,char*data,size_t size, SMTPaccou | |||
574 | int err,result; | 574 | int err,result; |
575 | 575 | ||
576 | result = 1; | 576 | result = 1; |
@@ -580,3 +580,3 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,char*data,size_t size, SMTPaccou | |||
580 | port = smtp->getPort().toUInt(); | 580 | port = smtp->getPort().toUInt(); |
581 | 581 | ||
582 | session = mailsmtp_new( 20, &progress ); | 582 | session = mailsmtp_new( 20, &progress ); |
@@ -646,5 +646,5 @@ void SMTPwrapper::sendMail(const Mail&mail,bool later ) | |||
646 | mailmime * mimeMail; | 646 | mailmime * mimeMail; |
647 | 647 | ||
648 | SMTPaccount *smtp = getAccount(mail.getName()); | 648 | SMTPaccount *smtp = getAccount(mail.getName()); |
649 | 649 | ||
650 | mimeMail = createMimeMail(mail ); | 650 | mimeMail = createMimeMail(mail ); |
@@ -654,3 +654,3 @@ void SMTPwrapper::sendMail(const Mail&mail,bool later ) | |||
654 | sendProgress = new progressMailSend(); | 654 | sendProgress = new progressMailSend(); |
655 | // sendProgress->showMaximized(); | 655 | // sendProgress->showMaximized(); |
656 | sendProgress->show(); | 656 | sendProgress->show(); |
@@ -678,3 +678,3 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which) | |||
678 | if (!data) return 0; | 678 | if (!data) return 0; |
679 | int err = mailimf_fields_parse( data, length, &curTok, &fields ); | 679 | int err = mailimf_fields_parse( data, length, &curTok, &fields ); |
680 | if (err != MAILIMF_NO_ERROR) { | 680 | if (err != MAILIMF_NO_ERROR) { |
@@ -684,3 +684,3 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which) | |||
684 | } | 684 | } |
685 | 685 | ||
686 | rcpts = createRcptList( fields ); | 686 | rcpts = createRcptList( fields ); |
@@ -688,3 +688,3 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which) | |||
688 | from = getFrom(ffrom); | 688 | from = getFrom(ffrom); |
689 | 689 | ||
690 | qDebug("Size: %i vs. %i",length,strlen(data)); | 690 | qDebug("Size: %i vs. %i",length,strlen(data)); |
@@ -697,6 +697,9 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which) | |||
697 | /* this is a special fun */ | 697 | /* this is a special fun */ |
698 | void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | 698 | bool SMTPwrapper::flushOutbox(SMTPaccount*smtp) |
699 | { | 699 | { |
700 | if (!smtp) return; | 700 | bool returnValue = true; |
701 | QString localfolders = (QString) getenv( "HOME" ) + QString("/Applications/opiemail/localmail/"); | 701 | |
702 | if (!smtp) return false; | ||
703 | |||
704 | QString localfolders = (QString) getenv( "HOME" ) + QString("/Applications/opiemail/localmail/"); | ||
702 | MBOXwrapper*wrap = new MBOXwrapper(localfolders); | 705 | MBOXwrapper*wrap = new MBOXwrapper(localfolders); |
@@ -704,3 +707,3 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
704 | qDebug("memory error"); | 707 | qDebug("memory error"); |
705 | return; | 708 | return false; |
706 | } | 709 | } |
@@ -712,3 +715,3 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
712 | delete wrap; | 715 | delete wrap; |
713 | return; | 716 | return false; |
714 | } | 717 | } |
@@ -716,3 +719,3 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
716 | sendProgress = new progressMailSend(); | 719 | sendProgress = new progressMailSend(); |
717 | // sendProgress->showMaximized(); | 720 | // sendProgress->showMaximized(); |
718 | sendProgress->show(); | 721 | sendProgress->show(); |
@@ -724,2 +727,4 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
724 | tr("Error sending queued mail - breaking")); | 727 | tr("Error sending queued mail - breaking")); |
728 | |||
729 | returnValue = false; | ||
725 | break; | 730 | break; |
@@ -736,2 +741,4 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
736 | delete wrap; | 741 | delete wrap; |
742 | return returnValue; | ||
743 | |||
737 | } | 744 | } |
diff --git a/noncore/net/mail/smtpwrapper.h b/noncore/net/mail/smtpwrapper.h index baa353b..66180b7 100644 --- a/noncore/net/mail/smtpwrapper.h +++ b/noncore/net/mail/smtpwrapper.h | |||
@@ -30,3 +30,3 @@ public: | |||
30 | void sendMail(const Mail& mail,bool later=false ); | 30 | void sendMail(const Mail& mail,bool later=false ); |
31 | void flushOutbox(SMTPaccount*smtp); | 31 | bool flushOutbox(SMTPaccount*smtp); |
32 | 32 | ||