summaryrefslogtreecommitdiffabout
path: root/kmicromail
authorzautrix <zautrix>2004-10-31 18:40:14 (UTC)
committer zautrix <zautrix>2004-10-31 18:40:14 (UTC)
commit16292c7f13b40a07b51b41c701cd106ccfd2f37b (patch) (side-by-side diff)
treef3e2dfe11b00f1d910eaeaafd28b0d97aa717ce1 /kmicromail
parent043e2d256df36945779bf4568df46b6e4ae51e0e (diff)
downloadkdepimpi-16292c7f13b40a07b51b41c701cd106ccfd2f37b.zip
kdepimpi-16292c7f13b40a07b51b41c701cd106ccfd2f37b.tar.gz
kdepimpi-16292c7f13b40a07b51b41c701cd106ccfd2f37b.tar.bz2
hope it works..
Diffstat (limited to 'kmicromail') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/smtpwrapper.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/kmicromail/libmailwrapper/smtpwrapper.cpp b/kmicromail/libmailwrapper/smtpwrapper.cpp
index eb07ef1..f54fe2b 100644
--- a/kmicromail/libmailwrapper/smtpwrapper.cpp
+++ b/kmicromail/libmailwrapper/smtpwrapper.cpp
@@ -6,49 +6,49 @@
#include "sendmailprogress.h"
//#include <opie2/odebug.h>
//#include <qt.h>
#include <qapplication.h>
#include <qmessagebox.h>
#include <stdlib.h>
#ifndef DESKTOP_VERSION
//#include <qpe/config.h>
#include <qpe/qcopenvelope_qws.h>
#endif
#include <libetpan/libetpan.h>
#include <klocale.h>
#include <kglobal.h>
#include <kconfig.h>
using namespace Opie::Core;
progressMailSend*SMTPwrapper::sendProgress = 0;
SMTPwrapper::SMTPwrapper(SMTPaccount * aSmtp )
: Generatemail()
{
m_SmtpAccount = aSmtp;
- KConfig cfg( locateLocal("config", "kopiemail" ) );
+ KConfig cfg( locateLocal("config", "kopiemailrc" ) );
cfg.setGroup( "Status" );
m_queuedMail = cfg.readNumEntry( "outgoing", 0 );
emit queuedMails( m_queuedMail );
connect( this, SIGNAL( queuedMails(int) ), this, SLOT( emitQCop(int) ) );
m_smtp = 0;
}
SMTPwrapper::~SMTPwrapper()
{
disc_server();
}
void SMTPwrapper::emitQCop( int queued ) {
#ifndef DESKTOP_VERSION
QCopEnvelope env( "QPE/Pim", "outgoingMails(int)" );
env << queued;
#endif
}
QString SMTPwrapper::mailsmtpError( int errnum ) {
switch ( errnum ) {
case MAILSMTP_NO_ERROR:
return i18n( "No error" );
case MAILSMTP_ERROR_UNEXPECTED_CODE:
@@ -111,49 +111,49 @@ void SMTPwrapper::storeMail(const char*mail, size_t length, const QString&box) {
bool SMTPwrapper::smtpSend( mailmime *mail,bool later) {
clist *rcpts = 0;
char *from, *data;
size_t size;
from = data = 0;
mailmessage * msg = 0;
msg = mime_message_init(mail);
mime_message_set_tmpdir(msg,getenv( "HOME" ));
int r = mailmessage_fetch(msg,&data,&size);
mime_message_detach_mime(msg);
mailmessage_free(msg);
if (r != MAIL_NO_ERROR || !data) {
if (data)
free(data);
qDebug("Error fetching mime... ");
return false;
}
msg = 0;
if (later) {
storeMail(data,size,"Outgoing");
if (data)
free( data );
- KConfig cfg( locateLocal("config", "kopiemail" ) );
+ KConfig cfg( locateLocal("config", "kopiemailrc" ) );
cfg.setGroup( "Status" );
cfg.writeEntry( "outgoing", ++m_queuedMail );
emit queuedMails( m_queuedMail );
return true;
}
from = getFrom( mail );
rcpts = createRcptList( mail->mm_data.mm_message.mm_fields );
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)
{
if (data) {
storeMail(data,size,"Sendfailed");
}
@@ -431,36 +431,36 @@ bool SMTPwrapper::flushOutbox() {
return true;
}
}
sendProgress = new progressMailSend();
sendProgress->show();
sendProgress->setMaxMails(mailsToSend.count());
while (mailsToSend.count()>0) {
if (sendQueuedMail(wrap, (*mailsToSend.begin()))==0) {
QMessageBox::critical(0,i18n("Error sending mail"),
i18n("Error sending queued mail - breaking"));
returnValue = false;
break;
}
mailsToRemove.append((*mailsToSend.begin()));
mailsToSend.remove(mailsToSend.begin());
sendProgress->setCurrentMails(mailsToRemove.count());
}
if (reset_user_value) {
m_SmtpAccount->setUser(oldUser);
m_SmtpAccount->setPassword(oldPw);
}
- KConfig cfg( locateLocal("config", "kopiemail" ) );
+ KConfig cfg( locateLocal("config", "kopiemailrc" ) );
cfg.setGroup( "Status" );
m_queuedMail = 0;
cfg.writeEntry( "outgoing", m_queuedMail );
emit queuedMails( m_queuedMail );
sendProgress->hide();
delete sendProgress;
sendProgress = 0;
wrap->deleteMails(mbox,mailsToRemove);
delete wrap;
return returnValue;
}