summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper
authorzautrix <zautrix>2005-03-11 19:26:02 (UTC)
committer zautrix <zautrix>2005-03-11 19:26:02 (UTC)
commit1166a4797a91cedd5002a3513d5028c5e86016f0 (patch) (side-by-side diff)
tree8e7443bc887a15dcf3852abd36e6e61f2e6bddad /kmicromail/libmailwrapper
parent71462ba8ef1803787bba6793f1adb85987eb57df (diff)
downloadkdepimpi-1166a4797a91cedd5002a3513d5028c5e86016f0.zip
kdepimpi-1166a4797a91cedd5002a3513d5028c5e86016f0.tar.gz
kdepimpi-1166a4797a91cedd5002a3513d5028c5e86016f0.tar.bz2
better kopi export
Diffstat (limited to 'kmicromail/libmailwrapper') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/smtpwrapper.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/kmicromail/libmailwrapper/smtpwrapper.cpp b/kmicromail/libmailwrapper/smtpwrapper.cpp
index 872a460..845c71c 100644
--- a/kmicromail/libmailwrapper/smtpwrapper.cpp
+++ b/kmicromail/libmailwrapper/smtpwrapper.cpp
@@ -246,3 +246,3 @@ void SMTPwrapper::connect_server()
}
- if (try_tls) {
+ if (result && try_tls) {
qDebug("Smpt: Try tls ");
@@ -254,2 +254,4 @@ void SMTPwrapper::connect_server()
err = mailesmtp_ehlo(m_smtp);
+ if ( err != MAILSMTP_NO_ERROR )
+ result = 0;
}
@@ -292,2 +294,6 @@ void SMTPwrapper::connect_server()
}
+ if ( result == 0 ) {
+ mailsmtp_free(m_smtp);
+ m_smtp = 0;
+ }
}
@@ -348,3 +354,7 @@ bool SMTPwrapper::sendMail(const Opie::Core::OSmartPointer<Mail>&mail,bool later
sendProgress = 0;
- mailmime_free( mimeMail );
+ mailmime_free( mimeMail );
+ if ( m_smtp ) {
+ mailsmtp_free(m_smtp);
+ m_smtp = 0;
+ }
}
@@ -460,2 +470,3 @@ bool SMTPwrapper::flushOutbox() {
}
+
KConfig cfg( locateLocal("config", "kopiemailrc" ) );
@@ -469,3 +480,7 @@ bool SMTPwrapper::flushOutbox() {
wrap->deleteMails(mbox,mailsToRemove);
- delete wrap;
+ delete wrap;
+ if ( m_smtp ) {
+ mailsmtp_free(m_smtp);
+ m_smtp = 0;
+ }
return returnValue;