Messagelib

dkimcheckpolicy.cpp
1/*
2 SPDX-FileCopyrightText: 2019-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "dkimcheckpolicy.h"
8
9using namespace MessageViewer;
10
11DKIMCheckPolicy::DKIMCheckPolicy()
12{
13 // HACK make sure we create an instance of MessageViewerSettings, rather than
14 // have the below static functions call self() of the base class, which will
15 // assert in subsequent use of MessageViewerSettings
16 MessageViewer::MessageViewerSettings::self();
17 mRsaSha1Policy = MessageViewer::MessageViewerSettings::policyRsaSha1();
18 mVerifySignatureWhenOnlyTest = MessageViewer::MessageViewerSettings::verifySignatureWhenOnlyTest();
19 mSaveDkimResult = MessageViewer::MessageViewerSettings::saveDkimResult();
20 mSaveKey = MessageViewer::MessageViewerSettings::saveKey();
21 mAutogenerateRule = MessageViewer::MessageViewerSettings::autogenerateRule();
22 mCheckIfEmailShouldBeSigned = MessageViewer::MessageViewerSettings::checkIfEmailShouldBeSigned();
23 mUseDMarc = MessageViewer::MessageViewerSettings::useDMarc();
24 mUseDefaultRules = MessageViewer::MessageViewerSettings::useDefaultRules();
25 mUseAuthenticationResults = MessageViewer::MessageViewerSettings::useAuthenticationResults();
26 mUseRelaxedParsing = MessageViewer::MessageViewerSettings::useRelaxedParsingAuthenticationResults();
27 mUseOnlyAuthenticationResults = MessageViewer::MessageViewerSettings::useOnlyAuthenticationResults();
28 mAutogenerateRuleOnlyIfSenderInSDID = MessageViewer::MessageViewerSettings::autogenerateRuleOnlyIfSenderOnSDID();
29 mPublicRsaTooSmallPolicy = MessageViewer::MessageViewerSettings::publicRsaTooSmall();
30}
31
32int DKIMCheckPolicy::rsaSha1Policy() const
33{
34 return mRsaSha1Policy;
35}
36
37bool DKIMCheckPolicy::verifySignatureWhenOnlyTest() const
38{
39 return mVerifySignatureWhenOnlyTest;
40}
41
42void DKIMCheckPolicy::setRsaSha1Policy(int rsaSha1Policy)
43{
44 mRsaSha1Policy = rsaSha1Policy;
45}
46
47void DKIMCheckPolicy::setVerifySignatureWhenOnlyTest(bool verifySignatureWhenOnlyTest)
48{
49 mVerifySignatureWhenOnlyTest = verifySignatureWhenOnlyTest;
50}
51
52bool DKIMCheckPolicy::saveDkimResult() const
53{
54 return mSaveDkimResult;
55}
56
57void DKIMCheckPolicy::setSaveDkimResult(bool saveDkimResult)
58{
59 mSaveDkimResult = saveDkimResult;
60}
61
62int DKIMCheckPolicy::saveKey() const
63{
64 return mSaveKey;
65}
66
67void DKIMCheckPolicy::setSaveKey(int saveKey)
68{
69 mSaveKey = saveKey;
70}
71
72bool DKIMCheckPolicy::autogenerateRule() const
73{
74 return mAutogenerateRule;
75}
76
77void DKIMCheckPolicy::setAutogenerateRule(bool autogenerateRule)
78{
79 mAutogenerateRule = autogenerateRule;
80}
81
82bool DKIMCheckPolicy::checkIfEmailShouldBeSigned() const
83{
84 return mCheckIfEmailShouldBeSigned;
85}
86
87void DKIMCheckPolicy::setCheckIfEmailShouldBeSigned(bool checkIfEmailShouldBeSigned)
88{
89 mCheckIfEmailShouldBeSigned = checkIfEmailShouldBeSigned;
90}
91
92bool DKIMCheckPolicy::useDMarc() const
93{
94 return mUseDMarc;
95}
96
97void DKIMCheckPolicy::setUseDMarc(bool useDMarc)
98{
99 mUseDMarc = useDMarc;
100}
101
102bool DKIMCheckPolicy::useDefaultRules() const
103{
104 return mUseDefaultRules;
105}
106
107void DKIMCheckPolicy::setUseDefaultRules(bool useDefaultRules)
108{
109 mUseDefaultRules = useDefaultRules;
110}
111
112bool DKIMCheckPolicy::useAuthenticationResults() const
113{
114 return mUseAuthenticationResults;
115}
116
117void DKIMCheckPolicy::setUseAuthenticationResults(bool useAuthenticationResults)
118{
119 mUseAuthenticationResults = useAuthenticationResults;
120}
121
122bool DKIMCheckPolicy::useRelaxedParsing() const
123{
124 return mUseRelaxedParsing;
125}
126
127void DKIMCheckPolicy::setUseRelaxedParsing(bool useRelaxedParsing)
128{
129 mUseRelaxedParsing = useRelaxedParsing;
130}
131
132bool DKIMCheckPolicy::useOnlyAuthenticationResults() const
133{
134 return mUseOnlyAuthenticationResults;
135}
136
137void DKIMCheckPolicy::setUseOnlyAuthenticationResults(bool useOnlyAuthenticationResults)
138{
139 mUseOnlyAuthenticationResults = useOnlyAuthenticationResults;
140}
141
142bool DKIMCheckPolicy::autogenerateRuleOnlyIfSenderInSDID() const
143{
144 return mAutogenerateRuleOnlyIfSenderInSDID;
145}
146
147void DKIMCheckPolicy::setAutogenerateRuleOnlyIfSenderInSDID(bool autogenerateRuleOnlyIfSenderInSDID)
148{
149 mAutogenerateRuleOnlyIfSenderInSDID = autogenerateRuleOnlyIfSenderInSDID;
150}
151
152int DKIMCheckPolicy::publicRsaTooSmallPolicy() const
153{
154 return mPublicRsaTooSmallPolicy;
155}
156
157void DKIMCheckPolicy::setPublicRsaTooSmallPolicy(int publicRsaTooSmallPolicy)
158{
159 mPublicRsaTooSmallPolicy = publicRsaTooSmallPolicy;
160}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:25 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.