Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KMailTransport
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PIM
KMailTransport
Commits
bf0d09cd
Commit
bf0d09cd
authored
Apr 06, 2017
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/Applications/17.04'
parents
1666c706
4918895a
Changes
91
Show whitespace changes
Inline
Side-by-side
Showing
91 changed files
with
589 additions
and
691 deletions
+589
-691
kioslave/src/common.h
kioslave/src/common.h
+2
-2
kioslave/src/smtp/capabilities.cpp
kioslave/src/smtp/capabilities.cpp
+4
-7
kioslave/src/smtp/capabilities.h
kioslave/src/smtp/capabilities.h
+3
-4
kioslave/src/smtp/command.cpp
kioslave/src/smtp/command.cpp
+16
-21
kioslave/src/smtp/command.h
kioslave/src/smtp/command.h
+5
-8
kioslave/src/smtp/kioslavesession.h
kioslave/src/smtp/kioslavesession.h
+1
-4
kioslave/src/smtp/request.cpp
kioslave/src/smtp/request.cpp
+1
-4
kioslave/src/smtp/request.h
kioslave/src/smtp/request.h
+16
-4
kioslave/src/smtp/response.cpp
kioslave/src/smtp/response.cpp
+1
-5
kioslave/src/smtp/response.h
kioslave/src/smtp/response.h
+14
-9
kioslave/src/smtp/smtp.cpp
kioslave/src/smtp/smtp.cpp
+23
-31
kioslave/src/smtp/smtp.h
kioslave/src/smtp/smtp.h
+5
-6
kioslave/src/smtp/smtpsessioninterface.h
kioslave/src/smtp/smtpsessioninterface.h
+3
-7
kioslave/src/smtp/tests/fakesession.h
kioslave/src/smtp/tests/fakesession.h
+21
-10
kioslave/src/smtp/tests/interactivesmtpserver.cpp
kioslave/src/smtp/tests/interactivesmtpserver.cpp
+11
-8
kioslave/src/smtp/tests/interactivesmtpserver.h
kioslave/src/smtp/tests/interactivesmtpserver.h
+3
-1
kioslave/src/smtp/tests/requesttest.cpp
kioslave/src/smtp/tests/requesttest.cpp
+0
-2
kioslave/src/smtp/tests/test_commands.cpp
kioslave/src/smtp/tests/test_commands.cpp
+5
-6
kioslave/src/smtp/tests/test_headergeneration.cpp
kioslave/src/smtp/tests/test_headergeneration.cpp
+49
-50
kioslave/src/smtp/tests/test_responseparser.cpp
kioslave/src/smtp/tests/test_responseparser.cpp
+2
-2
kioslave/src/smtp/transactionstate.cpp
kioslave/src/smtp/transactionstate.cpp
+4
-7
kioslave/src/smtp/transactionstate.h
kioslave/src/smtp/transactionstate.h
+24
-17
src/helper_p.h
src/helper_p.h
+46
-33
src/kcm/configmodule.cpp
src/kcm/configmodule.cpp
+5
-3
src/kcm/configmodule.h
src/kcm/configmodule.h
+2
-6
src/kmailtransport/precommandjob.cpp
src/kmailtransport/precommandjob.cpp
+5
-3
src/kmailtransport/precommandjob.h
src/kmailtransport/precommandjob.h
+1
-4
src/kmailtransport/servertest.cpp
src/kmailtransport/servertest.cpp
+54
-60
src/kmailtransport/servertest.h
src/kmailtransport/servertest.h
+1
-4
src/kmailtransport/smtpjob.cpp
src/kmailtransport/smtpjob.cpp
+24
-19
src/kmailtransport/smtpjob.h
src/kmailtransport/smtpjob.h
+2
-7
src/kmailtransport/socket.cpp
src/kmailtransport/socket.cpp
+18
-20
src/kmailtransport/socket.h
src/kmailtransport/socket.h
+2
-6
src/kmailtransport/tests/servertest.cpp
src/kmailtransport/tests/servertest.cpp
+2
-2
src/kmailtransport/tests/transportmgr.cpp
src/kmailtransport/tests/transportmgr.cpp
+9
-10
src/kmailtransport/transport.cpp
src/kmailtransport/transport.cpp
+23
-24
src/kmailtransport/transport.h
src/kmailtransport/transport.h
+1
-4
src/kmailtransport/transportjob.cpp
src/kmailtransport/transportjob.cpp
+4
-4
src/kmailtransport/transportjob.h
src/kmailtransport/transportjob.h
+1
-4
src/kmailtransport/transportmanager.cpp
src/kmailtransport/transportmanager.cpp
+32
-34
src/kmailtransport/transportmanager.h
src/kmailtransport/transportmanager.h
+2
-6
src/kmailtransport/transporttype.cpp
src/kmailtransport/transporttype.cpp
+1
-2
src/kmailtransport/transporttype.h
src/kmailtransport/transporttype.h
+1
-6
src/kmailtransport/transporttype_p.h
src/kmailtransport/transporttype_p.h
+1
-4
src/kmailtransport/widgets/addtransportdialog.cpp
src/kmailtransport/widgets/addtransportdialog.cpp
+8
-5
src/kmailtransport/widgets/addtransportdialog.h
src/kmailtransport/widgets/addtransportdialog.h
+1
-4
src/kmailtransport/widgets/smtpconfigwidget.cpp
src/kmailtransport/widgets/smtpconfigwidget.cpp
+10
-8
src/kmailtransport/widgets/smtpconfigwidget.h
src/kmailtransport/widgets/smtpconfigwidget.h
+1
-5
src/kmailtransport/widgets/transportcombobox.cpp
src/kmailtransport/widgets/transportcombobox.cpp
+2
-1
src/kmailtransport/widgets/transportcombobox.h
src/kmailtransport/widgets/transportcombobox.h
+1
-4
src/kmailtransport/widgets/transportconfigdialog.cpp
src/kmailtransport/widgets/transportconfigdialog.cpp
+9
-8
src/kmailtransport/widgets/transportconfigdialog.h
src/kmailtransport/widgets/transportconfigdialog.h
+1
-4
src/kmailtransport/widgets/transportconfigwidget.cpp
src/kmailtransport/widgets/transportconfigwidget.cpp
+6
-6
src/kmailtransport/widgets/transportconfigwidget.h
src/kmailtransport/widgets/transportconfigwidget.h
+2
-7
src/kmailtransport/widgets/transportconfigwidget_p.h
src/kmailtransport/widgets/transportconfigwidget_p.h
+1
-5
src/kmailtransport/widgets/transportlistview.h
src/kmailtransport/widgets/transportlistview.h
+1
-5
src/kmailtransport/widgets/transportmanagementwidget.cpp
src/kmailtransport/widgets/transportmanagementwidget.cpp
+12
-11
src/kmailtransport/widgets/transportmanagementwidget.h
src/kmailtransport/widgets/transportmanagementwidget.h
+1
-4
src/kmailtransportakonadi/attributeregistrar.cpp
src/kmailtransportakonadi/attributeregistrar.cpp
+1
-5
src/kmailtransportakonadi/autotests/attributetest.cpp
src/kmailtransportakonadi/autotests/attributetest.cpp
+0
-1
src/kmailtransportakonadi/autotests/attributetest.h
src/kmailtransportakonadi/autotests/attributetest.h
+0
-1
src/kmailtransportakonadi/autotests/filteractiontest.cpp
src/kmailtransportakonadi/autotests/filteractiontest.cpp
+1
-2
src/kmailtransportakonadi/autotests/messagequeuejobtest.cpp
src/kmailtransportakonadi/autotests/messagequeuejobtest.cpp
+4
-5
src/kmailtransportakonadi/autotests/messagequeuejobtest.h
src/kmailtransportakonadi/autotests/messagequeuejobtest.h
+0
-1
src/kmailtransportakonadi/autotests/testattribute.h
src/kmailtransportakonadi/autotests/testattribute.h
+8
-1
src/kmailtransportakonadi/dispatcherinterface.cpp
src/kmailtransportakonadi/dispatcherinterface.cpp
+10
-10
src/kmailtransportakonadi/dispatcherinterface.h
src/kmailtransportakonadi/dispatcherinterface.h
+1
-4
src/kmailtransportakonadi/dispatcherinterface_p.h
src/kmailtransportakonadi/dispatcherinterface_p.h
+1
-5
src/kmailtransportakonadi/dispatchmodeattribute.cpp
src/kmailtransportakonadi/dispatchmodeattribute.cpp
+3
-4
src/kmailtransportakonadi/dispatchmodeattribute.h
src/kmailtransportakonadi/dispatchmodeattribute.h
+1
-5
src/kmailtransportakonadi/errorattribute.cpp
src/kmailtransportakonadi/errorattribute.cpp
+0
-1
src/kmailtransportakonadi/errorattribute.h
src/kmailtransportakonadi/errorattribute.h
+1
-4
src/kmailtransportakonadi/filteractionjob.cpp
src/kmailtransportakonadi/filteractionjob.cpp
+10
-7
src/kmailtransportakonadi/filteractionjob_p.h
src/kmailtransportakonadi/filteractionjob_p.h
+2
-6
src/kmailtransportakonadi/messagequeuejob.cpp
src/kmailtransportakonadi/messagequeuejob.cpp
+11
-11
src/kmailtransportakonadi/messagequeuejob.h
src/kmailtransportakonadi/messagequeuejob.h
+2
-6
src/kmailtransportakonadi/outboxactions.cpp
src/kmailtransportakonadi/outboxactions.cpp
+2
-1
src/kmailtransportakonadi/outboxactions_p.h
src/kmailtransportakonadi/outboxactions_p.h
+4
-10
src/kmailtransportakonadi/sentactionattribute.cpp
src/kmailtransportakonadi/sentactionattribute.cpp
+1
-1
src/kmailtransportakonadi/sentactionattribute.h
src/kmailtransportakonadi/sentactionattribute.h
+1
-4
src/kmailtransportakonadi/sentbehaviourattribute.cpp
src/kmailtransportakonadi/sentbehaviourattribute.cpp
+2
-4
src/kmailtransportakonadi/sentbehaviourattribute.h
src/kmailtransportakonadi/sentbehaviourattribute.h
+2
-8
src/kmailtransportakonadi/tests/abort.cpp
src/kmailtransportakonadi/tests/abort.cpp
+0
-1
src/kmailtransportakonadi/tests/abort.h
src/kmailtransportakonadi/tests/abort.h
+0
-1
src/kmailtransportakonadi/tests/clearerror.cpp
src/kmailtransportakonadi/tests/clearerror.cpp
+0
-1
src/kmailtransportakonadi/tests/queuer.cpp
src/kmailtransportakonadi/tests/queuer.cpp
+13
-14
src/kmailtransportakonadi/tests/queuer.h
src/kmailtransportakonadi/tests/queuer.h
+1
-2
src/kmailtransportakonadi/tests/sendqueued.cpp
src/kmailtransportakonadi/tests/sendqueued.cpp
+0
-1
src/kmailtransportakonadi/tests/sendqueued.h
src/kmailtransportakonadi/tests/sendqueued.h
+0
-1
src/kmailtransportakonadi/transportattribute.cpp
src/kmailtransportakonadi/transportattribute.cpp
+0
-1
src/kmailtransportakonadi/transportattribute.h
src/kmailtransportakonadi/transportattribute.h
+1
-5
No files found.
kioslave/src/common.h
View file @
bf0d09cd
...
@@ -33,8 +33,8 @@ inline bool initSASL()
...
@@ -33,8 +33,8 @@ inline bool initSASL()
#ifdef Q_OS_WIN32 //krazy:exclude=cpp
#ifdef Q_OS_WIN32 //krazy:exclude=cpp
QByteArray
libInstallPath
(
QFile
::
encodeName
(
QDir
::
toNativeSeparators
(
KGlobal
::
dirs
()
->
installPath
(
"lib"
)
+
QLatin1String
(
"sasl2"
))));
QByteArray
libInstallPath
(
QFile
::
encodeName
(
QDir
::
toNativeSeparators
(
KGlobal
::
dirs
()
->
installPath
(
"lib"
)
+
QLatin1String
(
"sasl2"
))));
QByteArray
configPath
(
QFile
::
encodeName
(
QDir
::
toNativeSeparators
(
KGlobal
::
dirs
()
->
installPath
(
"config"
)
+
QLatin1String
(
"sasl2"
))));
QByteArray
configPath
(
QFile
::
encodeName
(
QDir
::
toNativeSeparators
(
KGlobal
::
dirs
()
->
installPath
(
"config"
)
+
QLatin1String
(
"sasl2"
))));
if
(
sasl_set_path
(
SASL_PATH_TYPE_PLUGIN
,
libInstallPath
.
data
())
!=
SASL_OK
||
if
(
sasl_set_path
(
SASL_PATH_TYPE_PLUGIN
,
libInstallPath
.
data
())
!=
SASL_OK
sasl_set_path
(
SASL_PATH_TYPE_CONFIG
,
configPath
.
data
())
!=
SASL_OK
)
{
||
sasl_set_path
(
SASL_PATH_TYPE_CONFIG
,
configPath
.
data
())
!=
SASL_OK
)
{
fprintf
(
stderr
,
"SASL path initialization failed!
\n
"
);
fprintf
(
stderr
,
"SASL path initialization failed!
\n
"
);
return
false
;
return
false
;
}
}
...
...
kioslave/src/smtp/capabilities.cpp
View file @
bf0d09cd
...
@@ -32,9 +32,7 @@
...
@@ -32,9 +32,7 @@
#include "capabilities.h"
#include "capabilities.h"
#include "response.h"
#include "response.h"
namespace
KioSMTP
namespace
KioSMTP
{
{
Capabilities
Capabilities
::
fromResponse
(
const
Response
&
ehlo
)
Capabilities
Capabilities
::
fromResponse
(
const
Response
&
ehlo
)
{
{
Capabilities
c
;
Capabilities
c
;
...
@@ -120,5 +118,4 @@ QStringList Capabilities::saslMethodsQSL() const
...
@@ -120,5 +118,4 @@ QStringList Capabilities::saslMethodsQSL() const
result
.
removeDuplicates
();
result
.
removeDuplicates
();
return
result
;
return
result
;
}
}
}
// namespace KioSMTP
}
// namespace KioSMTP
kioslave/src/smtp/capabilities.h
View file @
bf0d09cd
...
@@ -36,9 +36,7 @@
...
@@ -36,9 +36,7 @@
#include <QStringList>
#include <QStringList>
namespace
KioSMTP
namespace
KioSMTP
{
{
class
Response
;
class
Response
;
class
Capabilities
class
Capabilities
...
@@ -61,10 +59,12 @@ public:
...
@@ -61,10 +59,12 @@ public:
{
{
return
mCapabilities
.
find
(
cap
.
toUpper
())
!=
mCapabilities
.
end
();
return
mCapabilities
.
find
(
cap
.
toUpper
())
!=
mCapabilities
.
end
();
}
}
bool
have
(
const
QByteArray
&
cap
)
const
bool
have
(
const
QByteArray
&
cap
)
const
{
{
return
have
(
QString
::
fromLatin1
(
cap
));
return
have
(
QString
::
fromLatin1
(
cap
));
}
}
bool
have
(
const
char
*
cap
)
const
bool
have
(
const
char
*
cap
)
const
{
{
return
have
(
QString
::
fromLatin1
(
cap
));
return
have
(
QString
::
fromLatin1
(
cap
));
...
@@ -81,7 +81,6 @@ private:
...
@@ -81,7 +81,6 @@ private:
QMap
<
QString
,
QStringList
>
mCapabilities
;
QMap
<
QString
,
QStringList
>
mCapabilities
;
};
};
}
// namespace KioSMTP
}
// namespace KioSMTP
#endif // __KIOSMTP_CAPABILITIES_H__
#endif // __KIOSMTP_CAPABILITIES_H__
kioslave/src/smtp/command.cpp
View file @
bf0d09cd
...
@@ -43,9 +43,7 @@
...
@@ -43,9 +43,7 @@
#include <assert.h>
#include <assert.h>
namespace
KioSMTP
namespace
KioSMTP
{
{
static
const
sasl_callback_t
callbacks
[]
=
{
static
const
sasl_callback_t
callbacks
[]
=
{
{
SASL_CB_ECHOPROMPT
,
nullptr
,
nullptr
},
{
SASL_CB_ECHOPROMPT
,
nullptr
,
nullptr
},
{
SASL_CB_NOECHOPROMPT
,
nullptr
,
nullptr
},
{
SASL_CB_NOECHOPROMPT
,
nullptr
,
nullptr
},
...
@@ -207,15 +205,12 @@ bool StartTLSCommand::processResponse(const Response &r, TransactionState *ts)
...
@@ -207,15 +205,12 @@ bool StartTLSCommand::processResponse(const Response &r, TransactionState *ts)
#define SASLERROR mSMTP->error(KIO::ERR_COULD_NOT_AUTHENTICATE, \
#define SASLERROR mSMTP->error(KIO::ERR_COULD_NOT_AUTHENTICATE, \
i18n("An error occurred during authentication: %1", \
i18n("An error occurred during authentication: %1", \
QString::fromUtf8(
sasl_errdetail( conn )
)));
QString::fromUtf8(
sasl_errdetail(conn)
)));
//
//
// AUTH - rfc 2554
// AUTH - rfc 2554
//
//
AuthCommand
::
AuthCommand
(
SMTPSessionInterface
*
smtp
,
AuthCommand
::
AuthCommand
(
SMTPSessionInterface
*
smtp
,
const
char
*
mechanisms
,
const
QString
&
aFQDN
,
KIO
::
AuthInfo
&
ai
)
const
char
*
mechanisms
,
const
QString
&
aFQDN
,
KIO
::
AuthInfo
&
ai
)
:
Command
(
smtp
,
CloseConnectionOnError
|
OnlyLastInPipeline
)
:
Command
(
smtp
,
CloseConnectionOnError
|
OnlyLastInPipeline
)
,
mAi
(
&
ai
)
,
mAi
(
&
ai
)
,
mFirstTime
(
true
)
,
mFirstTime
(
true
)
...
@@ -242,7 +237,7 @@ AuthCommand::AuthCommand(SMTPSessionInterface *smtp,
...
@@ -242,7 +237,7 @@ AuthCommand::AuthCommand(SMTPSessionInterface *smtp,
if
(
result
==
SASL_INTERACT
)
{
if
(
result
==
SASL_INTERACT
)
{
if
(
!
saslInteract
(
client_interact
))
{
if
(
!
saslInteract
(
client_interact
))
{
return
;
return
;
}
;
}
}
}
}
while
(
result
==
SASL_INTERACT
);
}
while
(
result
==
SASL_INTERACT
);
if
(
result
!=
SASL_CONTINUE
&&
result
!=
SASL_OK
)
{
if
(
result
!=
SASL_CONTINUE
&&
result
!=
SASL_OK
)
{
...
@@ -267,14 +262,13 @@ AuthCommand::~AuthCommand()
...
@@ -267,14 +262,13 @@ AuthCommand::~AuthCommand()
bool
AuthCommand
::
saslInteract
(
void
*
in
)
bool
AuthCommand
::
saslInteract
(
void
*
in
)
{
{
qCDebug
(
SMTP_LOG
)
<<
"saslInteract: "
;
qCDebug
(
SMTP_LOG
)
<<
"saslInteract: "
;
sasl_interact_t
*
interact
=
(
sasl_interact_t
*
)
in
;
sasl_interact_t
*
interact
=
(
sasl_interact_t
*
)
in
;
//some mechanisms do not require username && pass, so don't need a popup
//some mechanisms do not require username && pass, so don't need a popup
//window for getting this info
//window for getting this info
for
(;
interact
->
id
!=
SASL_CB_LIST_END
;
interact
++
)
{
for
(;
interact
->
id
!=
SASL_CB_LIST_END
;
interact
++
)
{
if
(
interact
->
id
==
SASL_CB_AUTHNAME
||
if
(
interact
->
id
==
SASL_CB_AUTHNAME
interact
->
id
==
SASL_CB_PASS
)
{
||
interact
->
id
==
SASL_CB_PASS
)
{
if
(
mAi
->
username
.
isEmpty
()
||
mAi
->
password
.
isEmpty
())
{
if
(
mAi
->
username
.
isEmpty
()
||
mAi
->
password
.
isEmpty
())
{
if
(
!
mSMTP
->
openPasswordDialog
(
*
mAi
))
{
if
(
!
mSMTP
->
openPasswordDialog
(
*
mAi
))
{
mSMTP
->
error
(
KIO
::
ERR_ABORTED
,
i18n
(
"No authentication details supplied."
));
mSMTP
->
error
(
KIO
::
ERR_ABORTED
,
i18n
(
"No authentication details supplied."
));
...
@@ -285,22 +279,24 @@ bool AuthCommand::saslInteract(void *in)
...
@@ -285,22 +279,24 @@ bool AuthCommand::saslInteract(void *in)
}
}
}
}
interact
=
(
sasl_interact_t
*
)
in
;
interact
=
(
sasl_interact_t
*
)
in
;
while
(
interact
->
id
!=
SASL_CB_LIST_END
)
{
while
(
interact
->
id
!=
SASL_CB_LIST_END
)
{
switch
(
interact
->
id
)
{
switch
(
interact
->
id
)
{
case
SASL_CB_USER
:
case
SASL_CB_USER
:
case
SASL_CB_AUTHNAME
:
{
case
SASL_CB_AUTHNAME
:
{
qCDebug
(
SMTP_LOG
)
<<
"SASL_CB_[USER|AUTHNAME]: "
<<
mAi
->
username
;
qCDebug
(
SMTP_LOG
)
<<
"SASL_CB_[USER|AUTHNAME]: "
<<
mAi
->
username
;
const
QByteArray
baUserName
=
mAi
->
username
.
toUtf8
();
const
QByteArray
baUserName
=
mAi
->
username
.
toUtf8
();
interact
->
result
=
strdup
(
baUserName
.
constData
());
interact
->
result
=
strdup
(
baUserName
.
constData
());
interact
->
len
=
strlen
((
const
char
*
)
interact
->
result
);
interact
->
len
=
strlen
((
const
char
*
)
interact
->
result
);
break
;
break
;
}
}
case
SASL_CB_PASS
:
{
case
SASL_CB_PASS
:
{
qCDebug
(
SMTP_LOG
)
<<
"SASL_CB_PASS: [HIDDEN]"
;
qCDebug
(
SMTP_LOG
)
<<
"SASL_CB_PASS: [HIDDEN]"
;
const
QByteArray
baPassword
=
mAi
->
password
.
toUtf8
();
const
QByteArray
baPassword
=
mAi
->
password
.
toUtf8
();
interact
->
result
=
strdup
(
baPassword
.
constData
());
interact
->
result
=
strdup
(
baPassword
.
constData
());
interact
->
len
=
strlen
((
const
char
*
)
interact
->
result
);
interact
->
len
=
strlen
((
const
char
*
)
interact
->
result
);
break
;
break
;
}
}
default:
default:
...
@@ -362,7 +358,7 @@ QByteArray AuthCommand::nextCommandLine(TransactionState *ts)
...
@@ -362,7 +358,7 @@ QByteArray AuthCommand::nextCommandLine(TransactionState *ts)
if
(
result
==
SASL_INTERACT
)
{
if
(
result
==
SASL_INTERACT
)
{
if
(
!
saslInteract
(
client_interact
))
{
if
(
!
saslInteract
(
client_interact
))
{
return
""
;
return
""
;
}
;
}
}
}
}
while
(
result
==
SASL_INTERACT
);
}
while
(
result
==
SASL_INTERACT
);
if
(
result
!=
SASL_CONTINUE
&&
result
!=
SASL_OK
)
{
if
(
result
!=
SASL_CONTINUE
&&
result
!=
SASL_OK
)
{
...
@@ -649,5 +645,4 @@ QByteArray QuitCommand::nextCommandLine(TransactionState *ts)
...
@@ -649,5 +645,4 @@ QByteArray QuitCommand::nextCommandLine(TransactionState *ts)
mNeedResponse
=
true
;
mNeedResponse
=
true
;
return
"QUIT
\r\n
"
;
return
"QUIT
\r\n
"
;
}
}
}
// namespace KioSMTP
}
// namespace KioSMTP
kioslave/src/smtp/command.h
View file @
bf0d09cd
...
@@ -41,9 +41,7 @@ extern "C" {
...
@@ -41,9 +41,7 @@ extern "C" {
#include <kio/authinfo.h>
#include <kio/authinfo.h>
namespace
KioSMTP
namespace
KioSMTP
{
{
class
Response
;
class
Response
;
class
TransactionState
;
class
TransactionState
;
class
SMTPSessionInterface
;
class
SMTPSessionInterface
;
...
@@ -145,10 +143,12 @@ public:
...
@@ -145,10 +143,12 @@ public:
{
{
return
mFlags
&
CloseConnectionOnError
;
return
mFlags
&
CloseConnectionOnError
;
}
}
bool
mustBeLastInPipeline
()
const
bool
mustBeLastInPipeline
()
const
{
{
return
mFlags
&
OnlyLastInPipeline
;
return
mFlags
&
OnlyLastInPipeline
;
}
}
bool
mustBeFirstInPipeline
()
const
bool
mustBeFirstInPipeline
()
const
{
{
return
mFlags
&
OnlyFirstInPipeline
;
return
mFlags
&
OnlyFirstInPipeline
;
...
@@ -200,8 +200,7 @@ public:
...
@@ -200,8 +200,7 @@ public:
class
AuthCommand
:
public
Command
class
AuthCommand
:
public
Command
{
{
public:
public:
AuthCommand
(
SMTPSessionInterface
*
smtp
,
const
char
*
mechanisms
,
AuthCommand
(
SMTPSessionInterface
*
smtp
,
const
char
*
mechanisms
,
const
QString
&
aFQDN
,
KIO
::
AuthInfo
&
ai
);
const
QString
&
aFQDN
,
KIO
::
AuthInfo
&
ai
);
~
AuthCommand
();
~
AuthCommand
();
bool
doNotExecute
(
const
TransactionState
*
ts
)
const
Q_DECL_OVERRIDE
;
bool
doNotExecute
(
const
TransactionState
*
ts
)
const
Q_DECL_OVERRIDE
;
QByteArray
nextCommandLine
(
TransactionState
*
ts
)
Q_DECL_OVERRIDE
;
QByteArray
nextCommandLine
(
TransactionState
*
ts
)
Q_DECL_OVERRIDE
;
...
@@ -226,8 +225,7 @@ private:
...
@@ -226,8 +225,7 @@ private:
class
MailFromCommand
:
public
Command
class
MailFromCommand
:
public
Command
{
{
public:
public:
MailFromCommand
(
SMTPSessionInterface
*
smtp
,
const
QByteArray
&
addr
,
MailFromCommand
(
SMTPSessionInterface
*
smtp
,
const
QByteArray
&
addr
,
bool
eightBit
=
false
,
unsigned
int
size
=
0
)
bool
eightBit
=
false
,
unsigned
int
size
=
0
)
:
Command
(
smtp
)
:
Command
(
smtp
)
,
mAddr
(
addr
)
,
mAddr
(
addr
)
,
m8Bit
(
eightBit
)
,
m8Bit
(
eightBit
)
...
@@ -328,7 +326,6 @@ public:
...
@@ -328,7 +326,6 @@ public:
QByteArray
nextCommandLine
(
TransactionState
*
ts
)
Q_DECL_OVERRIDE
;
QByteArray
nextCommandLine
(
TransactionState
*
ts
)
Q_DECL_OVERRIDE
;
};
};
}
// namespace KioSMTP
}
// namespace KioSMTP
#endif // __KIOSMTP_COMMAND_H__
#endif // __KIOSMTP_COMMAND_H__
kioslave/src/smtp/kioslavesession.h
View file @
bf0d09cd
...
@@ -23,9 +23,7 @@
...
@@ -23,9 +23,7 @@
#include "smtpsessioninterface.h"
#include "smtpsessioninterface.h"
#include "smtp.h"
#include "smtp.h"
namespace
KioSMTP
namespace
KioSMTP
{
{
class
KioSlaveSession
:
public
SMTPSessionInterface
class
KioSlaveSession
:
public
SMTPSessionInterface
{
{
public:
public:
...
@@ -46,7 +44,6 @@ public:
...
@@ -46,7 +44,6 @@ public:
private:
private:
SMTPProtocol
*
m_protocol
;
SMTPProtocol
*
m_protocol
;
};
};
}
}
#endif
#endif
kioslave/src/smtp/request.cpp
View file @
bf0d09cd
...
@@ -38,9 +38,7 @@
...
@@ -38,9 +38,7 @@
#include <assert.h>
#include <assert.h>
namespace
KioSMTP
namespace
KioSMTP
{
{
Request
Request
::
fromURL
(
const
QUrl
&
url
)
Request
Request
::
fromURL
(
const
QUrl
&
url
)
{
{
Request
request
;
Request
request
;
...
@@ -192,5 +190,4 @@ QByteArray Request::headerFields(const QString &fromRealName) const
...
@@ -192,5 +190,4 @@ QByteArray Request::headerFields(const QString &fromRealName) const
}
}
return
result
;
return
result
;
}
}
}
// namespace KioSMTP
}
// namespace KioSMTP
kioslave/src/smtp/request.h
View file @
bf0d09cd
...
@@ -37,9 +37,7 @@
...
@@ -37,9 +37,7 @@
class
QUrl
;
class
QUrl
;
namespace
KioSMTP
namespace
KioSMTP
{
{
class
Request
class
Request
{
{
public:
public:
...
@@ -57,10 +55,12 @@ public:
...
@@ -57,10 +55,12 @@ public:
{
{
return
mProfileName
;
return
mProfileName
;
}
}
void
setProfileName
(
const
QString
&
profileName
)
void
setProfileName
(
const
QString
&
profileName
)
{
{
mProfileName
=
profileName
;
mProfileName
=
profileName
;
}
}
bool
hasProfile
()
const
bool
hasProfile
()
const
{
{
return
!
profileName
().
isNull
();
return
!
profileName
().
isNull
();
...
@@ -70,6 +70,7 @@ public:
...
@@ -70,6 +70,7 @@ public:
{
{
return
mSubject
;
return
mSubject
;
}
}
void
setSubject
(
const
QString
&
subject
)
void
setSubject
(
const
QString
&
subject
)
{
{
mSubject
=
subject
;
mSubject
=
subject
;
...
@@ -79,10 +80,12 @@ public:
...
@@ -79,10 +80,12 @@ public:
{
{
return
mFromAddress
;
return
mFromAddress
;
}
}
void
setFromAddress
(
const
QString
&
fromAddress
)
void
setFromAddress
(
const
QString
&
fromAddress
)
{
{
mFromAddress
=
fromAddress
;
mFromAddress
=
fromAddress
;
}
}
bool
hasFromAddress
()
const
bool
hasFromAddress
()
const
{
{
return
!
mFromAddress
.
isEmpty
();
return
!
mFromAddress
.
isEmpty
();
...
@@ -92,6 +95,7 @@ public:
...
@@ -92,6 +95,7 @@ public:
{
{
return
to
()
+
cc
()
+
bcc
();
return
to
()
+
cc
()
+
bcc
();
}
}
bool
hasRecipients
()
const
bool
hasRecipients
()
const
{
{
return
!
to
().
empty
()
||
!
cc
().
empty
()
||
!
bcc
().
empty
();
return
!
to
().
empty
()
||
!
cc
().
empty
()
||
!
bcc
().
empty
();
...
@@ -101,22 +105,27 @@ public:
...
@@ -101,22 +105,27 @@ public:
{
{
return
mTo
;
return
mTo
;
}
}
QStringList
cc
()
const
QStringList
cc
()
const
{
{
return
mCc
;
return
mCc
;
}
}
QStringList
bcc
()
const
QStringList
bcc
()
const
{
{
return
mBcc
;
return
mBcc
;
}
}
void
addTo
(
const
QString
&
to
)
void
addTo
(
const
QString
&
to
)
{
{
mTo
.
push_back
(
to
);
mTo
.
push_back
(
to
);
}
}
void
addCc
(
const
QString
&
cc
)
void
addCc
(
const
QString
&
cc
)
{
{
mCc
.
push_back
(
cc
);
mCc
.
push_back
(
cc
);
}
}
void
addBcc
(
const
QString
&
bcc
)
void
addBcc
(
const
QString
&
bcc
)
{
{
mBcc
.
push_back
(
bcc
);
mBcc
.
push_back
(
bcc
);
...
@@ -126,6 +135,7 @@ public:
...
@@ -126,6 +135,7 @@ public:
{
{
return
mHeloHostname
;
return
mHeloHostname
;
}
}
QByteArray
heloHostnameCString
()
const
;
QByteArray
heloHostnameCString
()
const
;
void
setHeloHostname
(
const
QString
&
hostname
)
void
setHeloHostname
(
const
QString
&
hostname
)
{
{
...
@@ -136,6 +146,7 @@ public:
...
@@ -136,6 +146,7 @@ public:
{
{
return
mEmitHeaders
;
return
mEmitHeaders
;
}
}
void
setEmitHeaders
(
bool
emitHeaders
)
void
setEmitHeaders
(
bool
emitHeaders
)
{
{
mEmitHeaders
=
emitHeaders
;
mEmitHeaders
=
emitHeaders
;
...
@@ -145,6 +156,7 @@ public:
...
@@ -145,6 +156,7 @@ public:
{
{
return
m8Bit
;
return
m8Bit
;
}
}
void
set8BitBody
(
bool
a8Bit
)
void
set8BitBody
(
bool
a8Bit
)
{
{
m8Bit
=
a8Bit
;
m8Bit
=
a8Bit
;
...
@@ -154,6 +166,7 @@ public:
...
@@ -154,6 +166,7 @@ public:
{
{
return
mSize
;
return
mSize
;
}
}
void
setSize
(
unsigned
int
size
)
void
setSize
(
unsigned
int
size
)
{
{
mSize
=
size
;
mSize
=
size
;
...
@@ -174,7 +187,6 @@ private:
...
@@ -174,7 +187,6 @@ private:
bool
m8Bit
;
bool
m8Bit
;
unsigned
int
mSize
;
unsigned
int
mSize
;
};
};
}
// namespace KioSMTP
}
// namespace KioSMTP
#endif // __KIOSMTP_REQUEST_H__
#endif // __KIOSMTP_REQUEST_H__
kioslave/src/smtp/response.cpp
View file @
bf0d09cd
...
@@ -36,12 +36,9 @@
...
@@ -36,12 +36,9 @@
#include <QByteArray>
#include <QByteArray>
namespace
KioSMTP
namespace
KioSMTP
{
{
void
Response
::
parseLine
(
const
char
*
line
,
int
len
)
void
Response
::
parseLine
(
const
char
*
line
,
int
len
)
{
{
if
(
!
isWellFormed
())
{
if
(
!
isWellFormed
())
{
return
;
// don't bother
return
;
// don't bother
}
}
...
@@ -165,5 +162,4 @@ int Response::errorCode() const
...
@@ -165,5 +162,4 @@ int Response::errorCode() const
}
}
}
}
}
}
}
// namespace KioSMTP
}
// namespace KioSMTP
kioslave/src/smtp/response.h
View file @
bf0d09cd
...
@@ -38,9 +38,7 @@ typedef QList<QByteArray> QCStringList;
...
@@ -38,9 +38,7 @@ typedef QList<QByteArray> QCStringList;
class
QString
;
class
QString
;
namespace
KioSMTP