summaryrefslogtreecommitdiffstats
path: root/kioslave/smtp
diff options
context:
space:
mode:
Diffstat (limited to 'kioslave/smtp')
-rw-r--r--kioslave/smtp/command.cc22
-rw-r--r--kioslave/smtp/command.h4
-rw-r--r--kioslave/smtp/response.cc16
-rw-r--r--kioslave/smtp/smtp.cc24
-rw-r--r--kioslave/smtp/smtp.h2
-rw-r--r--kioslave/smtp/test_commands.cc10
-rw-r--r--kioslave/smtp/transactionstate.cc6
7 files changed, 42 insertions, 42 deletions
diff --git a/kioslave/smtp/command.cc b/kioslave/smtp/command.cc
index 2771baf82..2971c291a 100644
--- a/kioslave/smtp/command.cc
+++ b/kioslave/smtp/command.cc
@@ -134,7 +134,7 @@ static sasl_callback_t callbacks[] = {
// "command not {recognized,implemented}" response:
if ( r.code() == 500 || r.code() == 502 ) {
if ( mEHLONotSupported ) { // HELO failed...
- mSMTP->error( KIO::ERR_INTERNAL_SERVER,
+ mSMTP->error( TDEIO::ERR_INTERNAL_SERVER,
i18n("The server rejected both EHLO and HELO commands "
"as unknown or unimplemented.\n"
"Please contact the server's system administrator.") );
@@ -148,7 +148,7 @@ static sasl_callback_t callbacks[] = {
parseFeatures( r );
return true;
}
- mSMTP->error( KIO::ERR_UNKNOWN,
+ mSMTP->error( TDEIO::ERR_UNKNOWN,
i18n("Unexpected server response to %1 command.\n%2")
.arg( mEHLONotSupported ? "HELO" : "EHLO" )
.arg( r.errorMessage() ) );
@@ -182,7 +182,7 @@ static sasl_callback_t callbacks[] = {
if ( tlsrc != -3 )
//kdDebug(7112) << "TLS negotiation failed!" << endl;
- mSMTP->messageBox(KIO::SlaveBase::Information,
+ mSMTP->messageBox(TDEIO::SlaveBase::Information,
i18n("Your SMTP server claims to "
"support TLS, but negotiation "
"was unsuccessful.\nYou can "
@@ -193,7 +193,7 @@ static sasl_callback_t callbacks[] = {
}
-#define SASLERROR mSMTP->error(KIO::ERR_COULD_NOT_AUTHENTICATE, \
+#define SASLERROR mSMTP->error(TDEIO::ERR_COULD_NOT_AUTHENTICATE, \
i18n("An error occured during authentication: %1").arg \
( TQString::fromUtf8( sasl_errdetail( conn ) )));
@@ -203,7 +203,7 @@ static sasl_callback_t callbacks[] = {
AuthCommand::AuthCommand( SMTPProtocol * smtp,
const char *mechanisms,
const TQString &aFQDN,
- KIO::AuthInfo &ai )
+ TDEIO::AuthInfo &ai )
: Command( smtp, CloseConnectionOnError|OnlyLastInPipeline ),
mAi( &ai ),
mFirstTime( true )
@@ -238,7 +238,7 @@ static sasl_callback_t callbacks[] = {
if ( result == SASL_OK ) mOneStep = true;
kdDebug(7112) << "Mechanism: " << mMechusing << " one step: " << mOneStep << endl;
#else
- mSMTP->error(KIO::ERR_COULD_NOT_AUTHENTICATE,
+ mSMTP->error(TDEIO::ERR_COULD_NOT_AUTHENTICATE,
i18n("Authentication support is not compiled into kio_smtp."));
#endif
}
@@ -268,7 +268,7 @@ static sasl_callback_t callbacks[] = {
if ( mAi->username.isEmpty() || mAi->password.isEmpty()) {
if (!mSMTP->openPassDlg(*mAi)) {
- mSMTP->error(KIO::ERR_ABORTED, i18n("No authentication details supplied."));
+ mSMTP->error(TDEIO::ERR_ABORTED, i18n("No authentication details supplied."));
return false;
}
}
@@ -370,15 +370,15 @@ static sasl_callback_t callbacks[] = {
if ( !r.isOk() ) {
if ( mFirstTime )
if ( haveCapability( "AUTH" ) )
- mSMTP->error( KIO::ERR_COULD_NOT_LOGIN,
+ mSMTP->error( TDEIO::ERR_COULD_NOT_LOGIN,
i18n("Your SMTP server does not support %1.\nChoose a different authentication method.\n%2")
.arg( mMechusing ).arg( r.errorMessage() ) );
else
- mSMTP->error( KIO::ERR_COULD_NOT_LOGIN,
+ mSMTP->error( TDEIO::ERR_COULD_NOT_LOGIN,
i18n("Your SMTP server does not support authentication.\n"
" %2").arg( r.errorMessage() ) );
else
- mSMTP->error( KIO::ERR_COULD_NOT_LOGIN,
+ mSMTP->error( TDEIO::ERR_COULD_NOT_LOGIN,
i18n("Authentication failed.\n"
"Most likely the password is wrong.\n"
"%1").arg( r.errorMessage() ) );
@@ -516,7 +516,7 @@ static sasl_callback_t callbacks[] = {
if ( result > 0 )
return prepare( ba );
else if ( result < 0 ) {
- ts->setFailedFatally( KIO::ERR_INTERNAL,
+ ts->setFailedFatally( TDEIO::ERR_INTERNAL,
i18n("Could not read data from application.") );
mComplete = true;
mNeedResponse = true;
diff --git a/kioslave/smtp/command.h b/kioslave/smtp/command.h
index 53e8d00f3..ed3e1fb66 100644
--- a/kioslave/smtp/command.h
+++ b/kioslave/smtp/command.h
@@ -176,7 +176,7 @@ namespace KioSMTP {
class AuthCommand : public Command {
public:
AuthCommand( SMTPProtocol * smtp, const char *mechanisms,
- const TQString &aFQDN, KIO::AuthInfo &ai );
+ const TQString &aFQDN, TDEIO::AuthInfo &ai );
~AuthCommand();
bool doNotExecute( const TransactionState * ts ) const;
TQCString nextCommandLine( TransactionState * );
@@ -193,7 +193,7 @@ namespace KioSMTP {
uint mOutlen;
bool mOneStep;
- KIO::AuthInfo *mAi;
+ TDEIO::AuthInfo *mAi;
TQCString mLastChallenge;
TQCString mUngetSASLResponse;
bool mFirstTime;
diff --git a/kioslave/smtp/response.cc b/kioslave/smtp/response.cc
index 8ae8cdceb..0ddce0e5a 100644
--- a/kioslave/smtp/response.cc
+++ b/kioslave/smtp/response.cc
@@ -119,41 +119,41 @@ namespace KioSMTP {
case 454: // TLS not available due to temporary reason
// Temporary authentication failure
case 554: // Transaction failed / No SMTP service here / No valid recipients
- return KIO::ERR_SERVICE_NOT_AVAILABLE;
+ return TDEIO::ERR_SERVICE_NOT_AVAILABLE;
case 451: // Requested action aborted: local error in processing
- return KIO::ERR_INTERNAL_SERVER;
+ return TDEIO::ERR_INTERNAL_SERVER;
case 452: // Requested action not taken: insufficient system storage
case 552: // Requested mail action aborted: exceeded storage allocation
- return KIO::ERR_DISK_FULL;
+ return TDEIO::ERR_DISK_FULL;
case 500: // Syntax error, command unrecognized
case 501: // Syntax error in parameters or arguments
case 502: // Command not implemented
case 503: // Bad sequence of commands
case 504: // Command parameter not implemented
- return KIO::ERR_INTERNAL;
+ return TDEIO::ERR_INTERNAL;
case 450: // Requested mail action not taken: mailbox unavailable
case 550: // Requested action not taken: mailbox unavailable
case 551: // User not local; please try <forward-path>
case 553: // Requested action not taken: mailbox name not allowed
- return KIO::ERR_DOES_NOT_EXIST;
+ return TDEIO::ERR_DOES_NOT_EXIST;
case 530: // {STARTTLS,Authentication} required
case 538: // Encryption required for requested authentication mechanism
case 534: // Authentication mechanism is too weak
- return KIO::ERR_UPGRADE_REQUIRED;
+ return TDEIO::ERR_UPGRADE_REQUIRED;
case 432: // A password transition is needed
- return KIO::ERR_COULD_NOT_AUTHENTICATE;
+ return TDEIO::ERR_COULD_NOT_AUTHENTICATE;
default:
if ( isPositive() )
return 0;
else
- return KIO::ERR_UNKNOWN;
+ return TDEIO::ERR_UNKNOWN;
}
}
diff --git a/kioslave/smtp/smtp.cc b/kioslave/smtp/smtp.cc
index 55352aed6..b1effa415 100644
--- a/kioslave/smtp/smtp.cc
+++ b/kioslave/smtp/smtp.cc
@@ -170,7 +170,7 @@ void SMTPProtocol::special( const TQByteArray & aData ) {
if ( !execute( Command::NOOP ) )
return;
} else {
- error( KIO::ERR_INTERNAL,
+ error( TDEIO::ERR_INTERNAL,
i18n("The application sent an invalid request.") );
return;
}
@@ -233,14 +233,14 @@ void SMTPProtocol::put(const KURL & url, int /*permissions */ ,
if ( !from.isNull() )
request.setFromAddress( from );
else if ( request.emitHeaders() ) {
- error(KIO::ERR_NO_CONTENT, i18n("The sender address is missing."));
+ error(TDEIO::ERR_NO_CONTENT, i18n("The sender address is missing."));
return;
}
}
if ( !smtp_open( request.heloHostname() ) )
{
- error(KIO::ERR_SERVICE_NOT_AVAILABLE,
+ error(TDEIO::ERR_SERVICE_NOT_AVAILABLE,
i18n("SMTPProtocol::smtp_open failed (%1)") // ### better error message?
.arg(open_url.path()));
return;
@@ -248,7 +248,7 @@ void SMTPProtocol::put(const KURL & url, int /*permissions */ ,
if ( request.is8BitBody()
&& !haveCapability("8BITMIME") && metaData("8bitmime") != "on" ) {
- error( KIO::ERR_SERVICE_NOT_AVAILABLE,
+ error( TDEIO::ERR_SERVICE_NOT_AVAILABLE,
i18n("Your server does not support sending of 8-bit messages.\n"
"Please use base64 or quoted-printable encoding.") );
return;
@@ -290,7 +290,7 @@ bool SMTPProtocol::sendCommandLine( const TQCString & cmdline ) {
kdDebug( 7112) << "C: <" << cmdline.length() << " bytes>" << endl;
ssize_t cmdline_len = cmdline.length();
if ( write( cmdline.data(), cmdline_len ) != cmdline_len ) {
- error( KIO::ERR_COULD_NOT_WRITE, m_sServer );
+ error( TDEIO::ERR_COULD_NOT_WRITE, m_sServer );
return false;
}
return true;
@@ -308,14 +308,14 @@ Response SMTPProtocol::getResponse( bool * ok ) {
do {
// wait for data...
if ( !waitForResponse( 600 ) ) {
- error( KIO::ERR_SERVER_TIMEOUT, m_sServer );
+ error( TDEIO::ERR_SERVER_TIMEOUT, m_sServer );
return response;
}
// ...read data...
recv_len = readLine( buf, sizeof(buf) - 1 );
if ( recv_len < 1 && !isConnectionValid() ) {
- error( KIO::ERR_CONNECTION_BROKEN, m_sServer );
+ error( TDEIO::ERR_CONNECTION_BROKEN, m_sServer );
return response;
}
@@ -328,7 +328,7 @@ Response SMTPProtocol::getResponse( bool * ok ) {
} while ( !response.isComplete() && response.isWellFormed() );
if ( !response.isValid() ) {
- error( KIO::ERR_NO_CONTENT, i18n("Invalid SMTP response (%1) received.").arg(response.code()) );
+ error( TDEIO::ERR_NO_CONTENT, i18n("Invalid SMTP response (%1) received.").arg(response.code()) );
return response;
}
@@ -514,7 +514,7 @@ bool SMTPProtocol::smtp_open(const TQString& fakeHostname)
if ( !ok || !greeting.isOk() )
{
if ( ok )
- error( KIO::ERR_COULD_NOT_LOGIN,
+ error( TDEIO::ERR_COULD_NOT_LOGIN,
i18n("The server did not accept the connection.\n"
"%1").arg( greeting.errorMessage() ) );
smtp_close();
@@ -528,7 +528,7 @@ bool SMTPProtocol::smtp_open(const TQString& fakeHostname)
else
{
TQString tmpPort;
- KSocketAddress* addr = KExtendedSocket::localAddress(m_iSock);
+ TDESocketAddress* addr = KExtendedSocket::localAddress(m_iSock);
// perform name lookup. NI_NAMEREQD means: don't return a numeric
// value (we need to know when we get have the IP address, so we
// can enclose it in sqaure brackets (domain-literal). Failure to
@@ -587,7 +587,7 @@ bool SMTPProtocol::authenticate()
if ( (m_sUser.isEmpty() || !haveCapability( "AUTH" )) &&
metaData( "sasl" ).isEmpty() ) return true;
- KIO::AuthInfo authInfo;
+ TDEIO::AuthInfo authInfo;
authInfo.username = m_sUser;
authInfo.password = m_sPass;
authInfo.prompt = i18n("Username and password for your SMTP account:");
@@ -642,6 +642,6 @@ void SMTPProtocol::smtp_close( bool nice ) {
void SMTPProtocol::stat(const KURL & url)
{
TQString path = url.path();
- error(KIO::ERR_DOES_NOT_EXIST, url.path());
+ error(TDEIO::ERR_DOES_NOT_EXIST, url.path());
}
diff --git a/kioslave/smtp/smtp.h b/kioslave/smtp/smtp.h
index bcdcaaae3..eef1aab42 100644
--- a/kioslave/smtp/smtp.h
+++ b/kioslave/smtp/smtp.h
@@ -49,7 +49,7 @@ namespace KioSMTP {
class Command;
}
-class SMTPProtocol : public KIO::TCPSlaveBase {
+class SMTPProtocol : public TDEIO::TCPSlaveBase {
friend class KioSMTP::Command;
public:
SMTPProtocol(const TQCString & pool, const TQCString & app, bool useSSL);
diff --git a/kioslave/smtp/test_commands.cc b/kioslave/smtp/test_commands.cc
index 23d7723ee..458b386b8 100644
--- a/kioslave/smtp/test_commands.cc
+++ b/kioslave/smtp/test_commands.cc
@@ -31,7 +31,7 @@ public:
TQByteArray nextData;
int nextDataReturnCode;
TQStringList caps;
- KIO::MetaData metadata;
+ TDEIO::MetaData metadata;
void clear() {
startTLSReturnCode = 1;
@@ -161,7 +161,7 @@ int main( int, char** ) {
assert( ehlo3.processResponse( r, 0 ) == false );
assert( ehlo3.isComplete() );
assert( !ehlo3.needsResponse() );
- assert( smtp.lastErrorCode == KIO::ERR_UNKNOWN );
+ assert( smtp.lastErrorCode == TDEIO::ERR_UNKNOWN );
// dynamics 4: EHLO _and_ HELO fail with "command unknown"
smtp.clear();
@@ -176,7 +176,7 @@ int main( int, char** ) {
assert( ehlo4.processResponse( r, 0 ) == false );
assert( ehlo4.isComplete() );
assert( !ehlo4.needsResponse() );
- assert( smtp.lastErrorCode == KIO::ERR_INTERNAL_SERVER );
+ assert( smtp.lastErrorCode == TDEIO::ERR_INTERNAL_SERVER );
//
// STARTTLS
@@ -218,7 +218,7 @@ int main( int, char** ) {
smtp.startTLSReturnCode = 1;
assert( tls2.processResponse( r, &ts ) == false );
assert( !tls2.needsResponse() );
- assert( smtp.lastErrorCode == KIO::ERR_SERVICE_NOT_AVAILABLE );
+ assert( smtp.lastErrorCode == TDEIO::ERR_SERVICE_NOT_AVAILABLE );
// dynamics 3: ok from server, TLS negotiation unsuccessful
smtp.clear();
@@ -710,7 +710,7 @@ void checkSuccessfulTransferCommand( bool error, bool preload, bool ungetLast,
assert( !xfer.needsResponse() );
assert( ts.complete() );
assert( ts.failed() );
- assert( smtp.lastErrorCode == KIO::ERR_DISK_FULL );
+ assert( smtp.lastErrorCode == TDEIO::ERR_DISK_FULL );
} else {
r.parseLine( "250 Message accepted" );
assert( xfer.processResponse( r, &ts ) == true );
diff --git a/kioslave/smtp/transactionstate.cc b/kioslave/smtp/transactionstate.cc
index 67d61486a..b34b45227 100644
--- a/kioslave/smtp/transactionstate.cc
+++ b/kioslave/smtp/transactionstate.cc
@@ -48,7 +48,7 @@ namespace KioSMTP {
void TransactionState::setMailFromFailed( const TQString & addr, const Response & r ) {
setFailed();
- mErrorCode = KIO::ERR_NO_CONTENT;
+ mErrorCode = TDEIO::ERR_NO_CONTENT;
if ( addr.isEmpty() )
mErrorMessage = i18n("The server did not accept a blank sender address.\n"
"%1").arg( r.errorMessage() );
@@ -81,9 +81,9 @@ namespace KioSMTP {
if ( mErrorCode )
return mErrorCode;
if ( haveRejectedRecipients() || !dataCommandSucceeded() )
- return KIO::ERR_NO_CONTENT;
+ return TDEIO::ERR_NO_CONTENT;
// ### what else?
- return KIO::ERR_INTERNAL;
+ return TDEIO::ERR_INTERNAL;
}
TQString TransactionState::errorMessage() const {