File indexing completed on 2025-03-09 04:54:28
0001 /* 0002 SPDX-FileCopyrightText: 2019-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "messageviewer/messageviewersettings.h" 0010 #include "messageviewer_export.h" 0011 namespace MessageViewer 0012 { 0013 /** 0014 * @brief The DKIMCheckPolicy class 0015 * @author Laurent Montel <montel@kde.org> 0016 */ 0017 class MESSAGEVIEWER_EXPORT DKIMCheckPolicy 0018 { 0019 public: 0020 DKIMCheckPolicy(); 0021 0022 [[nodiscard]] int rsaSha1Policy() const; 0023 [[nodiscard]] bool verifySignatureWhenOnlyTest() const; 0024 void setRsaSha1Policy(int rsaSha1Policy); 0025 0026 void setVerifySignatureWhenOnlyTest(bool verifySignatureWhenOnlyTest); 0027 0028 [[nodiscard]] bool saveDkimResult() const; 0029 void setSaveDkimResult(bool saveDkimResult); 0030 0031 [[nodiscard]] int saveKey() const; 0032 void setSaveKey(int saveKey); 0033 0034 [[nodiscard]] bool autogenerateRule() const; 0035 void setAutogenerateRule(bool autogenerateRule); 0036 0037 [[nodiscard]] bool checkIfEmailShouldBeSigned() const; 0038 void setCheckIfEmailShouldBeSigned(bool checkIfEmailShouldBeSigned); 0039 0040 [[nodiscard]] bool useDMarc() const; 0041 void setUseDMarc(bool useDMarc); 0042 0043 [[nodiscard]] bool useDefaultRules() const; 0044 void setUseDefaultRules(bool useDefaultRules); 0045 0046 [[nodiscard]] bool useAuthenticationResults() const; 0047 void setUseAuthenticationResults(bool useAuthenticationResults); 0048 0049 [[nodiscard]] bool useRelaxedParsing() const; 0050 void setUseRelaxedParsing(bool useRelaxedParsing); 0051 0052 [[nodiscard]] bool useOnlyAuthenticationResults() const; 0053 void setUseOnlyAuthenticationResults(bool useOnlyAuthenticationResults); 0054 0055 [[nodiscard]] bool autogenerateRuleOnlyIfSenderInSDID() const; 0056 void setAutogenerateRuleOnlyIfSenderInSDID(bool autogenerateRuleOnlyIfSenderInSDID); 0057 0058 [[nodiscard]] int publicRsaTooSmallPolicy() const; 0059 void setPublicRsaTooSmallPolicy(int publicRsaTooSmallPolicy); 0060 0061 private: 0062 int mRsaSha1Policy = -1; 0063 int mSaveKey = -1; 0064 int mPublicRsaTooSmallPolicy = -1; 0065 bool mVerifySignatureWhenOnlyTest = false; 0066 bool mSaveDkimResult = false; 0067 bool mAutogenerateRule = false; 0068 bool mCheckIfEmailShouldBeSigned = false; 0069 bool mUseDMarc = false; 0070 bool mUseDefaultRules = false; 0071 bool mUseAuthenticationResults = false; 0072 bool mUseRelaxedParsing = false; 0073 bool mUseOnlyAuthenticationResults = false; 0074 bool mAutogenerateRuleOnlyIfSenderInSDID = false; 0075 }; 0076 }