summaryrefslogtreecommitdiffstats
path: root/tdeioslaves/sieve/sieve.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdeioslaves/sieve/sieve.cpp')
-rw-r--r--tdeioslaves/sieve/sieve.cpp108
1 files changed, 54 insertions, 54 deletions
diff --git a/tdeioslaves/sieve/sieve.cpp b/tdeioslaves/sieve/sieve.cpp
index 9d373c2ad..880bcb237 100644
--- a/tdeioslaves/sieve/sieve.cpp
+++ b/tdeioslaves/sieve/sieve.cpp
@@ -82,12 +82,12 @@ extern "C"
{
KDE_EXPORT int kdemain(int argc, char **argv)
{
- TDEInstance instance("kio_sieve" );
+ TDEInstance instance("tdeio_sieve" );
- ksDebug() << "*** Starting kio_sieve " << endl;
+ ksDebug() << "*** Starting tdeio_sieve " << endl;
if (argc != 4) {
- ksDebug() << "Usage: kio_sieve protocol domain-socket1 domain-socket2" << endl;
+ ksDebug() << "Usage: tdeio_sieve protocol domain-socket1 domain-socket2" << endl;
exit(-1);
}
@@ -101,88 +101,88 @@ extern "C"
sasl_done();
- ksDebug() << "*** kio_sieve Done" << endl;
+ ksDebug() << "*** tdeio_sieve Done" << endl;
return 0;
}
}
/* ---------------------------------------------------------------------------------- */
-kio_sieveResponse::kio_sieveResponse()
+tdeio_sieveResponse::kio_sieveResponse()
{
clear();
}
/* ---------------------------------------------------------------------------------- */
-const uint& kio_sieveResponse::getType() const
+const uint& tdeio_sieveResponse::getType() const
{
return rType;
}
/* ---------------------------------------------------------------------------------- */
-const uint kio_sieveResponse::getQuantity() const
+const uint tdeio_sieveResponse::getQuantity() const
{
return quantity;
}
/* ---------------------------------------------------------------------------------- */
-const TQCString& kio_sieveResponse::getAction() const
+const TQCString& tdeio_sieveResponse::getAction() const
{
return key;
}
/* ---------------------------------------------------------------------------------- */
-const TQCString& kio_sieveResponse::getKey() const
+const TQCString& tdeio_sieveResponse::getKey() const
{
return key;
}
/* ---------------------------------------------------------------------------------- */
-const TQCString& kio_sieveResponse::getVal() const
+const TQCString& tdeio_sieveResponse::getVal() const
{
return val;
}
/* ---------------------------------------------------------------------------------- */
-const TQCString& kio_sieveResponse::getExtra() const
+const TQCString& tdeio_sieveResponse::getExtra() const
{
return extra;
}
/* ---------------------------------------------------------------------------------- */
-void kio_sieveResponse::setQuantity(const uint& newTQty)
+void tdeio_sieveResponse::setQuantity(const uint& newTQty)
{
rType = QUANTITY;
quantity = newTQty;
}
/* ---------------------------------------------------------------------------------- */
-void kio_sieveResponse::setAction(const TQCString& newAction)
+void tdeio_sieveResponse::setAction(const TQCString& newAction)
{
rType = ACTION;
key = newAction.copy();
}
/* ---------------------------------------------------------------------------------- */
-void kio_sieveResponse::setKey(const TQCString& newKey)
+void tdeio_sieveResponse::setKey(const TQCString& newKey)
{
rType = KEY_VAL_PAIR;
key = newKey.copy();
}
/* ---------------------------------------------------------------------------------- */
-void kio_sieveResponse::setVal(const TQCString& newVal)
+void tdeio_sieveResponse::setVal(const TQCString& newVal)
{
val = newVal.copy();
}
/* ---------------------------------------------------------------------------------- */
-void kio_sieveResponse::setExtra(const TQCString& newExtra)
+void tdeio_sieveResponse::setExtra(const TQCString& newExtra)
{
extra = newExtra.copy();
}
/* ---------------------------------------------------------------------------------- */
-void kio_sieveResponse::clear()
+void tdeio_sieveResponse::clear()
{
rType = NONE;
extra = key = val = TQCString("");
@@ -190,7 +190,7 @@ void kio_sieveResponse::clear()
}
/* ---------------------------------------------------------------------------------- */
-kio_sieveProtocol::kio_sieveProtocol(const TQCString &pool_socket, const TQCString &app_socket)
+tdeio_sieveProtocol::kio_sieveProtocol(const TQCString &pool_socket, const TQCString &app_socket)
: TCPSlaveBase( SIEVE_DEFAULT_PORT, "sieve", pool_socket, app_socket, false)
, m_connMode(NORMAL)
, m_supportsTLS(false)
@@ -200,14 +200,14 @@ kio_sieveProtocol::kio_sieveProtocol(const TQCString &pool_socket, const TQCStri
}
/* ---------------------------------------------------------------------------------- */
-kio_sieveProtocol::~kio_sieveProtocol()
+tdeio_sieveProtocol::~kio_sieveProtocol()
{
if ( isConnectionValid() )
disconnect();
}
/* ---------------------------------------------------------------------------------- */
-void kio_sieveProtocol::setHost (const TQString &host, int port, const TQString &user, const TQString &pass)
+void tdeio_sieveProtocol::setHost (const TQString &host, int port, const TQString &user, const TQString &pass)
{
if ( isConnectionValid() &&
( m_sServer != host ||
@@ -224,13 +224,13 @@ void kio_sieveProtocol::setHost (const TQString &host, int port, const TQString
}
/* ---------------------------------------------------------------------------------- */
-void kio_sieveProtocol::openConnection()
+void tdeio_sieveProtocol::openConnection()
{
m_connMode = CONNECTION_ORIENTED;
connect();
}
-bool kio_sieveProtocol::parseCapabilities(bool requestCapabilities/* = false*/)
+bool tdeio_sieveProtocol::parseCapabilities(bool requestCapabilities/* = false*/)
{
ksDebug() << k_funcinfo << endl;
@@ -244,7 +244,7 @@ bool kio_sieveProtocol::parseCapabilities(bool requestCapabilities/* = false*/)
while (receiveData()) {
ksDebug() << "Looping receive" << endl;
- if (r.getType() == kio_sieveResponse::ACTION) {
+ if (r.getType() == tdeio_sieveResponse::ACTION) {
if ( r.getAction().contains("ok", false) != -1 ) {
ksDebug() << "Sieve server ready & awaiting authentication." << endl;
break;
@@ -294,7 +294,7 @@ bool kio_sieveProtocol::parseCapabilities(bool requestCapabilities/* = false*/)
* Checks if connection parameters have changed.
* If it it, close the current connection
*/
-void kio_sieveProtocol::changeCheck( const KURL &url )
+void tdeio_sieveProtocol::changeCheck( const KURL &url )
{
TQString auth;
@@ -334,7 +334,7 @@ void kio_sieveProtocol::changeCheck( const KURL &url )
* Connects to the server.
* returns false and calls error() if an error occurred.
*/
-bool kio_sieveProtocol::connect(bool useTLSIfAvailable)
+bool tdeio_sieveProtocol::connect(bool useTLSIfAvailable)
{
ksDebug() << k_funcinfo << endl;
@@ -427,14 +427,14 @@ bool kio_sieveProtocol::connect(bool useTLSIfAvailable)
}
/* ---------------------------------------------------------------------------------- */
-void kio_sieveProtocol::closeConnection()
+void tdeio_sieveProtocol::closeConnection()
{
m_connMode = CONNECTION_ORIENTED;
disconnect();
}
/* ---------------------------------------------------------------------------------- */
-void kio_sieveProtocol::disconnect(bool forcibly)
+void tdeio_sieveProtocol::disconnect(bool forcibly)
{
if (!forcibly) {
sendData("LOGOUT");
@@ -451,7 +451,7 @@ void kio_sieveProtocol::disconnect(bool forcibly)
}
/* ---------------------------------------------------------------------------------- */
-/*void kio_sieveProtocol::slave_status()
+/*void tdeio_sieveProtocol::slave_status()
{
slaveStatus(isConnectionValid() ? m_sServer : "", isConnectionValid());
@@ -459,7 +459,7 @@ void kio_sieveProtocol::disconnect(bool forcibly)
}*/
/* ---------------------------------------------------------------------------------- */
-void kio_sieveProtocol::special(const TQByteArray &data)
+void tdeio_sieveProtocol::special(const TQByteArray &data)
{
int tmp;
TQDataStream stream(data, IO_ReadOnly);
@@ -488,7 +488,7 @@ void kio_sieveProtocol::special(const TQByteArray &data)
}
/* ---------------------------------------------------------------------------------- */
-bool kio_sieveProtocol::activate(const KURL& url)
+bool tdeio_sieveProtocol::activate(const KURL& url)
{
changeCheck( url );
if (!connect())
@@ -516,7 +516,7 @@ bool kio_sieveProtocol::activate(const KURL& url)
}
/* ---------------------------------------------------------------------------------- */
-bool kio_sieveProtocol::deactivate()
+bool tdeio_sieveProtocol::deactivate()
{
if (!connect())
return false;
@@ -550,7 +550,7 @@ static void append_lf2crlf( TQByteArray & out, const TQByteArray & in ) {
out.resize( d - out.begin() );
}
-void kio_sieveProtocol::put(const KURL& url, int /*permissions*/, bool /*overwrite*/, bool /*resume*/)
+void tdeio_sieveProtocol::put(const KURL& url, int /*permissions*/, bool /*overwrite*/, bool /*resume*/)
{
changeCheck( url );
if (!connect())
@@ -661,7 +661,7 @@ void kio_sieveProtocol::put(const KURL& url, int /*permissions*/, bool /*overwri
// send the extra message off for re-processing
receiveData(false, &extra);
- if (r.getType() == kio_sieveResponse::QUANTITY) {
+ if (r.getType() == tdeio_sieveResponse::QUANTITY) {
// length of the error message
uint len = r.getQuantity();
@@ -676,7 +676,7 @@ void kio_sieveProtocol::put(const KURL& url, int /*permissions*/, bool /*overwri
// clear the rest of the incoming data
receiveData();
- } else if (r.getType() == kio_sieveResponse::KEY_VAL_PAIR) {
+ } else if (r.getType() == tdeio_sieveResponse::KEY_VAL_PAIR) {
error(ERR_INTERNAL_SERVER,
i18n("The script did not upload successfully.\n"
"This is probably due to errors in the script.\n"
@@ -716,7 +716,7 @@ static void inplace_crlf2lf( TQByteArray & in ) {
}
/* ---------------------------------------------------------------------------------- */
-void kio_sieveProtocol::get(const KURL& url)
+void tdeio_sieveProtocol::get(const KURL& url)
{
changeCheck( url );
if (!connect())
@@ -736,7 +736,7 @@ void kio_sieveProtocol::get(const KURL& url)
if (!sendData("GETSCRIPT \"" + filename.utf8() + "\""))
return;
- if (receiveData() && r.getType() == kio_sieveResponse::QUANTITY) {
+ if (receiveData() && r.getType() == tdeio_sieveResponse::QUANTITY) {
// determine script size
ssize_t total_len = r.getQuantity();
totalSize( total_len );
@@ -788,7 +788,7 @@ void kio_sieveProtocol::get(const KURL& url)
finished();
}
-void kio_sieveProtocol::del(const KURL &url, bool isfile)
+void tdeio_sieveProtocol::del(const KURL &url, bool isfile)
{
if (!isfile) {
error(ERR_INTERNAL, i18n("Folders are not supported."));
@@ -823,7 +823,7 @@ void kio_sieveProtocol::del(const KURL &url, bool isfile)
finished();
}
-void kio_sieveProtocol::chmod(const KURL& url, int permissions)
+void tdeio_sieveProtocol::chmod(const KURL& url, int permissions)
{
switch ( permissions ) {
case 0700: // activate
@@ -844,7 +844,7 @@ void kio_sieveProtocol::chmod(const KURL& url, int permissions)
#undef stat
#endif
-void kio_sieveProtocol::stat(const KURL& url)
+void tdeio_sieveProtocol::stat(const KURL& url)
{
changeCheck( url );
if (!connect())
@@ -875,7 +875,7 @@ void kio_sieveProtocol::stat(const KURL& url)
return;
while(receiveData()) {
- if (r.getType() == kio_sieveResponse::ACTION) {
+ if (r.getType() == tdeio_sieveResponse::ACTION) {
if (r.getAction().contains("OK", false) == 1)
// Script list completed
break;
@@ -916,7 +916,7 @@ void kio_sieveProtocol::stat(const KURL& url)
finished();
}
-void kio_sieveProtocol::listDir(const KURL& url)
+void tdeio_sieveProtocol::listDir(const KURL& url)
{
changeCheck( url );
if (!connect())
@@ -928,7 +928,7 @@ void kio_sieveProtocol::listDir(const KURL& url)
UDSEntry entry;
while(receiveData()) {
- if (r.getType() == kio_sieveResponse::ACTION) {
+ if (r.getType() == tdeio_sieveResponse::ACTION) {
if (r.getAction().contains("OK", false) == 1)
// Script list completed.
break;
@@ -969,7 +969,7 @@ void kio_sieveProtocol::listDir(const KURL& url)
}
/* ---------------------------------------------------------------------------------- */
-bool kio_sieveProtocol::saslInteract( void *in, AuthInfo &ai )
+bool tdeio_sieveProtocol::saslInteract( void *in, AuthInfo &ai )
{
ksDebug() << "sasl_interact" << endl;
sasl_interact_t *interact = ( sasl_interact_t * ) in;
@@ -1019,7 +1019,7 @@ bool kio_sieveProtocol::saslInteract( void *in, AuthInfo &ai )
#define SASLERROR error(ERR_COULD_NOT_AUTHENTICATE, i18n("An error occurred during authentication: %1").arg( \
TQString::fromUtf8( sasl_errdetail( conn ) )));
-bool kio_sieveProtocol::authenticate()
+bool tdeio_sieveProtocol::authenticate()
{
int result;
sasl_conn_t *conn = NULL;
@@ -1105,7 +1105,7 @@ bool kio_sieveProtocol::authenticate()
ksDebug() << "Challenge len " << r.getQuantity() << endl;
- if (r.getType() != kio_sieveResponse::QUANTITY) {
+ if (r.getType() != tdeio_sieveResponse::QUANTITY) {
sasl_dispose( &conn );
error(ERR_SLAVE_DEFINED,
i18n("A protocol error occurred during authentication.\n"
@@ -1117,7 +1117,7 @@ bool kio_sieveProtocol::authenticate()
receiveData();
- if (r.getType() != kio_sieveResponse::ACTION && r.getAction().length() != qty) {
+ if (r.getType() != tdeio_sieveResponse::ACTION && r.getAction().length() != qty) {
sasl_dispose( &conn );
error(ERR_UNSUPPORTED_PROTOCOL,
i18n("A protocol error occurred during authentication.\n"
@@ -1174,7 +1174,7 @@ bool kio_sieveProtocol::authenticate()
}
/* --------------------------------------------------------------------------- */
-void kio_sieveProtocol::mimetype(const KURL & url)
+void tdeio_sieveProtocol::mimetype(const KURL & url)
{
ksDebug() << "Requesting mimetype for " << url.prettyURL() << endl;
@@ -1188,7 +1188,7 @@ void kio_sieveProtocol::mimetype(const KURL & url)
/* --------------------------------------------------------------------------- */
-bool kio_sieveProtocol::sendData(const TQCString &data)
+bool tdeio_sieveProtocol::sendData(const TQCString &data)
{
TQCString write_buf = data + "\r\n";
@@ -1206,7 +1206,7 @@ bool kio_sieveProtocol::sendData(const TQCString &data)
}
/* --------------------------------------------------------------------------- */
-bool kio_sieveProtocol::receiveData(bool waitForData, TQCString *reparse)
+bool tdeio_sieveProtocol::receiveData(bool waitForData, TQCString *reparse)
{
TQCString interpret;
int start, end;
@@ -1292,10 +1292,10 @@ bool kio_sieveProtocol::receiveData(bool waitForData, TQCString *reparse)
return true;
}
-bool kio_sieveProtocol::operationSuccessful()
+bool tdeio_sieveProtocol::operationSuccessful()
{
while (receiveData(false)) {
- if (r.getType() == kio_sieveResponse::ACTION) {
+ if (r.getType() == tdeio_sieveResponse::ACTION) {
TQCString response = r.getAction().left(2);
if (response == "OK") {
return true;
@@ -1307,9 +1307,9 @@ bool kio_sieveProtocol::operationSuccessful()
return false;
}
-int kio_sieveProtocol::operationResult()
+int tdeio_sieveProtocol::operationResult()
{
- if (r.getType() == kio_sieveResponse::ACTION) {
+ if (r.getType() == tdeio_sieveResponse::ACTION) {
TQCString response = r.getAction().left(2);
if (response == "OK") {
return OK;
@@ -1323,7 +1323,7 @@ int kio_sieveProtocol::operationResult()
return OTHER;
}
-bool kio_sieveProtocol::requestCapabilitiesAfterStartTLS() const
+bool tdeio_sieveProtocol::requestCapabilitiesAfterStartTLS() const
{
// Cyrus didn't send CAPABILITIES after STARTTLS until 2.3.11, which is
// not standard conform, but we need to support that anyway.