Messagelib

dkimcheckpolicy.cpp
1 /*
2  SPDX-FileCopyrightText: 2019-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "dkimcheckpolicy.h"
8 
9 using namespace MessageViewer;
10 
11 DKIMCheckPolicy::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 
32 int DKIMCheckPolicy::rsaSha1Policy() const
33 {
34  return mRsaSha1Policy;
35 }
36 
37 bool DKIMCheckPolicy::verifySignatureWhenOnlyTest() const
38 {
39  return mVerifySignatureWhenOnlyTest;
40 }
41 
42 void DKIMCheckPolicy::setRsaSha1Policy(int rsaSha1Policy)
43 {
44  mRsaSha1Policy = rsaSha1Policy;
45 }
46 
47 void DKIMCheckPolicy::setVerifySignatureWhenOnlyTest(bool verifySignatureWhenOnlyTest)
48 {
49  mVerifySignatureWhenOnlyTest = verifySignatureWhenOnlyTest;
50 }
51 
52 bool DKIMCheckPolicy::saveDkimResult() const
53 {
54  return mSaveDkimResult;
55 }
56 
57 void DKIMCheckPolicy::setSaveDkimResult(bool saveDkimResult)
58 {
59  mSaveDkimResult = saveDkimResult;
60 }
61 
62 int DKIMCheckPolicy::saveKey() const
63 {
64  return mSaveKey;
65 }
66 
67 void DKIMCheckPolicy::setSaveKey(int saveKey)
68 {
69  mSaveKey = saveKey;
70 }
71 
72 bool DKIMCheckPolicy::autogenerateRule() const
73 {
74  return mAutogenerateRule;
75 }
76 
77 void DKIMCheckPolicy::setAutogenerateRule(bool autogenerateRule)
78 {
79  mAutogenerateRule = autogenerateRule;
80 }
81 
82 bool DKIMCheckPolicy::checkIfEmailShouldBeSigned() const
83 {
84  return mCheckIfEmailShouldBeSigned;
85 }
86 
87 void DKIMCheckPolicy::setCheckIfEmailShouldBeSigned(bool checkIfEmailShouldBeSigned)
88 {
89  mCheckIfEmailShouldBeSigned = checkIfEmailShouldBeSigned;
90 }
91 
92 bool DKIMCheckPolicy::useDMarc() const
93 {
94  return mUseDMarc;
95 }
96 
97 void DKIMCheckPolicy::setUseDMarc(bool useDMarc)
98 {
99  mUseDMarc = useDMarc;
100 }
101 
102 bool DKIMCheckPolicy::useDefaultRules() const
103 {
104  return mUseDefaultRules;
105 }
106 
107 void DKIMCheckPolicy::setUseDefaultRules(bool useDefaultRules)
108 {
109  mUseDefaultRules = useDefaultRules;
110 }
111 
112 bool DKIMCheckPolicy::useAuthenticationResults() const
113 {
114  return mUseAuthenticationResults;
115 }
116 
117 void DKIMCheckPolicy::setUseAuthenticationResults(bool useAuthenticationResults)
118 {
119  mUseAuthenticationResults = useAuthenticationResults;
120 }
121 
122 bool DKIMCheckPolicy::useRelaxedParsing() const
123 {
124  return mUseRelaxedParsing;
125 }
126 
127 void DKIMCheckPolicy::setUseRelaxedParsing(bool useRelaxedParsing)
128 {
129  mUseRelaxedParsing = useRelaxedParsing;
130 }
131 
132 bool DKIMCheckPolicy::useOnlyAuthenticationResults() const
133 {
134  return mUseOnlyAuthenticationResults;
135 }
136 
137 void DKIMCheckPolicy::setUseOnlyAuthenticationResults(bool useOnlyAuthenticationResults)
138 {
139  mUseOnlyAuthenticationResults = useOnlyAuthenticationResults;
140 }
141 
142 bool DKIMCheckPolicy::autogenerateRuleOnlyIfSenderInSDID() const
143 {
144  return mAutogenerateRuleOnlyIfSenderInSDID;
145 }
146 
147 void DKIMCheckPolicy::setAutogenerateRuleOnlyIfSenderInSDID(bool autogenerateRuleOnlyIfSenderInSDID)
148 {
149  mAutogenerateRuleOnlyIfSenderInSDID = autogenerateRuleOnlyIfSenderInSDID;
150 }
151 
152 int DKIMCheckPolicy::publicRsaTooSmallPolicy() const
153 {
154  return mPublicRsaTooSmallPolicy;
155 }
156 
157 void DKIMCheckPolicy::setPublicRsaTooSmallPolicy(int publicRsaTooSmallPolicy)
158 {
159  mPublicRsaTooSmallPolicy = publicRsaTooSmallPolicy;
160 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Nov 26 2021 23:16:41 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.