1 #ifndef OPENDMARC_DOT_HPP
2 #define OPENDMARC_DOT_HPP
6 #include <opendmarc/dmarc.h>
8 #include <glog/logging.h>
13 constexpr char const* advice_to_string(advice adv
);
17 lib(lib
const&) = delete;
18 lib
& operator=(lib
const&) = delete;
23 lib
& operator=(lib
&&) = default;
34 policy(policy
const&) = delete;
35 policy
& operator=(policy
const&) = delete;
41 policy(policy
&&) = default;
42 policy
& operator=(policy
&&) = default;
46 void connect(char const* ip
);
47 bool store_from_domain(char const* from_domain
);
48 bool store_dkim(char const* d_equal_domain
,
50 char const* human_result
);
51 bool store_spf(char const* domain
,
54 char const* human_readable
);
55 bool query_dmarc(char const* domain
);
59 DMARC_POLICY_T
* pctx_
{nullptr};
69 constexpr char const* advice_to_string(advice adv
)
72 case advice::ACCEPT
: return "accept";
73 case advice::REJECT
: return "reject";
74 case advice::QUARANTINE
: return "quarantine";
75 case advice::NONE
: break;
80 constexpr char const* policy_spf_to_string(int pol
)
83 case DMARC_POLICY_SPF_OUTCOME_NONE
: return "SPF_OUTCOME_NONE";
84 case DMARC_POLICY_SPF_OUTCOME_PASS
: return "SPF_OUTCOME_PASS";
85 case DMARC_POLICY_SPF_OUTCOME_FAIL
: return "SPF_OUTCOME_FAIL";
86 case DMARC_POLICY_SPF_OUTCOME_TMPFAIL
: return "SPF_OUTCOME_TMPFAIL";
87 case DMARC_POLICY_SPF_ALIGNMENT_PASS
: return "SPF_ALIGNMENT_PASS";
88 case DMARC_POLICY_SPF_ALIGNMENT_FAIL
: return "SPF_ALIGNMENT_FAIL";
93 } // namespace OpenDMARC
95 #endif // OPENDMARC_DOT_HPP