summaryrefslogtreecommitdiffabout
path: root/kmicromail
authorzautrix <zautrix>2004-07-03 19:26:15 (UTC)
committer zautrix <zautrix>2004-07-03 19:26:15 (UTC)
commitcc67ce39cdd7730caee878da3b191d76cad9479f (patch) (unidiff)
treea19e8297fdf060845e1a81b58afe5272a58c3b61 /kmicromail
parent55413f404aa7a59bfbf38f9f91fabb595eca57ad (diff)
downloadkdepimpi-cc67ce39cdd7730caee878da3b191d76cad9479f.zip
kdepimpi-cc67ce39cdd7730caee878da3b191d76cad9479f.tar.gz
kdepimpi-cc67ce39cdd7730caee878da3b191d76cad9479f.tar.bz2
better error handling
Diffstat (limited to 'kmicromail') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/composemail.cpp14
-rw-r--r--kmicromail/libmailwrapper/smtpwrapper.cpp23
-rw-r--r--kmicromail/libmailwrapper/smtpwrapper.h4
3 files changed, 25 insertions, 16 deletions
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp
index 2c2e279..ca4f247 100644
--- a/kmicromail/composemail.cpp
+++ b/kmicromail/composemail.cpp
@@ -123,3 +123,3 @@ void ComposeMail::saveAsDraft()
123 /* attachments we will ignore! */ 123 /* attachments we will ignore! */
124 if ( it != NULL ) { 124 if ( it != 0 ) {
125 if ( warnAttach ) 125 if ( warnAttach )
@@ -138,3 +138,3 @@ void ComposeMail::setStatus( QString status )
138 topLevelWidget()->setCaption( status ); 138 topLevelWidget()->setCaption( status );
139 QTimer::singleShot ( 5000, this, SLOT( clearStatus() ) ) ; 139 QTimer::singleShot ( 10000, this, SLOT( clearStatus() ) ) ;
140} 140}
@@ -302,3 +302,3 @@ void ComposeMail::accept()
302 AttachViewItem *it = (AttachViewItem *) attList->firstChild(); 302 AttachViewItem *it = (AttachViewItem *) attList->firstChild();
303 while ( it != NULL ) { 303 while ( it != 0 ) {
304 mail->addAttachment( it->getAttachment() ); 304 mail->addAttachment( it->getAttachment() );
@@ -308,3 +308,9 @@ void ComposeMail::accept()
308 SMTPwrapper wrapper( smtp ); 308 SMTPwrapper wrapper( smtp );
309 wrapper.sendMail( mail,checkBoxLater->isChecked() ); 309 if ( wrapper.sendMail( mail,checkBoxLater->isChecked() ) )
310 setStatus( tr ("Mail sent"));
311 else {
312 setStatus( tr ("Error: Something went wrong. Nothing sent"));
313 return;
314 }
315
310 316
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) {
104 104
105void SMTPwrapper::smtpSend( mailmime *mail,bool later) { 105bool SMTPwrapper::smtpSend( mailmime *mail,bool later) {
106 clist *rcpts = 0; 106 clist *rcpts = 0;
@@ -120,4 +120,4 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later) {
120 free(data); 120 free(data);
121 ; // odebug << "Error fetching mime..." << oendl; 121 qDebug("Error fetching mime... ");
122 return; 122 return false;
123 } 123 }
@@ -132,3 +132,3 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later) {
132 emit queuedMails( m_queuedMail ); 132 emit queuedMails( m_queuedMail );
133 return; 133 return true;
134 } 134 }
@@ -136,3 +136,3 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later) {
136 rcpts = createRcptList( mail->mm_data.mm_message.mm_fields ); 136 rcpts = createRcptList( mail->mm_data.mm_message.mm_fields );
137 smtpSend(from,rcpts,data,size); 137 bool result = smtpSend(from,rcpts,data,size);
138 if (data) { 138 if (data) {
@@ -145,2 +145,3 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later) {
145 smtp_address_list_free( rcpts ); 145 smtp_address_list_free( rcpts );
146 return result;
146} 147}
@@ -318,9 +319,10 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size )
318 319
319void SMTPwrapper::sendMail(const Opie::Core::OSmartPointer<Mail>&mail,bool later ) 320bool SMTPwrapper::sendMail(const Opie::Core::OSmartPointer<Mail>&mail,bool later )
320{ 321{
321 mailmime * mimeMail; 322 mailmime * mimeMail;
322 323 bool result = true;
323 mimeMail = createMimeMail(mail ); 324 mimeMail = createMimeMail(mail );
324 if ( mimeMail == NULL ) { 325 if ( mimeMail == 0 ) {
325 ; // odebug << "sendMail: error creating mime mail" << oendl; 326 qDebug("SMTP wrapper:Error creating mail! ");
327 return false;
326 } else { 328 } else {
@@ -329,3 +331,3 @@ void SMTPwrapper::sendMail(const Opie::Core::OSmartPointer<Mail>&mail,bool later
329 sendProgress->setMaxMails(1); 331 sendProgress->setMaxMails(1);
330 smtpSend( mimeMail,later); 332 result = smtpSend( mimeMail,later);
331 ; // odebug << "Clean up done" << oendl; 333 ; // odebug << "Clean up done" << oendl;
@@ -336,2 +338,3 @@ void SMTPwrapper::sendMail(const Opie::Core::OSmartPointer<Mail>&mail,bool later
336 } 338 }
339 return result;
337} 340}
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:
25 virtual ~SMTPwrapper(); 25 virtual ~SMTPwrapper();
26 void sendMail(const Opie::Core::OSmartPointer<Mail>& mail,bool later=false ); 26 bool sendMail(const Opie::Core::OSmartPointer<Mail>& mail,bool later=false );
27 bool flushOutbox(); 27 bool flushOutbox();
@@ -42,3 +42,3 @@ protected:
42 42
43 void smtpSend( mailmime *mail,bool later); 43 bool smtpSend( mailmime *mail,bool later);
44 44