summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper
authorzautrix <zautrix>2004-07-03 19:26:15 (UTC)
committer zautrix <zautrix>2004-07-03 19:26:15 (UTC)
commitcc67ce39cdd7730caee878da3b191d76cad9479f (patch) (side-by-side diff)
treea19e8297fdf060845e1a81b58afe5272a58c3b61 /kmicromail/libmailwrapper
parent55413f404aa7a59bfbf38f9f91fabb595eca57ad (diff)
downloadkdepimpi-cc67ce39cdd7730caee878da3b191d76cad9479f.zip
kdepimpi-cc67ce39cdd7730caee878da3b191d76cad9479f.tar.gz
kdepimpi-cc67ce39cdd7730caee878da3b191d76cad9479f.tar.bz2
better error handling
Diffstat (limited to 'kmicromail/libmailwrapper') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/smtpwrapper.cpp23
-rw-r--r--kmicromail/libmailwrapper/smtpwrapper.h4
2 files changed, 15 insertions, 12 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
@@ -104,3 +104,3 @@ 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;
@@ -120,4 +120,4 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later) {
free(data);
- ; // odebug << "Error fetching mime..." << oendl;
- return;
+ qDebug("Error fetching mime... ");
+ return false;
}
@@ -132,3 +132,3 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later) {
emit queuedMails( m_queuedMail );
- return;
+ return true;
}
@@ -136,3 +136,3 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later) {
rcpts = createRcptList( mail->mm_data.mm_message.mm_fields );
- smtpSend(from,rcpts,data,size);
+ bool result = smtpSend(from,rcpts,data,size);
if (data) {
@@ -145,2 +145,3 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later) {
smtp_address_list_free( rcpts );
+ return result;
}
@@ -318,9 +319,10 @@ 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 {
@@ -329,3 +331,3 @@ void SMTPwrapper::sendMail(const Opie::Core::OSmartPointer<Mail>&mail,bool later
sendProgress->setMaxMails(1);
- smtpSend( mimeMail,later);
+ result = smtpSend( mimeMail,later);
; // odebug << "Clean up done" << oendl;
@@ -336,2 +338,3 @@ void SMTPwrapper::sendMail(const Opie::Core::OSmartPointer<Mail>&mail,bool later
}
+ return result;
}
diff --git a/kmicromail/libmailwrapper/smtpwrapper.h b/kmicromail/libmailwrapper/smtpwrapper.h
index 6c5bbe8..105cbf5 100644
--- a/kmicromail/libmailwrapper/smtpwrapper.h
+++ b/kmicromail/libmailwrapper/smtpwrapper.h
@@ -25,3 +25,3 @@ public:
virtual ~SMTPwrapper();
- void sendMail(const Opie::Core::OSmartPointer<Mail>& mail,bool later=false );
+ bool sendMail(const Opie::Core::OSmartPointer<Mail>& mail,bool later=false );
bool flushOutbox();
@@ -42,3 +42,3 @@ protected:
- void smtpSend( mailmime *mail,bool later);
+ bool smtpSend( mailmime *mail,bool later);