author | llornkcor <llornkcor> | 2003-06-09 01:37:23 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-06-09 01:37:23 (UTC) |
commit | 364e6e65b4c3b4ceec2b1b6688f2ca2b3dce4560 (patch) (side-by-side diff) | |
tree | 1be5d3150c2bda4b3a55f9e7d2529d73fe6d72db /noncore/net/mailit/smtpclient.cpp | |
parent | 5ee1c7dff5679454d46e3c5bd5747c60ea63c959 (diff) | |
download | opie-364e6e65b4c3b4ceec2b1b6688f2ca2b3dce4560.zip opie-364e6e65b4c3b4ceec2b1b6688f2ca2b3dce4560.tar.gz opie-364e6e65b4c3b4ceec2b1b6688f2ca2b3dce4560.tar.bz2 |
patch from wim delvaux. fix from me
Diffstat (limited to 'noncore/net/mailit/smtpclient.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mailit/smtpclient.cpp | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/noncore/net/mailit/smtpclient.cpp b/noncore/net/mailit/smtpclient.cpp index 2916f45..5b5ef52 100644 --- a/noncore/net/mailit/smtpclient.cpp +++ b/noncore/net/mailit/smtpclient.cpp @@ -74,5 +74,10 @@ void SmtpClient::connectionEstablished() void SmtpClient::errorHandling(int status) { - emit errorOccurred(status); + errorHandlingWithMsg( status, QString::null ); +} + +void SmtpClient::errorHandlingWithMsg(int status, const QString & EMsg ) +{ + emit errorOccurred(status, EMsg ); socket->close(); mailList.clear(); @@ -88,5 +93,4 @@ void SmtpClient::incomingData() response = socket->readLine(); - switch(status) { case Init: { @@ -95,12 +99,13 @@ void SmtpClient::incomingData() mailPtr = mailList.first(); *stream << "HELO there\r\n"; - } else errorHandling(ErrUnknownResponse); + } else errorHandlingWithMsg(ErrUnknownResponse,response); break; } case From: { if (response[0] == '2') { - *stream << "MAIL FROM: " << mailPtr->from << "\r\n"; + qDebug(mailPtr->from); + *stream << "MAIL FROM: <" << mailPtr->from << ">\r\n"; status = Recv; - } else errorHandling(ErrUnknownResponse); + } else errorHandlingWithMsg(ErrUnknownResponse, response ); break; } @@ -108,9 +113,10 @@ void SmtpClient::incomingData() if (response[0] == '2') { it = mailPtr->to.begin(); - if (it == NULL) - errorHandling(ErrUnknownResponse); - *stream << "RCPT TO: " << *it << ">\r\n"; + if (it == NULL) { + errorHandlingWithMsg(ErrUnknownResponse,response); + } + *stream << "RCPT TO: <" << *it << ">\r\n"; status = MRcv; - } else errorHandling(ErrUnknownResponse); + } else errorHandlingWithMsg(ErrUnknownResponse,response); break; } @@ -124,5 +130,5 @@ void SmtpClient::incomingData() status = Data; } - } else errorHandling(ErrUnknownResponse); + } else errorHandlingWithMsg(ErrUnknownResponse,response); } case Data: { @@ -131,5 +137,6 @@ void SmtpClient::incomingData() status = Body; emit updateStatus(tr("Sending: ") + mailPtr->subject); - } else errorHandling(ErrUnknownResponse); + + } else errorHandlingWithMsg(ErrUnknownResponse,response); break; } @@ -143,5 +150,5 @@ void SmtpClient::incomingData() status = Quit; } - } else errorHandling(ErrUnknownResponse); + } else errorHandlingWithMsg(ErrUnknownResponse,response); break; } @@ -157,5 +164,5 @@ void SmtpClient::incomingData() sending = FALSE; socket->close(); - } else errorHandling(ErrUnknownResponse); + } else errorHandlingWithMsg(ErrUnknownResponse,response); break; } |