summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/mail/libmailwrapper/smtpwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/smtpwrapper.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
index e2cea7a..ba78c3b 100644
--- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
@@ -112,13 +112,13 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later) {
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...");
+ odebug << "Error fetching mime..." << oendl;
return;
}
msg = 0;
if (later) {
storeMail(data,size,"Outgoing");
if (data)
@@ -205,22 +205,22 @@ void SMTPwrapper::connect_server()
/* no failure message cause this happens when problems with memory - than we
we can not display any messagebox */
return;
}
int err = MAILSMTP_NO_ERROR;
- qDebug( "Servername %s at port %i", server, port );
+ odebug << "Servername " << server << " at port " << port << "" << oendl;
if ( ssl ) {
- qDebug( "SSL session" );
+ odebug << "SSL session" << oendl;
err = mailsmtp_ssl_connect( m_smtp, server, port );
} else {
- qDebug( "No SSL session" );
+ odebug << "No SSL session" << oendl;
err = mailsmtp_socket_connect( m_smtp, server, port );
}
if ( err != MAILSMTP_NO_ERROR ) {
- qDebug("Error init connection");
+ odebug << "Error init connection" << oendl;
failuretext = tr("Error init SMTP connection: %1").arg(mailsmtpError(err));
result = 0;
}
/* switch to tls after init 'cause there it will send the ehlo */
if (result) {
@@ -243,13 +243,13 @@ void SMTPwrapper::connect_server()
if (!try_tls && force_tls) {
result = 0;
failuretext = tr("Error init SMTP tls: %1").arg(mailsmtpError(err));
}
if (result==1 && m_SmtpAccount->getLogin() ) {
- qDebug("smtp with auth");
+ odebug << "smtp with auth" << oendl;
if ( m_SmtpAccount->getUser().isEmpty() || m_SmtpAccount->getPassword().isEmpty() ) {
// get'em
LoginDialog login( m_SmtpAccount->getUser(),
m_SmtpAccount->getPassword(), NULL, 0, true );
login.show();
if ( QDialog::Accepted == login.exec() ) {
@@ -261,17 +261,17 @@ void SMTPwrapper::connect_server()
failuretext=tr("Login aborted - storing mail to localfolder");
}
} else {
user = m_SmtpAccount->getUser().latin1();
pass = m_SmtpAccount->getPassword().latin1();
}
- qDebug( "session->auth: %i", m_smtp->auth);
+ odebug << "session->auth: " << m_smtp->auth << "" << oendl;
if (result) {
err = mailsmtp_auth( m_smtp, (char*)user, (char*)pass );
if ( err == MAILSMTP_NO_ERROR ) {
- qDebug("auth ok");
+ odebug << "auth ok" << oendl;
} else {
failuretext = tr("Authentification failed");
result = 0;
}
}
}
@@ -304,31 +304,31 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size )
result = 0;
}
if (!result) {
storeFailedMail(data,size,failuretext);
} else {
- qDebug( "Mail sent." );
+ odebug << "Mail sent." << oendl;
storeMail(data,size,"Sent");
}
return result;
}
void SMTPwrapper::sendMail(const Opie::Core::OSmartPointer<Mail>&mail,bool later )
{
mailmime * mimeMail;
mimeMail = createMimeMail(mail );
if ( mimeMail == NULL ) {
- qDebug( "sendMail: error creating mime mail" );
+ odebug << "sendMail: error creating mime mail" << oendl;
} else {
sendProgress = new progressMailSend();
sendProgress->show();
sendProgress->setMaxMails(1);
smtpSend( mimeMail,later);
- qDebug("Clean up done");
+ odebug << "Clean up done" << oendl;
sendProgress->hide();
delete sendProgress;
sendProgress = 0;
mailmime_free( mimeMail );
}
}
@@ -375,33 +375,33 @@ int SMTPwrapper::sendQueuedMail(AbstractMail*wrap,const RecMailP&which) {
}
/* this is a special fun */
bool SMTPwrapper::flushOutbox() {
bool returnValue = true;
- qDebug("Sending the queue");
+ odebug << "Sending the queue" << oendl;
if (!m_SmtpAccount) {
- qDebug("No smtp account given");
+ odebug << "No smtp account given" << oendl;
return false;
}
bool reset_user_value = false;
QString localfolders = AbstractMail::defaultLocalfolder();
AbstractMail*wrap = AbstractMail::getWrapper(localfolders);
if (!wrap) {
- qDebug("memory error");
+ odebug << "memory error" << oendl;
return false;
}
QString oldPw, oldUser;
QValueList<RecMailP> mailsToSend;
QValueList<RecMailP> mailsToRemove;
QString mbox("Outgoing");
wrap->listMessages(mbox,mailsToSend);
if (mailsToSend.count()==0) {
delete wrap;
- qDebug("No mails to send");
+ odebug << "No mails to send" << oendl;
return false;
}
oldPw = m_SmtpAccount->getPassword();
oldUser = m_SmtpAccount->getUser();
if (m_SmtpAccount->getLogin() && (m_SmtpAccount->getUser().isEmpty() || m_SmtpAccount->getPassword().isEmpty()) ) {