diff options
author | Vincent Richard <[email protected]> | 2013-09-04 18:34:41 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2013-09-04 18:34:41 +0000 |
commit | a4cb3dc8628f6dbccd97b0b45e38431d95aedc3f (patch) | |
tree | 57a941e7c9b287da7e1811bbc2297615fb8c7fd7 | |
parent | Added missing exports. (diff) | |
download | vmime-a4cb3dc8628f6dbccd97b0b45e38431d95aedc3f.tar.gz vmime-a4cb3dc8628f6dbccd97b0b45e38431d95aedc3f.zip |
Added support for MIC (thanks to Mehmet Bozkurt).
-rw-r--r-- | src/mdn/receivedMDNInfos.cpp | 14 | ||||
-rw-r--r-- | vmime/mdn/receivedMDNInfos.hpp | 8 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/mdn/receivedMDNInfos.cpp b/src/mdn/receivedMDNInfos.cpp index 48665696..876ba3d9 100644 --- a/src/mdn/receivedMDNInfos.cpp +++ b/src/mdn/receivedMDNInfos.cpp @@ -69,11 +69,18 @@ const disposition receivedMDNInfos::getDisposition() const } +const string receivedMDNInfos::getContentMIC() const +{ + return m_contentMIC; +} + + void receivedMDNInfos::copyFrom(const receivedMDNInfos& other) { m_msg = other.m_msg; m_omid = other.m_omid; m_disp = other.m_disp; + m_contentMIC = other.m_contentMIC; } @@ -109,6 +116,13 @@ void receivedMDNInfos::extract() try { m_disp = *fields.Disposition()->getValue().dynamicCast <const disposition>(); } catch (exceptions::no_such_field&) { /* Ignore */ } + + try + { + text t = *fields.findField("Received-content-MIC")->getValue().dynamicCast <const text>(); + m_contentMIC = t.generate(); + } + catch (exceptions::no_such_field&) { /* Ignore */ } } } } diff --git a/vmime/mdn/receivedMDNInfos.hpp b/vmime/mdn/receivedMDNInfos.hpp index 23cf77f2..c836f23c 100644 --- a/vmime/mdn/receivedMDNInfos.hpp +++ b/vmime/mdn/receivedMDNInfos.hpp @@ -65,6 +65,13 @@ public: */ const disposition getDisposition() const; + /** Return the Message Integrity Check (MIC), that is the value + * of the "Received-content-MIC" field. + * + * @return MIC hash value, or an empty string if not specified + */ + const string getContentMIC() const; + private: void copyFrom(const receivedMDNInfos& other); @@ -76,6 +83,7 @@ private: disposition m_disp; messageId m_omid; + string m_contentMIC; }; |