author | zautrix <zautrix> | 2004-07-03 19:26:15 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-07-03 19:26:15 (UTC) |
commit | cc67ce39cdd7730caee878da3b191d76cad9479f (patch) (side-by-side diff) | |
tree | a19e8297fdf060845e1a81b58afe5272a58c3b61 /kmicromail/libmailwrapper/smtpwrapper.cpp | |
parent | 55413f404aa7a59bfbf38f9f91fabb595eca57ad (diff) | |
download | kdepimpi-cc67ce39cdd7730caee878da3b191d76cad9479f.zip kdepimpi-cc67ce39cdd7730caee878da3b191d76cad9479f.tar.gz kdepimpi-cc67ce39cdd7730caee878da3b191d76cad9479f.tar.bz2 |
better error handling
Diffstat (limited to 'kmicromail/libmailwrapper/smtpwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kmicromail/libmailwrapper/smtpwrapper.cpp | 23 |
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 @@ -103,5 +103,5 @@ void SMTPwrapper::storeMail(const char*mail, size_t length, const QString&box) { } -void SMTPwrapper::smtpSend( mailmime *mail,bool later) { +bool SMTPwrapper::smtpSend( mailmime *mail,bool later) { clist *rcpts = 0; char *from, *data; @@ -119,6 +119,6 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later) { if (data) free(data); - ; // odebug << "Error fetching mime..." << oendl; - return; + qDebug("Error fetching mime... "); + return false; } msg = 0; @@ -131,9 +131,9 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later) { 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); @@ -144,4 +144,5 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later) { if (rcpts) smtp_address_list_free( rcpts ); + return result; } @@ -317,16 +318,17 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size ) } -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(); @@ -335,4 +337,5 @@ void SMTPwrapper::sendMail(const Opie::Core::OSmartPointer<Mail>&mail,bool later mailmime_free( mimeMail ); } + return result; } |