summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/mail/libmailwrapper/smtpwrapper.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/smtpwrapper.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
index e054365..00181ff 100644
--- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
@@ -486,5 +486,5 @@ void SMTPwrapper::progress( size_t current, size_t maximum )
}
-void SMTPwrapper::storeMail(char*mail, size_t length, const QString&box)
+void SMTPwrapper::storeMail(const char*mail, size_t length, const QString&box)
{
if (!mail) return;
@@ -537,5 +537,5 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later, SMTPaccount *smtp )
}
-int SMTPwrapper::smtpSend(char*from,clist*rcpts,char*data,size_t size, SMTPaccount *smtp )
+int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size, SMTPaccount *smtp )
{
char *server, *user, *pass;
@@ -641,6 +641,4 @@ void SMTPwrapper::sendMail(const Mail&mail,SMTPaccount*aSmtp,bool later )
int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which)
{
- char*data = 0;
- size_t length = 0;
size_t curTok = 0;
mailimf_fields *fields = 0;
@@ -650,9 +648,9 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which)
int res = 0;
- wrap->fetchRawBody(*which,&data,&length);
+ encodedString * data = wrap->fetchRawBody(*which);
if (!data) return 0;
- int err = mailimf_fields_parse( data, length, &curTok, &fields );
+ int err = mailimf_fields_parse( data->Content(), data->Length(), &curTok, &fields );
if (err != MAILIMF_NO_ERROR) {
- free(data);
+ delete data;
delete wrap;
return 0;
@@ -663,7 +661,6 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which)
from = getFrom(ffrom);
- qDebug("Size: %i vs. %i",length,strlen(data));
if (rcpts && from) {
- res = smtpSend(from,rcpts,data,length,smtp );
+ res = smtpSend(from,rcpts,data->Content(),data->Length(),smtp );
}
if (fields) {
@@ -672,5 +669,5 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which)
}
if (data) {
- free(data);
+ delete data;
}
if (from) {