summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/smtpwrapper.cpp
Side-by-side diff
Diffstat (limited to 'kmicromail/libmailwrapper/smtpwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/smtpwrapper.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/kmicromail/libmailwrapper/smtpwrapper.cpp b/kmicromail/libmailwrapper/smtpwrapper.cpp
index 04a21ea..6a1b505 100644
--- a/kmicromail/libmailwrapper/smtpwrapper.cpp
+++ b/kmicromail/libmailwrapper/smtpwrapper.cpp
@@ -101,9 +101,9 @@ void SMTPwrapper::storeMail(const char*mail, size_t length, const QString&box) {
wrap->storeMessage(mail,length,box);
delete wrap;
}
-void SMTPwrapper::smtpSend( mailmime *mail,bool later) {
+bool SMTPwrapper::smtpSend( mailmime *mail,bool later) {
clist *rcpts = 0;
char *from, *data;
size_t size;
@@ -117,10 +117,10 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later) {
mailmessage_free(msg);
if (r != MAIL_NO_ERROR || !data) {
if (data)
free(data);
- ; // odebug << "Error fetching mime..." << oendl;
- return;
+ qDebug("Error fetching mime... ");
+ return false;
}
msg = 0;
if (later) {
storeMail(data,size,"Outgoing");
@@ -129,21 +129,22 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later) {
Config cfg( "mail" );
cfg.setGroup( "Status" );
cfg.writeEntry( "outgoing", ++m_queuedMail );
emit queuedMails( m_queuedMail );
- return;
+ return true;
}
from = getFrom( mail );
rcpts = createRcptList( mail->mm_data.mm_message.mm_fields );
- smtpSend(from,rcpts,data,size);
+ bool result = smtpSend(from,rcpts,data,size);
if (data) {
free(data);
}
if (from) {
free(from);
}
if (rcpts)
smtp_address_list_free( rcpts );
+ return result;
}
void SMTPwrapper::storeFailedMail(const char*data,unsigned int size, const char*failuremessage)
{
@@ -315,26 +316,28 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size )
}
return result;
}
-void SMTPwrapper::sendMail(const Opie::Core::OSmartPointer<Mail>&mail,bool later )
+bool SMTPwrapper::sendMail(const Opie::Core::OSmartPointer<Mail>&mail,bool later )
{
mailmime * mimeMail;
-
+ bool result = true;
mimeMail = createMimeMail(mail );
- if ( mimeMail == NULL ) {
- ; // odebug << "sendMail: error creating mime mail" << oendl;
+ if ( mimeMail == 0 ) {
+ qDebug("SMTP wrapper:Error creating mail! ");
+ return false;
} else {
sendProgress = new progressMailSend();
sendProgress->show();
sendProgress->setMaxMails(1);
- smtpSend( mimeMail,later);
+ result = smtpSend( mimeMail,later);
; // odebug << "Clean up done" << oendl;
sendProgress->hide();
delete sendProgress;
sendProgress = 0;
mailmime_free( mimeMail );
}
+ return result;
}
int SMTPwrapper::sendQueuedMail(AbstractMail*wrap,const RecMailP&which) {
size_t curTok = 0;