Commit 08423b65 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add new option

parent 2d77f746
cmake_minimum_required(VERSION 3.5)
set(PIM_VERSION "5.13.55")
set(PIM_VERSION "5.13.56")
if (POLICY CMP0053)
cmake_policy(SET CMP0053 NEW)
......
......@@ -168,11 +168,13 @@ void DKIMCheckFullJob::storeResult(const DKIMCheckSignatureJob::CheckSignatureRe
}
}
if (mCheckPolicy.autogenerateRule()) {
if (checkResult.status == DKIMCheckSignatureJob::DKIMStatus::Valid) {
DKIMGenerateRuleJob *job = new DKIMGenerateRuleJob(this);
job->setResult(checkResult);
if (!job->start()) {
qCWarning(MESSAGEVIEWER_DKIMCHECKER_LOG) << "Impossible to start autogenerate rule";
if (mCheckPolicy.autogenerateRuleOnlyIfSenderInSDID()) {
if (checkResult.status == DKIMCheckSignatureJob::DKIMStatus::Valid) {
DKIMGenerateRuleJob *job = new DKIMGenerateRuleJob(this);
job->setResult(checkResult);
if (!job->start()) {
qCWarning(MESSAGEVIEWER_DKIMCHECKER_LOG) << "Impossible to start autogenerate rule";
}
}
}
}
......
......@@ -34,6 +34,7 @@ DKIMCheckPolicy::DKIMCheckPolicy()
mUseAuthenticationResults = MessageViewer::MessageViewerSettings::useAuthenticationResults();
mUseRelaxedParsing = MessageViewer::MessageViewerSettings::useRelaxedParsingAuthenticationResults();
mUseOnlyAuthenticationResults = MessageViewer::MessageViewerSettings::useOnlyAuthenticationResults();
mAutogenerateRuleOnlyIfSenderInSDID = MessageViewer::MessageViewerSettings::autogenerateRuleOnlyIfSenderOnSDID();
}
int DKIMCheckPolicy::rsaSha1Policy() const
......@@ -145,3 +146,13 @@ void DKIMCheckPolicy::setUseOnlyAuthenticationResults(bool useOnlyAuthentication
{
mUseOnlyAuthenticationResults = useOnlyAuthenticationResults;
}
bool DKIMCheckPolicy::autogenerateRuleOnlyIfSenderInSDID() const
{
return mAutogenerateRuleOnlyIfSenderInSDID;
}
void DKIMCheckPolicy::setAutogenerateRuleOnlyIfSenderInSDID(bool autogenerateRuleOnlyIfSenderInSDID)
{
mAutogenerateRuleOnlyIfSenderInSDID = autogenerateRuleOnlyIfSenderInSDID;
}
......@@ -66,6 +66,9 @@ public:
Q_REQUIRED_RESULT bool useOnlyAuthenticationResults() const;
void setUseOnlyAuthenticationResults(bool useOnlyAuthenticationResults);
Q_REQUIRED_RESULT bool autogenerateRuleOnlyIfSenderInSDID() const;
void setAutogenerateRuleOnlyIfSenderInSDID(bool autogenerateRuleOnlyIfSenderInSDID);
private:
int mRsaSha1Policy = -1;
int mSaveKey = -1;
......@@ -78,6 +81,7 @@ private:
bool mUseAuthenticationResults = false;
bool mUseRelaxedParsing = false;
bool mUseOnlyAuthenticationResults = false;
bool mAutogenerateRuleOnlyIfSenderInSDID = false;
};
}
......
......@@ -278,6 +278,10 @@ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/sta
<entry name="AutogenerateRule" type="bool">
<default>false</default>
</entry>
<entry name="AutogenerateRuleOnlyIfSenderOnSDID" type="bool">
<default>false</default>
</entry>
<entry name="UseAuthenticationResults" type="bool">
<default>false</default>
</entry>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment