Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KSmtp
Commits
93cd12c1
Commit
93cd12c1
authored
Apr 13, 2022
by
Laurent Montel
Browse files
Check if server support dsn before to force it
parent
5c769fcf
Pipeline
#163600
passed with stages
in 1 minute and 44 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/sendjob.cpp
View file @
93cd12c1
...
...
@@ -170,7 +170,9 @@ void SendJob::handleResponse(const ServerResponse &r)
void
SendJobPrivate
::
sendNextRecipient
()
{
q
->
sendCommand
(
"RCPT TO:<"
+
m_recipientsCopy
.
takeFirst
().
toUtf8
()
+
'>'
+
(
m_dsn
?
" NOTIFY=success,failure"
:
""
));
const
bool
dnsSupport
=
m_session
->
allowsDns
()
?
m_dsn
:
false
;
// qDebug() << " void SendJobPrivate::sendNextRecipient()" << m_session->allowsDns() << " dnsSupport " << dnsSupport;
q
->
sendCommand
(
"RCPT TO:<"
+
m_recipientsCopy
.
takeFirst
().
toUtf8
()
+
'>'
+
(
dnsSupport
?
" NOTIFY=success,failure"
:
""
));
}
void
SendJobPrivate
::
addRecipients
(
const
QStringList
&
rcpts
)
...
...
src/session.cpp
View file @
93cd12c1
...
...
@@ -149,6 +149,11 @@ bool Session::allowsTls() const
return
d
->
m_allowsTls
;
}
bool
Session
::
allowsDns
()
const
{
return
d
->
m_allowsDns
;
}
QStringList
Session
::
availableAuthModes
()
const
{
return
d
->
m_authModes
;
...
...
@@ -253,6 +258,8 @@ void SessionPrivate::responseReceived(const ServerResponse &r)
m_allowsTls
=
true
;
}
else
if
(
r
.
text
().
startsWith
(
"AUTH "
))
{
// krazy:exclude=strings
setAuthenticationMethods
(
r
.
text
().
remove
(
0
,
QByteArray
(
"AUTH "
).
count
()).
split
(
' '
));
}
else
if
(
r
.
text
()
==
"DSN"
)
{
m_allowsDns
=
true
;
}
if
(
!
r
.
isMultiline
())
{
...
...
src/session.h
View file @
93cd12c1
...
...
@@ -93,6 +93,11 @@ public:
*/
Q_REQUIRED_RESULT
bool
allowsTls
()
const
;
/**
Returns true if the SMTP server has indicated that it allows DSN support, false otherwise.
*/
Q_REQUIRED_RESULT
bool
allowsDns
()
const
;
/**
@todo: return parsed auth modes, instead of strings.
*/
...
...
src/session_p.h
View file @
93cd12c1
...
...
@@ -84,6 +84,7 @@ private:
int
m_size
=
0
;
bool
m_allowsTls
=
false
;
bool
m_starttlsSent
=
false
;
bool
m_allowsDns
=
false
;
QStringList
m_authModes
;
QString
m_customHostname
;
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment