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
PIM Messagelib
Commits
05cf526e
Commit
05cf526e
authored
Jun 03, 2020
by
Laurent Montel
Browse files
Don't check all the time invalid dmarc server
parent
61ba9df7
Pipeline
#22373
passed with stage
in 34 minutes and 36 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
messageviewer/src/dkim-verify/dkimcheckpolicyjob.cpp
View file @
05cf526e
...
...
@@ -20,8 +20,11 @@
#include
"dkimcheckpolicyjob.h"
#include
"dmarcpolicyjob.h"
#include
"dkim-verify/dkimmanagerrules.h"
#include
"dkim-verify/dkimutil.h"
#include
"settings/messageviewersettings.h"
#include
"messageviewer_dkimcheckerdebug.h"
#include
<KConfigGroup>
using
namespace
MessageViewer
;
DKIMCheckPolicyJob
::
DKIMCheckPolicyJob
(
QObject
*
parent
)
:
QObject
(
parent
)
...
...
@@ -46,6 +49,14 @@ bool DKIMCheckPolicyJob::start()
return
false
;
}
if
(
mPolicy
.
useDMarc
())
{
const
KSharedConfig
::
Ptr
&
config
=
KSharedConfig
::
openConfig
(
MessageViewer
::
DKIMUtil
::
defaultConfigFileName
(),
KConfig
::
NoGlobals
);
KConfigGroup
grp
(
config
,
"NoExistingDmarcServer"
);
const
QStringList
addressList
=
grp
.
readEntry
(
"AddressList"
,
QStringList
());
if
(
addressList
.
contains
(
mEmailAddress
))
{
Q_EMIT
result
(
mCheckResult
);
deleteLater
();
return
true
;
}
DMARCPolicyJob
*
job
=
new
DMARCPolicyJob
(
this
);
job
->
setEmailAddress
(
mEmailAddress
);
connect
(
job
,
&
DMARCPolicyJob
::
result
,
this
,
&
DKIMCheckPolicyJob
::
dmarcPolicyResult
);
...
...
@@ -110,7 +121,13 @@ void DKIMCheckPolicyJob::dmarcPolicyResult(const MessageViewer::DMARCPolicyJob::
mCheckResult
.
sdid
=
value
.
mSource
;
}
}
else
{
//Store invalid emailAddress
const
KSharedConfig
::
Ptr
&
config
=
KSharedConfig
::
openConfig
(
MessageViewer
::
DKIMUtil
::
defaultConfigFileName
(),
KConfig
::
NoGlobals
);
KConfigGroup
grp
(
config
,
"NoExistingDmarcServer"
);
QStringList
addressList
=
grp
.
readEntry
(
"AddressList"
,
QStringList
());
if
(
!
addressList
.
contains
(
emailAddress
))
{
addressList
.
append
(
emailAddress
);
grp
.
writeEntry
(
"AddressList"
,
addressList
);
}
}
Q_EMIT
result
(
mCheckResult
);
deleteLater
();
...
...
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