[git] GpgOL - branch, master, updated. gpgol-2.2.0-14-gb4b5960

by Andre Heinecke cvs at cvs.gnupg.org
Thu Jun 21 16:33:10 CEST 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG extension for MS Outlook".

The branch, master has been updated
       via  b4b5960c7397ce65d0c105f3538270157fd40e5e (commit)
       via  b0d80b45053d6c705377f26a5eff95e34f4070ff (commit)
       via  f8a13fcbfcbf2b04f9763621d0917b4f402b5670 (commit)
      from  4213ac0986d7058307a733d4a853a9b790a9c971 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b4b5960c7397ce65d0c105f3538270157fd40e5e
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Jun 21 16:31:57 2018 +0200

    Use convention for MAPI/OOM active functs
    
    --
    This should make it easier to see if a function accesses
    MAPI or OOM somewhere internally. For now this is only
    done for our main Mail class.

diff --git a/src/cryptcontroller.cpp b/src/cryptcontroller.cpp
index df5366c..dd36831 100644
--- a/src/cryptcontroller.cpp
+++ b/src/cryptcontroller.cpp
@@ -69,8 +69,8 @@ CryptController::CryptController (Mail *mail, bool encrypt, bool sign,
     m_proto (proto)
 {
   log_debug ("%s:%s: CryptController ctor for %p encrypt %i sign %i inline %i.",
-             SRCNAME, __func__, mail, encrypt, sign, mail->do_pgp_inline ());
-  m_recipient_addrs = vector_to_cArray (mail->get_cached_recipients ());
+             SRCNAME, __func__, mail, encrypt, sign, mail->getDoPGPInline ());
+  m_recipient_addrs = vector_to_cArray (mail->getRecipients ());
 }
 
 CryptController::~CryptController()
@@ -94,7 +94,7 @@ CryptController::collect_data ()
   /* Take the Body from the mail if possible. This is a fix for
      GnuPG-Bug-ID: T3614 because the body is not always properly
      updated in MAPI when sending. */
-  char *body = m_mail->take_cached_plain_body ();
+  char *body = m_mail->takeCachedPlainBody ();
   if (body && !*body)
     {
       xfree (body);
@@ -112,7 +112,7 @@ CryptController::collect_data ()
   int n_att_usable = count_usable_attachments (att_table);
   if (!n_att_usable && !body)
     {
-      gpgol_message_box (m_mail->get_window(),
+      gpgol_message_box (m_mail->getWindow (),
                          utf8_gettext ("Can't encrypt / sign an empty message."),
                          utf8_gettext ("GpgOL"), MB_OK);
       gpgol_release (message);
@@ -120,7 +120,7 @@ CryptController::collect_data ()
       return -1;
     }
 
-  bool do_inline = m_mail->do_pgp_inline ();
+  bool do_inline = m_mail->getDoPGPInline ();
 
   if (n_att_usable && do_inline)
     {
@@ -128,7 +128,7 @@ CryptController::collect_data ()
                  " Using PGP MIME",
                  SRCNAME, __func__);
       do_inline = false;
-      m_mail->set_do_pgp_inline (false);
+      m_mail->setDoPGPInline (false);
     }
   else if (do_inline)
     {
@@ -295,7 +295,7 @@ CryptController::parse_output (GpgME::Data &resolverOutput)
     {
       log_error ("%s:%s: Encrypt requested but no recipient fingerprints",
                  SRCNAME, __func__);
-      gpgol_message_box (m_mail->get_window(), _("No recipients for encryption selected."),
+      gpgol_message_box (m_mail->getWindow (), _("No recipients for encryption selected."),
                          _("GpgOL"), MB_OK);
       return -2;
     }
@@ -312,7 +312,7 @@ CryptController::resolve_keys_cached()
 
   if (m_encrypt)
     {
-      const auto cached_sender = m_mail->get_cached_sender ();
+      const auto cached_sender = m_mail->getSender ();
       auto recps = cArray_to_vector ((const char**) m_recipient_addrs);
       recps.push_back (cached_sender);
 
@@ -338,13 +338,13 @@ CryptController::resolve_keys_cached()
     {
       if (!fallbackToSMIME)
         {
-          m_signer_key = cache->getSigningKey (m_mail->get_cached_sender ().c_str (),
+          m_signer_key = cache->getSigningKey (m_mail->getSender ().c_str (),
                                                GpgME::OpenPGP);
           m_proto = GpgME::OpenPGP;
         }
       if (m_signer_key.isNull() && opt.enable_smime)
         {
-          m_signer_key = cache->getSigningKey (m_mail->get_cached_sender ().c_str (),
+          m_signer_key = cache->getSigningKey (m_mail->getSender ().c_str (),
                                                GpgME::CMS);
           m_proto = GpgME::CMS;
         }
@@ -392,7 +392,7 @@ CryptController::resolve_keys ()
   args.push_back (std::string ("--debug"));
 
   // Yes passing it as int is ok.
-  auto wnd = m_mail->get_window ();
+  auto wnd = m_mail->getWindow ();
   if (wnd)
     {
       // Pass the handle of the active window for raise / overlay.
@@ -421,7 +421,7 @@ CryptController::resolve_keys ()
     {
       args.push_back (std::string ("--sign"));
     }
-  const auto cached_sender = m_mail->get_cached_sender ();
+  const auto cached_sender = m_mail->getSender ();
   if (cached_sender.empty())
     {
       log_error ("%s:%s: resolve keys without sender.",
@@ -520,7 +520,7 @@ CryptController::do_crypto (GpgME::Error &err)
              SRCNAME, __func__);
 
   /* Start a WKS check if necessary. */
-  WKSHelper::instance()->start_check (m_mail->get_cached_sender ());
+  WKSHelper::instance()->start_check (m_mail->getSender ());
 
   int ret = resolve_keys ();
   if (ret == -1)
@@ -535,14 +535,14 @@ CryptController::do_crypto (GpgME::Error &err)
       // Cancel
       return -2;
     }
-  bool do_inline = m_mail->do_pgp_inline ();
+  bool do_inline = m_mail->getDoPGPInline ();
 
   if (m_proto == GpgME::CMS && do_inline)
     {
       log_debug ("%s:%s: Inline for S/MIME not supported. Switching to mime.",
                  SRCNAME, __func__);
       do_inline = false;
-      m_mail->set_do_pgp_inline (false);
+      m_mail->setDoPGPInline (false);
       m_bodyInput = GpgME::Data(GpgME::Data::null);
     }
 
@@ -552,7 +552,7 @@ CryptController::do_crypto (GpgME::Error &err)
     {
       log_error ("%s:%s: Failure to create context.",
                  SRCNAME, __func__);
-      gpgol_message_box (m_mail->get_window (),
+      gpgol_message_box (m_mail->getWindow (),
                          "Failure to create context.",
                          utf8_gettext ("GpgOL"), MB_OK);
       return -1;
@@ -892,7 +892,7 @@ CryptController::update_mail_mapi ()
       return -1;
     }
 
-  if (m_mail->do_pgp_inline ())
+  if (m_mail->getDoPGPInline ())
     {
       // Nothing to do for inline.
       log_debug ("%s:%s: Inline mail. Setting encoding.",
@@ -926,7 +926,7 @@ CryptController::update_mail_mapi ()
   // This means that the conversion / build of the mime structure also
   // happens differently.
   int exchange_major_version = get_ex_major_version_for_addr (
-                                        m_mail->get_cached_sender ().c_str ());
+                                        m_mail->getSender ().c_str ());
 
   std::string overrideMimeTag;
   if (m_proto == GpgME::CMS && m_encrypt && exchange_major_version >= 15)
@@ -1002,7 +1002,7 @@ std::string
 CryptController::get_inline_data ()
 {
   std::string ret;
-  if (!m_mail->do_pgp_inline ())
+  if (!m_mail->getDoPGPInline ())
     {
       return ret;
     }
@@ -1054,7 +1054,7 @@ CryptController::parse_micalg (const GpgME::SigningResult &result)
 void
 CryptController::start_crypto_overlay ()
 {
-  auto wid = m_mail->get_window ();
+  auto wid = m_mail->getWindow ();
 
   std::string text;
 
diff --git a/src/gpgoladdin.cpp b/src/gpgoladdin.cpp
index 38ed039..95ec7c7 100644
--- a/src/gpgoladdin.cpp
+++ b/src/gpgoladdin.cpp
@@ -365,7 +365,7 @@ GpgolAddin::OnDisconnection (ext_DisconnectMode RemoveMode,
      does not allow us any OOM calls then and only returns
      "Unexpected error" in that case. Weird. */
 
-  if (Mail::close_all_mails ())
+  if (Mail::closeAllMails_o ())
     {
       MessageBox (NULL,
                   "Failed to remove plaintext from at least one message.\n\n"
diff --git a/src/keycache.cpp b/src/keycache.cpp
index 75d971b..0e53c2d 100644
--- a/src/keycache.cpp
+++ b/src/keycache.cpp
@@ -59,23 +59,23 @@ namespace
           m_mail (mail)
         {
           s_thread_cnt++;
-          Mail::delete_lock ();
-          if (Mail::is_valid_ptr (m_mail))
+          Mail::lockDelete ();
+          if (Mail::isValidPtr (m_mail))
             {
-              m_mail->increment_locate_count ();
+              m_mail->incrementLocateCount ();
             }
-          Mail::delete_unlock ();
+          Mail::unlockDelete ();
         };
 
         ~LocateArgs()
         {
           s_thread_cnt--;
-          Mail::delete_lock ();
-          if (Mail::is_valid_ptr (m_mail))
+          Mail::lockDelete ();
+          if (Mail::isValidPtr (m_mail))
             {
-              m_mail->decrement_locate_count ();
+              m_mail->decrementLocateCount ();
             }
-          Mail::delete_unlock ();
+          Mail::unlockDelete ();
         }
 
         std::string m_mbox;
@@ -625,8 +625,8 @@ bool
 KeyCache::isMailResolvable(Mail *mail)
 {
   /* Get the data from the mail. */
-  const auto sender = mail->get_cached_sender();
-  auto recps = mail->get_cached_recipients();
+  const auto sender = mail->getSender ();
+  auto recps = mail->getRecipients ();
 
   if (sender.empty() || recps.empty())
     {
diff --git a/src/mail.cpp b/src/mail.cpp
index e817b1e..783ccd3 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -101,7 +101,7 @@ Mail::Mail (LPDISPATCH mailitem) :
     m_first_autosecure_check(true),
     m_locate_count(0)
 {
-  if (get_mail_for_item (mailitem))
+  if (getMailForItem (mailitem))
     {
       log_error ("Mail object for item: %p already exists. Bug.",
                  mailitem);
@@ -128,14 +128,14 @@ GPGRT_LOCK_DEFINE(dtor_lock);
 
 // static
 void
-Mail::delete_lock ()
+Mail::lockDelete ()
 {
   gpgrt_lock_lock (&dtor_lock);
 }
 
 // static
 void
-Mail::delete_unlock ()
+Mail::unlockDelete ()
 {
   gpgrt_lock_unlock (&dtor_lock);
 }
@@ -203,7 +203,7 @@ Mail::~Mail()
 }
 
 Mail *
-Mail::get_mail_for_item (LPDISPATCH mailitem)
+Mail::getMailForItem (LPDISPATCH mailitem)
 {
   if (!mailitem)
     {
@@ -221,7 +221,7 @@ Mail::get_mail_for_item (LPDISPATCH mailitem)
 }
 
 Mail *
-Mail::get_mail_for_uuid (const char *uuid)
+Mail::getMailForUUID (const char *uuid)
 {
   if (!uuid)
     {
@@ -238,7 +238,7 @@ Mail::get_mail_for_uuid (const char *uuid)
 }
 
 bool
-Mail::is_valid_ptr (const Mail *mail)
+Mail::isValidPtr (const Mail *mail)
 {
   gpgrt_lock_lock (&mail_map_lock);
   auto it = s_mail_map.begin();
@@ -256,7 +256,7 @@ Mail::is_valid_ptr (const Mail *mail)
 }
 
 int
-Mail::pre_process_message ()
+Mail::preProcessMessage_m ()
 {
   LPMESSAGE message = get_oom_base_message (m_mailitem);
   if (!message)
@@ -334,7 +334,7 @@ get_attachment (LPDISPATCH mailitem, int pos)
 /** Helper to check that all attachments are hidden, to be
   called before crypto. */
 int
-Mail::check_attachments () const
+Mail::checkAttachments_o () const
 {
   LPDISPATCH attachments = get_oom_object (m_mailitem, "Attachments");
   if (!attachments)
@@ -352,17 +352,17 @@ Mail::check_attachments () const
 
   std::string message;
 
-  if (is_encrypted () && is_signed ())
+  if (isEncrypted () && isSigned ())
     {
       message += _("Not all attachments were encrypted or signed.\n"
                    "The unsigned / unencrypted attachments are:\n\n");
     }
-  else if (is_signed ())
+  else if (isSigned ())
     {
       message += _("Not all attachments were signed.\n"
                    "The unsigned attachments are:\n\n");
     }
-  else if (is_encrypted ())
+  else if (isEncrypted ())
     {
       message += _("Not all attachments were encrypted.\n"
                    "The unencrypted attachments are:\n\n");
@@ -689,7 +689,7 @@ do_parsing (LPVOID arg)
   /* We lock with mail dtors so we can be sure the mail->parser
      call is valid. */
   Mail *mail = (Mail *)arg;
-  if (!Mail::is_valid_ptr (mail))
+  if (!Mail::isValidPtr (mail))
     {
       log_debug ("%s:%s: canceling parsing for: %p already deleted",
                  SRCNAME, __func__, arg);
@@ -698,7 +698,7 @@ do_parsing (LPVOID arg)
     }
   /* This takes a shared ptr of parser. So the parser is
      still valid when the mail is deleted. */
-  auto parser = mail->parser();
+  auto parser = mail->parser ();
   gpgrt_lock_unlock (&dtor_lock);
 
   gpgrt_lock_lock (&parser_lock);
@@ -712,7 +712,7 @@ do_parsing (LPVOID arg)
   log_debug ("%s:%s: preparing the parser for: %p",
              SRCNAME, __func__, arg);
 
-  if (!Mail::is_valid_ptr (mail))
+  if (!Mail::isValidPtr (mail))
     {
       log_debug ("%s:%s: cancel for: %p already deleted",
                  SRCNAME, __func__, arg);
@@ -814,25 +814,25 @@ do_crypt (LPVOID arg)
   /* We lock with mail dtors so we can be sure the mail->parser
      call is valid. */
   Mail *mail = (Mail *)arg;
-  if (!Mail::is_valid_ptr (mail))
+  if (!Mail::isValidPtr (mail))
     {
       log_debug ("%s:%s: canceling crypt for: %p already deleted",
                  SRCNAME, __func__, arg);
       gpgrt_lock_unlock (&dtor_lock);
       return 0;
     }
-  if (mail->crypt_state() != Mail::NeedsActualCrypt)
+  if (mail->cryptState () != Mail::NeedsActualCrypt)
     {
       log_debug ("%s:%s: invalid state %i",
-                 SRCNAME, __func__, mail->crypt_state ());
-      mail->set_window_enabled (true);
+                 SRCNAME, __func__, mail->cryptState ());
+      mail->setWindowEnabled_o (true);
       gpgrt_lock_unlock (&dtor_lock);
       return -1;
     }
 
   /* This takes a shared ptr of crypter. So the crypter is
      still valid when the mail is deleted. */
-  auto crypter = mail->crypter();
+  auto crypter = mail->cryper ();
   gpgrt_lock_unlock (&dtor_lock);
 
   if (!crypter)
@@ -840,7 +840,7 @@ do_crypt (LPVOID arg)
       log_error ("%s:%s: no crypter found for mail: %p",
                  SRCNAME, __func__, arg);
       gpgrt_lock_unlock (&parser_lock);
-      mail->set_window_enabled (true);
+      mail->setWindowEnabled_o (true);
       return -1;
     }
 
@@ -848,7 +848,7 @@ do_crypt (LPVOID arg)
   int rc = crypter->do_crypto(err);
 
   gpgrt_lock_lock (&dtor_lock);
-  if (!Mail::is_valid_ptr (mail))
+  if (!Mail::isValidPtr (mail))
     {
       log_debug ("%s:%s: aborting crypt for: %p already deleted",
                  SRCNAME, __func__, arg);
@@ -856,23 +856,23 @@ do_crypt (LPVOID arg)
       return 0;
     }
 
-  mail->set_window_enabled (true);
+  mail->setWindowEnabled_o (true);
 
   if (rc == -1 || err)
     {
-      mail->reset_crypter ();
+      mail->resetCrypter ();
       crypter = nullptr;
       if (err)
         {
           char *buf = nullptr;
           gpgrt_asprintf (&buf, _("Crypto operation failed:\n%s"),
                           err.asString());
-          gpgol_message_box (mail->get_window(), buf, _("GpgOL"), MB_OK);
+          gpgol_message_box (mail->getWindow (), buf, _("GpgOL"), MB_OK);
           xfree (buf);
         }
       else
         {
-          gpgol_bug (mail->get_window (),
+          gpgol_bug (mail->getWindow (),
                      ERR_CRYPT_RESOLVER_FAILED);
         }
     }
@@ -881,16 +881,16 @@ do_crypt (LPVOID arg)
     {
       log_debug ("%s:%s: crypto failed for: %p with: %i err: %i",
                  SRCNAME, __func__, arg, rc, err.code());
-      mail->set_crypt_state (Mail::NoCryptMail);
-      mail->reset_crypter ();
+      mail->setCryptState (Mail::NoCryptMail);
+      mail->resetCrypter ();
       crypter = nullptr;
       gpgrt_lock_unlock (&dtor_lock);
       return rc;
     }
 
-  if (!mail->async_crypt_disabled ())
+  if (!mail->isAsyncCryptDisabled ())
     {
-      mail->set_crypt_state (Mail::NeedsUpdateInOOM);
+      mail->setCryptState (Mail::NeedsUpdateInOOM);
       gpgrt_lock_unlock (&dtor_lock);
       // This deletes the Mail in Outlook 2010
       do_in_ui_thread (CRYPTO_DONE, arg);
@@ -899,12 +899,12 @@ do_crypt (LPVOID arg)
     }
   else
     {
-      mail->set_crypt_state (Mail::NeedsUpdateInMAPI);
-      mail->update_crypt_mapi ();
-      if (mail->crypt_state () == Mail::WantsSendMIME)
+      mail->setCryptState (Mail::NeedsUpdateInMAPI);
+      mail->updateCryptMAPI_m ();
+      if (mail->cryptState () == Mail::WantsSendMIME)
         {
           // For sync crypto we need to switch this.
-          mail->set_crypt_state (Mail::NeedsUpdateInOOM);
+          mail->setCryptState (Mail::NeedsUpdateInOOM);
         }
       else
         {
@@ -912,7 +912,7 @@ do_crypt (LPVOID arg)
           log_debug ("%s:%s: Resetting crypter because of state mismatch. %p",
                      SRCNAME, __func__, arg);
           crypter = nullptr;
-          mail->reset_crypter ();
+          mail->resetCrypter ();
         }
       gpgrt_lock_unlock (&dtor_lock);
     }
@@ -929,7 +929,7 @@ do_crypt (LPVOID arg)
 }
 
 bool
-Mail::is_crypto_mail() const
+Mail::isCryptoMail () const
 {
   if (m_type == MSGTYPE_UNKNOWN || m_type == MSGTYPE_GPGOL ||
       m_type == MSGTYPE_SMIME)
@@ -941,9 +941,9 @@ Mail::is_crypto_mail() const
 }
 
 int
-Mail::decrypt_verify()
+Mail::decryptVerify_o ()
 {
-  if (!is_crypto_mail())
+  if (!isCryptoMail ())
     {
       log_debug ("%s:%s: Decrypt Verify for non crypto mail: %p.",
                  SRCNAME, __func__, m_mailitem);
@@ -955,7 +955,7 @@ Mail::decrypt_verify()
                  SRCNAME, __func__, m_mailitem);
       return 1;
     }
-  set_uuid ();
+  setUUID_o ();
   m_processed = true;
 
 
@@ -974,7 +974,7 @@ Mail::decrypt_verify()
     }
   else if (gpgrt_asprintf (&placeholder_buf, opt.prefer_html ? decrypt_template_html :
                       decrypt_template,
-                      is_smime() ? "S/MIME" : "OpenPGP",
+                      isSMIME_m () ? "S/MIME" : "OpenPGP",
                       _("message"),
                       _("Please wait while the message is being decrypted / verified...")) == -1)
     {
@@ -1020,9 +1020,9 @@ Mail::decrypt_verify()
     }
 
   m_parser = std::shared_ptr <ParseController> (new ParseController (cipherstream, m_type));
-  m_parser->setSender(GpgME::UserID::addrSpecFromString(get_sender().c_str()));
+  m_parser->setSender(GpgME::UserID::addrSpecFromString(getSender_o ().c_str()));
   log_mime_parser ("%s:%s: Parser for \"%s\" is %p",
-                   SRCNAME, __func__, get_subject ().c_str(), m_parser.get());
+                   SRCNAME, __func__, getSubject_o ().c_str(), m_parser.get());
   gpgol_release (cipherstream);
 
   HANDLE parser_thread = CreateThread (NULL, 0, do_parsing, (LPVOID) this, 0,
@@ -1049,7 +1049,7 @@ void find_and_replace(std::string& source, const std::string &find,
 }
 
 void
-Mail::update_body()
+Mail::updateBody_o ()
 {
   if (!m_parser)
     {
@@ -1166,7 +1166,7 @@ Mail::update_body()
               buf += "\n\n";
               buf += _("This message is shown only once.");
 
-              gpgol_message_box (get_window(), buf.c_str(), caption.c_str(),
+              gpgol_message_box (getWindow (), buf.c_str(), caption.c_str(),
                                  MB_OK);
               opt.smime_html_warn_shown = true;
               write_options ();
@@ -1236,7 +1236,7 @@ Mail::update_body()
       buf += _("Please ask the sender to sign the message or\n"
                "to send it with a plain text alternative.");
 
-      gpgol_message_box (get_window(), buf.c_str(), caption.c_str(),
+      gpgol_message_box (getWindow (), buf.c_str(), caption.c_str(),
                          MB_OK);
     }
 
@@ -1309,12 +1309,12 @@ Mail::parsing_done()
       m_crypto_flags |= 2;
     }
 
-  update_sigstate ();
+  updateSigstate_o ();
   m_needs_wipe = !m_is_send_again;
 
   TRACEPOINT;
   /* Set categories according to the result. */
-  update_categories ();
+  updateCategories_o ();
 
   TRACEPOINT;
   m_block_html = m_parser->shouldBlockHtml ();
@@ -1322,16 +1322,16 @@ Mail::parsing_done()
   if (m_block_html)
     {
       // Just to be careful.
-      set_block_status ();
+      setBlockStatus_m ();
     }
 
   TRACEPOINT;
   /* Update the body */
-  update_body();
+  updateBody_o ();
   TRACEPOINT;
 
   /* Check that there are no unsigned / unencrypted messages. */
-  check_attachments ();
+  checkAttachments_o ();
 
   /* Update attachments */
   if (add_attachments (m_mailitem, m_parser->get_attachments()))
@@ -1357,7 +1357,7 @@ Mail::parsing_done()
           set_gpgol_draft_info_flags (msg, m_crypto_flags);
           gpgol_release (msg);
         }
-      remove_our_attachments ();
+      removeOurAttachments_o ();
     }
 
   log_debug ("%s:%s: Delayed invalidate to update sigstate.",
@@ -1369,7 +1369,7 @@ Mail::parsing_done()
 }
 
 int
-Mail::encrypt_sign_start ()
+Mail::encryptSignStart_o ()
 {
   if (m_crypt_state != NeedsActualCrypt)
     {
@@ -1429,12 +1429,12 @@ Mail::encrypt_sign_start ()
 
   // Careful from here on we have to check every
   // error condition with window enabling again.
-  set_window_enabled (false);
+  setWindowEnabled_o (false);
   if (m_crypter->collect_data ())
     {
       log_error ("%s:%s: Crypter for mail %p failed to collect data.",
                  SRCNAME, __func__, this);
-      set_window_enabled (true);
+      setWindowEnabled_o (true);
       return -1;
     }
 
@@ -1468,7 +1468,7 @@ Mail::needs_crypto ()
 }
 
 int
-Mail::wipe (bool force)
+Mail::wipe_o (bool force)
 {
   if (!m_needs_wipe && !force)
     {
@@ -1497,12 +1497,12 @@ Mail::wipe (bool force)
 }
 
 int
-Mail::update_oom_data ()
+Mail::updateOOMData_o ()
 {
   char *buf = nullptr;
   log_debug ("%s:%s", SRCNAME, __func__);
 
-  if (!is_crypto_mail())
+  if (!isCryptoMail ())
     {
       /* Update the body format. */
       m_is_html_alternative = get_oom_int (m_mailitem, "BodyFormat") > 1;
@@ -1518,14 +1518,14 @@ Mail::update_oom_data ()
       xfree (m_cached_plain_body);
       m_cached_plain_body = get_oom_string (m_mailitem, "Body");
 
-      char **recipients = get_recipients ();
+      char **recipients = getRecipients_o ();
       m_cached_recipients = cArray_to_vector ((const char **)recipients);
       xfree (recipients);
     }
   /* For some reason outlook may store the recipient address
      in the send using account field. If we have SMTP we prefer
      the SenderEmailAddress string. */
-  if (is_crypto_mail ())
+  if (isCryptoMail ())
     {
       /* This is the case where we are reading a mail and not composing.
          When composing we need to use the SendUsingAccount because if
@@ -1545,7 +1545,7 @@ Mail::update_oom_data ()
     {
       buf = get_sender_SendUsingAccount (m_mailitem, &m_is_gsuite);
     }
-  if (!buf && !is_crypto_mail ())
+  if (!buf && !isCryptoMail ())
     {
       /* Try the sender Object */
       buf = get_sender_Sender (m_mailitem);
@@ -1568,21 +1568,21 @@ Mail::update_oom_data ()
 }
 
 std::string
-Mail::get_sender ()
+Mail::getSender_o ()
 {
   if (m_sender.empty())
-    update_oom_data();
+    updateOOMData_o ();
   return m_sender;
 }
 
 std::string
-Mail::get_cached_sender () const
+Mail::getSender () const
 {
   return m_sender;
 }
 
 int
-Mail::close_all_mails ()
+Mail::closeAllMails_o ()
 {
   int err = 0;
   std::map<LPDISPATCH, Mail *>::iterator it;
@@ -1595,22 +1595,22 @@ Mail::close_all_mails ()
       /* XXX For non racy code the is_valid_ptr check should not
          be necessary but we crashed sometimes closing a destroyed
          mail. */
-      if (!is_valid_ptr (it->second))
+      if (!isValidPtr (it->second))
         {
           log_debug ("%s:%s: Already deleted mail for %p",
                    SRCNAME, __func__, it->first);
           continue;
         }
 
-      if (!it->second->is_crypto_mail())
+      if (!it->second->isCryptoMail ())
         {
           continue;
         }
-      if (close_inspector (it->second) || close (it->second))
+      if (closeInspector_o (it->second) || close (it->second))
         {
           log_error ("Failed to close mail: %p ", it->first);
           /* Should not happen */
-          if (is_valid_ptr (it->second) && it->second->revert())
+          if (isValidPtr (it->second) && it->second->revert_o ())
             {
               err++;
             }
@@ -1619,21 +1619,21 @@ Mail::close_all_mails ()
   return err;
 }
 int
-Mail::revert_all_mails ()
+Mail::revertAllMails_o ()
 {
   int err = 0;
   std::map<LPDISPATCH, Mail *>::iterator it;
   gpgrt_lock_lock (&mail_map_lock);
   for (it = s_mail_map.begin(); it != s_mail_map.end(); ++it)
     {
-      if (it->second->revert ())
+      if (it->second->revert_o ())
         {
           log_error ("Failed to revert mail: %p ", it->first);
           err++;
           continue;
         }
 
-      it->second->set_needs_save (true);
+      it->second->setNeedsSave (true);
       if (!invoke_oom_method (it->first, "Save", NULL))
         {
           log_error ("Failed to save reverted mail: %p ", it->second);
@@ -1646,14 +1646,14 @@ Mail::revert_all_mails ()
 }
 
 int
-Mail::wipe_all_mails ()
+Mail::wipeAllMails_o ()
 {
   int err = 0;
   std::map<LPDISPATCH, Mail *>::iterator it;
   gpgrt_lock_lock (&mail_map_lock);
   for (it = s_mail_map.begin(); it != s_mail_map.end(); ++it)
     {
-      if (it->second->wipe ())
+      if (it->second->wipe_o ())
         {
           log_error ("Failed to wipe mail: %p ", it->first);
           err++;
@@ -1664,7 +1664,7 @@ Mail::wipe_all_mails ()
 }
 
 int
-Mail::revert ()
+Mail::revert_o ()
 {
   int err = 0;
   if (!m_processed)
@@ -1679,7 +1679,7 @@ Mail::revert ()
     {
       log_error ("%s:%s: Message revert failed falling back to wipe.",
                  SRCNAME, __func__);
-      return wipe ();
+      return wipe_o ();
     }
   /* We need to reprocess the mail next time around. */
   m_processed = false;
@@ -1689,7 +1689,7 @@ Mail::revert ()
 }
 
 bool
-Mail::is_smime ()
+Mail::isSMIME_m ()
 {
   msgtype_t msgtype;
   LPMESSAGE message;
@@ -1748,25 +1748,25 @@ get_string (LPDISPATCH item, const char *str)
 }
 
 std::string
-Mail::get_subject() const
+Mail::getSubject_o () const
 {
   return get_string (m_mailitem, "Subject");
 }
 
 std::string
-Mail::get_body() const
+Mail::getBody_o () const
 {
   return get_string (m_mailitem, "Body");
 }
 
 std::string
-Mail::get_html_body() const
+Mail::getHTMLBody_o () const
 {
   return get_string (m_mailitem, "HTMLBody");
 }
 
 char **
-Mail::get_recipients() const
+Mail::getRecipients_o () const
 {
   LPDISPATCH recipients = get_oom_object (m_mailitem, "Recipients");
   if (!recipients)
@@ -1780,7 +1780,7 @@ Mail::get_recipients() const
 }
 
 int
-Mail::close_inspector (Mail *mail)
+Mail::closeInspector_o (Mail *mail)
 {
   LPDISPATCH inspector = get_oom_object (mail->item(), "GetInspector");
   HRESULT hr;
@@ -1834,7 +1834,7 @@ Mail::close (Mail *mail)
 
   log_oom_extra ("%s:%s: Invoking close for: %p",
                  SRCNAME, __func__, mail->item());
-  mail->set_close_triggered (true);
+  mail->setCloseTriggered (true);
   int rc = invoke_oom_method_with_parms (mail->item(), "Close",
                                        NULL, &dispparams);
 
@@ -1844,13 +1844,13 @@ Mail::close (Mail *mail)
 }
 
 void
-Mail::set_close_triggered (bool value)
+Mail::setCloseTriggered (bool value)
 {
   m_close_triggered = value;
 }
 
 bool
-Mail::get_close_triggered () const
+Mail::getCloseTriggered () const
 {
   return m_close_triggered;
 }
@@ -1898,9 +1898,9 @@ get_uid_for_sender (const Key &k, const char *sender)
 }
 
 void
-Mail::update_sigstate ()
+Mail::updateSigstate_o ()
 {
-  std::string sender = get_sender();
+  std::string sender = getSender_o ();
 
   if (sender.empty())
     {
@@ -1963,13 +1963,13 @@ Mail::update_sigstate ()
 }
 
 bool
-Mail::is_valid_sig () const
+Mail::isValidSig () const
 {
    return m_is_valid;
 }
 
 void
-Mail::remove_categories ()
+Mail::removeCategories_o ()
 {
   const char *decCategory = _("GpgOL: Encrypted Message");
   const char *verifyCategory = _("GpgOL: Trusted Sender Address");
@@ -2040,11 +2040,11 @@ resize_active_window ()
 }
 
 void
-Mail::update_categories ()
+Mail::updateCategories_o ()
 {
   const char *decCategory = _("GpgOL: Encrypted Message");
   const char *verifyCategory = _("GpgOL: Trusted Sender Address");
-  if (is_valid_sig())
+  if (isValidSig ())
     {
       add_category (m_mailitem, verifyCategory);
     }
@@ -2070,19 +2070,19 @@ Mail::update_categories ()
 }
 
 bool
-Mail::is_signed() const
+Mail::isSigned () const
 {
   return m_verify_result.numSignatures() > 0;
 }
 
 bool
-Mail::is_encrypted() const
+Mail::isEncrypted () const
 {
   return !m_decrypt_result.isNull();
 }
 
 int
-Mail::set_uuid()
+Mail::setUUID_o ()
 {
   char *uuid;
   if (!m_uuid.empty())
@@ -2112,7 +2112,7 @@ Mail::set_uuid()
   if (m_uuid.empty())
     {
       m_uuid = uuid;
-      Mail *other = get_mail_for_uuid (uuid);
+      Mail *other = getMailForUUID (uuid);
       if (other)
         {
           /* According to documentation this should not
@@ -2227,11 +2227,11 @@ level_4_check (const UserID &uid)
 }
 
 std::string
-Mail::get_crypto_summary () const
+Mail::getCryptoSummary () const
 {
   const int level = get_signature_level ();
 
-  bool enc = is_encrypted ();
+  bool enc = isEncrypted ();
   if (level == 4 && enc)
     {
       return _("Security Level 4");
@@ -2260,7 +2260,7 @@ Mail::get_crypto_summary () const
     {
       return _("Encrypted");
     }
-  if (is_signed ())
+  if (isSigned ())
     {
       /* Even if it is signed, if it is not validly
          signed it's still completly insecure as anyone
@@ -2273,10 +2273,10 @@ Mail::get_crypto_summary () const
 }
 
 std::string
-Mail::get_crypto_one_line() const
+Mail::getCryptoOneLine () const
 {
-  bool sig = is_signed ();
-  bool enc = is_encrypted ();
+  bool sig = isSigned ();
+  bool enc = isEncrypted ();
   if (sig || enc)
     {
       if (sig && enc)
@@ -2296,12 +2296,12 @@ Mail::get_crypto_one_line() const
 }
 
 std::string
-Mail::get_crypto_details()
+Mail::getCryptoDetails_o ()
 {
   std::string message;
 
   /* No signature with keys but error */
-  if (!is_encrypted() && !is_signed () && m_verify_result.error())
+  if (!isEncrypted () && !isSigned () && m_verify_result.error())
     {
       message = _("You cannot be sure who sent, "
                   "modified and read the message in transit.");
@@ -2312,13 +2312,13 @@ Mail::get_crypto_details()
       return message;
     }
   /* No crypo, what are we doing here? */
-  if (!is_encrypted () && !is_signed ())
+  if (!isEncrypted () && !isSigned ())
     {
       return _("You cannot be sure who sent, "
                "modified and read the message in transit.");
     }
   /* Handle encrypt only */
-  if (is_encrypted() && !is_signed ())
+  if (isEncrypted () && !isSigned ())
     {
       if (in_de_vs_mode ())
        {
@@ -2338,7 +2338,7 @@ Mail::get_crypto_details()
     }
 
   bool keyFound = true;
-  bool isOpenPGP = m_sig.key().isNull() ? !is_smime() :
+  bool isOpenPGP = m_sig.key().isNull() ? !isSMIME_m () :
                    m_sig.key().protocol() == Protocol::OpenPGP;
   char *buf;
   bool hasConflict = false;
@@ -2436,7 +2436,7 @@ Mail::get_crypto_details()
     {
       /* Now we are in level 0, this could be a technical problem, no key
          or just unkown. */
-      message = is_encrypted () ? _("But the sender address is not trustworthy because:") :
+      message = isEncrypted () ? _("But the sender address is not trustworthy because:") :
                                   _("The sender address is not trustworthy because:");
       message += "\n";
       keyFound = !(m_sig.summary() & Signature::Summary::KeyMissing);
@@ -2503,7 +2503,7 @@ Mail::get_crypto_details()
       else if (m_uid.isNull())
         {
           gpgrt_asprintf (&buf, _("does not claim the address: \"%s\"."),
-                          get_sender().c_str());
+                          getSender_o ().c_str());
           message += buf;
           xfree (buf);
         }
@@ -2534,7 +2534,7 @@ Mail::get_crypto_details()
    message += "\n\n";
    if (in_de_vs_mode ())
      {
-       if (is_signed ())
+       if (isSigned ())
          {
            if (m_sig.isDeVs ())
              {
@@ -2546,7 +2546,7 @@ Mail::get_crypto_details()
              }
            message += "\n";
          }
-       if (is_encrypted ())
+       if (isEncrypted ())
          {
            if (m_decrypt_result.isDeVs ())
              {
@@ -2622,15 +2622,15 @@ Mail::get_signature_level () const
 }
 
 int
-Mail::get_crypto_icon_id () const
+Mail::getCryptoIconID () const
 {
   int level = get_signature_level ();
-  int offset = is_encrypted () ? ENCRYPT_ICON_OFFSET : 0;
+  int offset = isEncrypted () ? ENCRYPT_ICON_OFFSET : 0;
   return IDI_LEVEL_0 + level + offset;
 }
 
 const char*
-Mail::get_sig_fpr() const
+Mail::getSigFpr () const
 {
   if (!m_is_signed || m_sig.isNull())
     {
@@ -2641,7 +2641,7 @@ Mail::get_sig_fpr() const
 
 /** Try to locate the keys for all recipients */
 void
-Mail::locate_keys()
+Mail::locateKeys_o ()
 {
   static bool locate_in_progress;
 
@@ -2674,23 +2674,23 @@ Mail::locate_keys()
   locate_in_progress = true;
 
   // First update oom data to have recipients and sender updated.
-  update_oom_data ();
-  KeyCache::instance()->startLocateSecret (get_sender ().c_str (), this);
-  KeyCache::instance()->startLocate (get_sender ().c_str (), this);
-  KeyCache::instance()->startLocate (get_cached_recipients (), this);
-  autoresolve_check_s ();
+  updateOOMData_o ();
+  KeyCache::instance()->startLocateSecret (getSender_o ().c_str (), this);
+  KeyCache::instance()->startLocate (getSender_o ().c_str (), this);
+  KeyCache::instance()->startLocate (getRecipients (), this);
+  autoresolveCheck ();
 
   locate_in_progress = false;
 }
 
 bool
-Mail::is_html_alternative () const
+Mail::isHTMLAlternative () const
 {
   return m_is_html_alternative;
 }
 
 char *
-Mail::take_cached_html_body ()
+Mail::takeCachedHTMLBody ()
 {
   char *ret = m_cached_html_body;
   m_cached_html_body = nullptr;
@@ -2698,7 +2698,7 @@ Mail::take_cached_html_body ()
 }
 
 char *
-Mail::take_cached_plain_body ()
+Mail::takeCachedPlainBody ()
 {
   char *ret = m_cached_plain_body;
   m_cached_plain_body = nullptr;
@@ -2706,37 +2706,37 @@ Mail::take_cached_plain_body ()
 }
 
 int
-Mail::get_crypto_flags () const
+Mail::getCryptoFlags () const
 {
   return m_crypto_flags;
 }
 
 void
-Mail::set_needs_encrypt (bool value)
+Mail::setNeedsEncrypt (bool value)
 {
   m_needs_encrypt = value;
 }
 
 bool
-Mail::needs_encrypt() const
+Mail::getNeedsEncrypt () const
 {
   return m_needs_encrypt;
 }
 
 std::vector<std::string>
-Mail::get_cached_recipients()
+Mail::getRecipients ()
 {
   return m_cached_recipients;
 }
 
 void
-Mail::append_to_inline_body (const std::string &data)
+Mail::appendToInlineBody (const std::string &data)
 {
   m_inline_body += data;
 }
 
 int
-Mail::inline_body_to_body()
+Mail::inlineBodyToBody ()
 {
   if (!m_crypter)
     {
@@ -2760,7 +2760,7 @@ Mail::inline_body_to_body()
 }
 
 void
-Mail::update_crypt_mapi()
+Mail::updateCryptMAPI_m ()
 {
   log_debug ("%s:%s: Update crypt mapi",
              SRCNAME, __func__);
@@ -2801,10 +2801,10 @@ Mail::update_crypt_mapi()
     }
 
   /** If sync we need the crypter in update_crypt_oom */
-  if (!async_crypt_disabled ())
+  if (!isAsyncCryptDisabled ())
     {
       // We don't need the crypter anymore.
-      reset_crypter ();
+      resetCrypter ();
     }
 }
 
@@ -2815,7 +2815,7 @@ Mail::update_crypt_mapi()
 static std::pair<bool, bool>
 has_crypt_or_empty_body_oom (Mail *mail)
 {
-  auto body = mail->get_body();
+  auto body = mail->getBody_o ();
   std::pair<bool, bool> ret;
   ret.first = false;
   ret.second = false;
@@ -2838,7 +2838,7 @@ has_crypt_or_empty_body_oom (Mail *mail)
 }
 
 void
-Mail::update_crypt_oom()
+Mail::updateCryptOOM_o ()
 {
   log_debug ("%s:%s: Update crypt oom for %p",
              SRCNAME, __func__, this);
@@ -2846,13 +2846,13 @@ Mail::update_crypt_oom()
     {
       log_debug ("%s:%s: invalid state %i",
                  SRCNAME, __func__, m_crypt_state);
-      reset_crypter ();
+      resetCrypter ();
       return;
     }
 
-  if (do_pgp_inline ())
+  if (getDoPGPInline ())
     {
-      if (inline_body_to_body ())
+      if (inlineBodyToBody ())
         {
           log_error ("%s:%s: Inline body to body failed %p.",
                      SRCNAME, __func__, this);
@@ -2878,9 +2878,9 @@ Mail::update_crypt_oom()
 
   /** When doing async update_crypt_mapi follows and needs
     the crypter. */
-  if (async_crypt_disabled ())
+  if (isAsyncCryptDisabled ())
     {
-      reset_crypter ();
+      resetCrypter ();
     }
 
   const auto pair = has_crypt_or_empty_body_oom (this);
@@ -2893,7 +2893,7 @@ Mail::update_crypt_oom()
     }
 
   // We are in MIME land. Wipe the body.
-  if (wipe (true))
+  if (wipe_o (true))
     {
       log_debug ("%s:%s: Cancel send for %p.",
                  SRCNAME, __func__, this);
@@ -2915,7 +2915,7 @@ Mail::update_crypt_oom()
 }
 
 void
-Mail::set_window_enabled (bool value)
+Mail::setWindowEnabled_o (bool value)
 {
   if (!value)
     {
@@ -2965,7 +2965,7 @@ Mail::check_inline_response ()
   char * inlineSubject = get_oom_string (inlineResponse, "Subject");
   gpgol_release (inlineResponse);
 
-  const auto subject = get_subject ();
+  const auto subject = getSubject_o ();
   if (inlineResponse && !subject.empty() && !strcmp (subject.c_str (), inlineSubject))
     {
       log_debug ("%s:%s: Detected inline response for '%p'",
@@ -2982,9 +2982,9 @@ Mail::check_inline_response ()
 
 // static
 Mail *
-Mail::get_last_mail ()
+Mail::getLastMail ()
 {
-  if (!s_last_mail || !is_valid_ptr (s_last_mail))
+  if (!s_last_mail || !isValidPtr (s_last_mail))
     {
       s_last_mail = nullptr;
     }
@@ -2993,14 +2993,14 @@ Mail::get_last_mail ()
 
 // static
 void
-Mail::invalidate_last_mail ()
+Mail::clearLastMail ()
 {
   s_last_mail = nullptr;
 }
 
 // static
 void
-Mail::locate_all_crypto_recipients()
+Mail::locateAllCryptoRecipients_o ()
 {
   if (!opt.autoresolve)
     {
@@ -3013,14 +3013,14 @@ Mail::locate_all_crypto_recipients()
     {
       if (it->second->needs_crypto ())
         {
-          it->second->locate_keys ();
+          it->second->locateKeys_o ();
         }
     }
   gpgrt_lock_unlock (&mail_map_lock);
 }
 
 int
-Mail::remove_all_attachments ()
+Mail::removeAllAttachments_o ()
 {
   int ret = 0;
   LPDISPATCH attachments = get_oom_object (m_mailitem, "Attachments");
@@ -3065,7 +3065,7 @@ Mail::remove_all_attachments ()
 }
 
 int
-Mail::remove_our_attachments ()
+Mail::removeOurAttachments_o ()
 {
   LPDISPATCH attachments = get_oom_object (m_mailitem, "Attachments");
   if (!attachments)
@@ -3127,7 +3127,7 @@ Mail::remove_our_attachments ()
 /* We are very verbose because if we fail it might mean
    that we have leaked plaintext -> critical. */
 bool
-Mail::has_crypted_or_empty_body ()
+Mail::hasCryptedOrEmptyBody_o ()
 {
   const auto pair = has_crypt_or_empty_body_oom (this);
 
@@ -3186,7 +3186,7 @@ Mail::has_crypted_or_empty_body ()
 }
 
 std::string
-Mail::get_verification_result_dump()
+Mail::getVerificationResultDump ()
 {
   std::stringstream ss;
   ss << m_verify_result;
@@ -3194,7 +3194,7 @@ Mail::get_verification_result_dump()
 }
 
 void
-Mail::set_block_status()
+Mail::setBlockStatus_m ()
 {
   SPropValue prop;
 
@@ -3215,19 +3215,19 @@ Mail::set_block_status()
 }
 
 void
-Mail::set_block_html(bool value)
+Mail::setBlockHTML (bool value)
 {
   m_block_html = value;
 }
 
 void
-Mail::increment_locate_count()
+Mail::incrementLocateCount ()
 {
   m_locate_count++;
 }
 
 void
-Mail::decrement_locate_count()
+Mail::decrementLocateCount ()
 {
   m_locate_count--;
 
@@ -3239,12 +3239,12 @@ Mail::decrement_locate_count()
     }
   if (!m_locate_count)
     {
-      autoresolve_check_s ();
+      autoresolveCheck ();
     }
 }
 
 void
-Mail::autoresolve_check_s()
+Mail::autoresolveCheck ()
 {
   if (!opt.autoresolve || m_manual_crypto_opts ||
       m_locate_count)
@@ -3266,7 +3266,7 @@ Mail::autoresolve_check_s()
 }
 
 void
-Mail::set_do_autosecure_mapi(bool value)
+Mail::setDoAutosecure_m (bool value)
 {
   TRACEPOINT;
   LPMESSAGE msg = get_oom_base_message (m_mailitem);
@@ -3277,7 +3277,7 @@ Mail::set_do_autosecure_mapi(bool value)
     }
   /* We need to set a uuid so that autosecure can
      be disabled manually */
-  set_uuid ();
+  setUUID_o ();
 
   int old_flags = get_gpgol_draft_info_flags (msg);
   if (old_flags && m_first_autosecure_check)
diff --git a/src/mail.h b/src/mail.h
index 7190306..287d07d 100644
--- a/src/mail.h
+++ b/src/mail.h
@@ -111,7 +111,7 @@ public:
     @returns A reference to an existing mailitem or NULL in case none
     could be found.
   */
-  static Mail* get_mail_for_item (LPDISPATCH mailitem);
+  static Mail* getMailForItem (LPDISPATCH mailitem);
 
   /** @brief looks for existing Mail objects in the uuid map.
     Only objects for which set_uid has been called can be found
@@ -120,16 +120,16 @@ public:
     @returns A reference to an existing mailitem or NULL in case none
     could be found.
   */
-  static Mail* get_mail_for_uuid (const char *uuid);
+  static Mail* getMailForUUID (const char *uuid);
 
   /** @brief Get the last created mail.
 
     @returns A reference to the last created mail or null.
   */
-  static Mail* get_last_mail ();
+  static Mail* getLastMail ();
 
   /** @brief voids the last mail variable. */
-  static void invalidate_last_mail ();
+  static void clearLastMail ();
 
   /** @brief Lock mail deletion.
 
@@ -146,22 +146,22 @@ public:
 
     Use it in your thread like:
 
-      Mail::delete_lock ();
-      Mail::is_valid_ptr (mail);
+      Mail::lockDelete ();
+      Mail::isValidPtr (mail);
       mail->set_or_check_something ();
-      Mail::delete_unlock ();
+      Mail::unlockDelete ();
 
       Still be carefull when it is a mapi or oom function.
   */
-  static void delete_lock ();
-  static void delete_unlock ();
+  static void lockDelete ();
+  static void unlockDelete ();
 
   /** @brief looks for existing Mail objects.
 
     @returns A reference to an existing mailitem or NULL in case none
     could be found. Can be used to check if a mail object was destroyed.
   */
-  static bool is_valid_ptr (const Mail *mail);
+  static bool isValidPtr (const Mail *mail);
 
   /** @brief wipe the plaintext from all known Mail objects.
     *
@@ -171,7 +171,7 @@ public:
     *
     * @returns the number of errors that occured.
     */
-  static int wipe_all_mails ();
+  static int wipeAllMails_o ();
 
   /** @brief revert all known Mail objects.
     *
@@ -180,7 +180,7 @@ public:
     *
     * @returns the number of errors that occured.
     */
-  static int revert_all_mails ();
+  static int revertAllMails_o ();
 
   /** @brief close all known Mail objects.
     *
@@ -195,13 +195,13 @@ public:
     *
     * @returns the number of errors that occured.
     */
-  static int close_all_mails ();
+  static int closeAllMails_o ();
 
   /** @brief closes the inspector for a mail
     *
     * @returns true on success.
   */
-  static int close_inspector (Mail *mail);
+  static int closeInspector_o (Mail *mail);
 
   /** Call close with discard changes to discard
       plaintext. returns the value of the oom close
@@ -220,7 +220,7 @@ public:
     * we march over all mails and if they are crypto mails we check
     * that the recipents were located.
     */
-  static void locate_all_crypto_recipients ();
+  static void locateAllCryptoRecipients_o ();
 
   /** @brief Reference to the mailitem. Do not Release! */
   LPDISPATCH item () { return m_mailitem; }
@@ -233,14 +233,14 @@ public:
    *
    * @returns 0 on success.
    */
-  int pre_process_message ();
+  int preProcessMessage_m ();
 
   /** @brief Decrypt / Verify the mail.
    *
    * Sets the needs_wipe and was_encrypted variable.
    *
    * @returns 0 on success. */
-  int decrypt_verify ();
+  int decryptVerify_o ();
 
   /** @brief start crypto operations as selected by the user.
    *
@@ -248,10 +248,10 @@ public:
    * draft info flags.
    *
    * @returns 0 on success. */
-  int encrypt_sign_start ();
+  int encryptSignStart_o ();
 
   /** @brief Necessary crypto operations were completed successfully. */
-  bool crypto_successful () { return m_crypt_successful || !needs_crypto(); }
+  bool wasCryptoSuccessful_m () { return m_crypt_successful || !needs_crypto(); }
 
   /** @brief Message should be encrypted and or signed.
     0: No
@@ -264,12 +264,12 @@ public:
   /** @brief wipe the plaintext from the message and encrypt attachments.
    *
    * @returns 0 on success; */
-  int wipe (bool force = false);
+  int wipe_o (bool force = false);
 
   /** @brief revert the message to the original mail before our changes.
    *
    * @returns 0 on success; */
-  int revert ();
+  int revert_o ();
 
   /** @brief update some data collected from the oom
    *
@@ -284,7 +284,7 @@ public:
    * It also updated the is_html_alternative value.
    *
    * @returns 0 on success */
-  int update_oom_data ();
+  int updateOOMData_o ();
 
   /** @brief get sender SMTP address (UTF-8 encoded).
    *
@@ -292,19 +292,19 @@ public:
    * calls update_sender before returning the sender.
    *
    * @returns A reference to the utf8 sender address. Or an empty string. */
-  std::string get_sender ();
+  std::string getSender_o ();
 
   /** @brief get sender SMTP address (UTF-8 encoded).
    *
    * Like get_sender but ensures not to touch oom or mapi
    *
    * @returns A reference to the utf8 sender address. Or an empty string. */
-  std::string get_cached_sender () const;
+  std::string getSender () const;
 
   /** @brief get the subject string (UTF-8 encoded).
     *
     * @returns the subject or an empty string. */
-  std::string get_subject () const;
+  std::string getSubject_o () const;
 
   /** @brief Is this a crypto mail handled by gpgol.
   *
@@ -313,23 +313,23 @@ public:
   * @returns true if the mail was either signed or encrypted and we processed
   * it.
   */
-  bool is_crypto_mail () const;
+  bool isCryptoMail () const;
 
   /** @brief This mail needs to be actually written.
   *
   * @returns true if the next write event should not be canceled.
   */
-  bool needs_save () { return m_needs_save; }
+  bool needsSave () { return m_needs_save; }
 
   /** @brief set the needs save state.
   */
-  void set_needs_save (bool val) { m_needs_save = val; }
+  void setNeedsSave (bool val) { m_needs_save = val; }
 
   /** @brief is this mail an S/MIME mail.
     *
     * @returns true for smime messages.
     */
-  bool is_smime ();
+  bool isSMIME_m ();
 
   /** @brief get the associated parser.
     only valid while the actual parsing happens. */
@@ -337,7 +337,7 @@ public:
 
   /** @brief get the associated cryptcontroller.
     only valid while the crypting happens. */
-  std::shared_ptr<CryptController> crypter () { return m_crypter; }
+  std::shared_ptr<CryptController> cryper () { return m_crypter; }
 
   /** To be called from outside once the paser was done.
    In Qt this would be a slot that is called once it is finished
@@ -348,90 +348,90 @@ public:
 
   /** Returns true if the mail was verified and has at least one
     signature. Regardless of the validity of the mail */
-  bool is_signed () const;
+  bool isSigned () const;
 
   /** Returns true if the mail is encrypted to at least one
     recipient. Regardless if it could be decrypted. */
-  bool is_encrypted () const;
+  bool isEncrypted () const;
 
   /** Are we "green" */
-  bool is_valid_sig () const;
+  bool isValidSig () const;
 
   /** Get UID gets UniqueID property of this mail. Returns
     an empty string if the uid was not set with set uid.*/
-  const std::string & get_uuid () const { return m_uuid; }
+  const std::string & getUUID () const { return m_uuid; }
 
   /** Returns 0 on success if the mail has a uid alrady or sets
     the uid. Setting only succeeds if the OOM is currently
     accessible. Returns -1 on error. */
-  int set_uuid ();
+  int setUUID_o ();
 
   /** Returns a localized string describing in one or two
     words the crypto status of this mail. */
-  std::string get_crypto_summary () const;
+  std::string getCryptoSummary () const;
 
   /** Returns a localized string describing the detailed
     crypto state of this mail. */
-  std::string get_crypto_details ();
+  std::string getCryptoDetails_o ();
 
   /** Returns a localized string describing a one line
     summary of the crypto state. */
-  std::string get_crypto_one_line () const;
+  std::string getCryptoOneLine () const;
 
   /** Get the icon id of the appropiate icon for this mail */
-  int get_crypto_icon_id () const;
+  int getCryptoIconID () const;
 
   /** Get the fingerprint of an associated signature or null
       if it is not signed. */
-  const char *get_sig_fpr() const;
+  const char *getSigFpr () const;
 
   /** Remove all categories of this mail */
-  void remove_categories ();
+  void removeCategories_o ();
 
   /** Get the body of the mail */
-  std::string get_body () const;
+  std::string getBody_o () const;
 
   /** Get the html of the mail */
-  std::string get_html_body () const;
+  std::string getHTMLBody_o () const;
 
   /** Get the recipients recipients is a null
       terminated array of strings. Needs to be freed
       by the caller. */
-  char ** get_recipients () const;
+  char ** getRecipients_o () const;
 
   /** Try to locate the keys for all recipients */
-  void locate_keys();
+  void locateKeys_o ();
 
   /** State variable to check if a close was triggerd by us. */
-  void set_close_triggered (bool value);
-  bool get_close_triggered () const;
+  void setCloseTriggered (bool value);
+  bool getCloseTriggered () const;
 
   /** Check if the mail should be sent as html alternative mail.
     Only valid if update_oom_data was called before. */
-  bool is_html_alternative () const;
+  bool isHTMLAlternative () const;
 
   /** Get the html body. It is updated in update_oom_data.
       Caller takes ownership of the string and has to free it.
   */
-  char *take_cached_html_body ();
+  char *takeCachedHTMLBody ();
 
   /** Get the plain body. It is updated in update_oom_data.
       Caller takes ownership of the string and has to free it.
   */
-  char *take_cached_plain_body ();
+  char *takeCachedPlainBody ();
 
   /** Get the cached recipients. It is updated in update_oom_data.*/
-  std::vector<std::string> get_cached_recipients ();
+  std::vector<std::string> getRecipients ();
 
   /** Returns 1 if the mail was encrypted, 2 if signed, 3 if both.
       Only valid after decrypt_verify.
   */
-  int get_crypto_flags () const;
+  int getCryptoFlags () const;
 
   /** Returns true if the mail should be encrypted in the
       after write event. */
-  bool needs_encrypt () const;
-  void set_needs_encrypt (bool val);
+  bool getNeedsEncrypt () const;
+  void setNeedsEncrypt (bool val);
 
   /** Gets the level of the signature. See:
     https://wiki.gnupg.org/EasyGpg2016/AutomatedEncryption for
@@ -440,43 +440,43 @@ public:
 
   /** Check if all attachments are hidden and show a warning
     message appropiate to the crypto state if necessary. */
-  int check_attachments () const;
+  int checkAttachments_o () const;
 
   /** Check if the mail should be encrypted "inline" */
-  bool do_pgp_inline () const {return m_do_inline;}
+  bool getDoPGPInline () const {return m_do_inline;}
 
   /** Check if the mail should be encrypted "inline" */
-  void set_do_pgp_inline (bool value) {m_do_inline = value;}
+  void setDoPGPInline (bool value) {m_do_inline = value;}
 
   /** Append data to a cached inline body. Helper to do this
      on MAPI level and later add it through OOM */
-  void append_to_inline_body (const std::string &data);
+  void appendToInlineBody (const std::string &data);
 
   /** Set the inline body as OOM body property. */
-  int inline_body_to_body ();
+  int inlineBodyToBody ();
 
   /** Get the crypt state */
-  CryptState crypt_state () const {return m_crypt_state;}
+  CryptState cryptState () const {return m_crypt_state;}
 
   /** Set the crypt state */
-  void set_crypt_state (CryptState state) {m_crypt_state = state;}
+  void setCryptState (CryptState state) {m_crypt_state = state;}
 
   /** Update MAPI data after encryption. */
-  void update_crypt_mapi ();
+  void updateCryptMAPI_m ();
 
   /** Update OOM data after encryption.
 
     Checks for plain text leaks and
     does not advance crypt state if body can't be cleaned.
   */
-  void update_crypt_oom ();
+  void updateCryptOOM_o ();
 
   /** Enable / Disable the window of this mail.
 
     When value is false the active window will
     be disabled and the handle stored for a later
     enable. */
-  void set_window_enabled (bool value);
+  void setWindowEnabled_o (bool value);
 
   /** Determine if the mail is an inline response.
 
@@ -484,7 +484,7 @@ public:
     from the OOM.
 
     We need synchronous encryption for inline responses. */
-  bool async_crypt_disabled () { return m_async_crypt_disabled; }
+  bool isAsyncCryptDisabled () { return m_async_crypt_disabled; }
 
   /** Check through OOM if the current mail is an inline
     response.
@@ -498,36 +498,36 @@ public:
     really valid in the time that the window is disabled.
     Use with care and can be null or invalid.
   */
-  HWND get_window () { return m_window; }
+  HWND getWindow () { return m_window; }
 
   /** Cleanup any attached crypter object. Useful
     on error. */
-  void reset_crypter () { m_crypter = nullptr; }
+  void resetCrypter () { m_crypter = nullptr; }
 
   /** Set special crypto mime data that should be used as the
     mime structure when sending. */
-  void set_override_mime_data (const std::string &data) {m_mime_data = data;}
+  void setOverrideMIMEData (const std::string &data) {m_mime_data = data;}
 
   /** Get the mime data that should be used when sending. */
   std::string get_override_mime_data () const { return m_mime_data; }
 
   /** Set if this is a forward of a crypto mail. */
-  void set_is_forwarded_crypto_mail (bool value) { m_is_forwarded_crypto_mail = value; }
+  void setIsForwardedCryptoMail (bool value) { m_is_forwarded_crypto_mail = value; }
   bool is_forwarded_crypto_mail () { return m_is_forwarded_crypto_mail; }
 
   /** Set if this is a reply of a crypto mail. */
-  void set_is_reply_crypto_mail (bool value) { m_is_reply_crypto_mail = value; }
+  void setIsReplyCryptoMail (bool value) { m_is_reply_crypto_mail = value; }
   bool is_reply_crypto_mail () { return m_is_reply_crypto_mail; }
 
   /** Remove the hidden GpgOL attachments. This is needed when forwarding
     without encryption so that our attachments are not included in the forward.
     Returns 0 on success. Works in OOM. */
-  int remove_our_attachments ();
+  int removeOurAttachments_o ();
 
   /** Remove all attachments. Including our own. This is needed for
     forwarding of unsigned S/MIME mails (Efail).
     Returns 0 on success. Works in OOM. */
-  int remove_all_attachments ();
+  int removeAllAttachments_o ();
 
   /** Check both OOM and MAPI if the body is either empty or
     encrypted. Won't abort on OOM or MAPI errors, so it can be
@@ -539,58 +539,58 @@ public:
     of encryption and is only an extra check to catch unexpected
     errors.
     */
-  bool has_crypted_or_empty_body ();
+  bool hasCryptedOrEmptyBody_o ();
 
-  void update_body ();
+  void updateBody_o ();
 
   /** Set if this mail looks like the send again of a crypto mail.
       This will mean that after it is decrypted it is treated
       like an unencrypted mail so that it can be encrypted again
       or sent unencrypted.
       */
-  void set_is_send_again (bool value) { m_is_send_again = value; }
+  void setIsSendAgain (bool value) { m_is_send_again = value; }
 
 
   /* Attachment removal state variables. */
-  bool attachment_remove_warning_disabled () { return m_disable_att_remove_warning; }
+  bool attachmentRemoveWarningDisabled () { return m_disable_att_remove_warning; }
 
   /* Gets the string dump of the verification result. */
-  std::string get_verification_result_dump ();
+  std::string getVerificationResultDump ();
 
   /* Block loading HTML content */
-  void set_block_html (bool value);
-  bool is_block_html () const { return m_block_html; }
+  void setBlockHTML (bool value);
+  bool isBlockHTML () const { return m_block_html; }
 
   /* Remove automatic loading of HTML references setting. */
-  void set_block_status ();
+  void setBlockStatus_m ();
 
   /* Crypto options (sign/encrypt) have been set manually. */
-  void set_crypto_selected_manually (bool v) { m_manual_crypto_opts = v; }
+  void setCryptoSelectedManually (bool v) { m_manual_crypto_opts = v; }
   // bool is_crypto_selected_manually () const { return m_manual_crypto_opts; }
 
   /* Reference that a resolver thread is running for this mail. */
-  void increment_locate_count ();
+  void incrementLocateCount ();
 
   /* To be called when a resolver thread is done. If there are no running
      resolver threads we can check the recipients to see if we should
      toggle / untoggle the secure state.
      */
-  void decrement_locate_count ();
+  void decrementLocateCount ();
 
   /* Check if the keys can be resolved automatically and trigger
    * setting the crypto flags accordingly.
    */
-  void autoresolve_check_s ();
+  void autoresolveCheck ();
 
   /* Set if a mail should be secured (encrypted and signed)
    *
    * Only save to call from a place that may access mapi.
    */
-  void set_do_autosecure_mapi (bool value);
+  void setDoAutosecure_m (bool value);
 
 private:
-  void update_categories ();
-  void update_sigstate ();
+  void updateCategories_o ();
+  void updateSigstate_o ();
 
   LPDISPATCH m_mailitem;
   LPDISPATCH m_event_sink;
diff --git a/src/mailitem-events.cpp b/src/mailitem-events.cpp
index 51006f6..be15eea 100644
--- a/src/mailitem-events.cpp
+++ b/src/mailitem-events.cpp
@@ -127,7 +127,7 @@ EVENT_SINK_INVOKE(MailItemEvents)
   USE_INVOKE_ARGS
   if (!m_mail)
     {
-      m_mail = Mail::get_mail_for_item (m_object);
+      m_mail = Mail::getMailForItem (m_object);
       if (!m_mail)
         {
           log_error ("%s:%s: mail event without mail object known. Bug.",
@@ -144,7 +144,7 @@ EVENT_SINK_INVOKE(MailItemEvents)
           log_oom_extra ("%s:%s: Open : %p",
                          SRCNAME, __func__, m_mail);
           LPMESSAGE message;
-          if (g_ol_version_major < 14 && m_mail->set_uuid ())
+          if (g_ol_version_major < 14 && m_mail->setUUID_o ())
             {
               /* In Outlook 2007 we need the uid for every
                  open mail to track the message in case
@@ -182,7 +182,7 @@ EVENT_SINK_INVOKE(MailItemEvents)
         {
           log_oom_extra ("%s:%s: BeforeRead : %p",
                          SRCNAME, __func__, m_mail);
-          if (m_mail->pre_process_message ())
+          if (m_mail->preProcessMessage_m ())
             {
               log_error ("%s:%s: Pre process message failed.",
                          SRCNAME, __func__);
@@ -193,7 +193,7 @@ EVENT_SINK_INVOKE(MailItemEvents)
         {
           log_oom_extra ("%s:%s: Read : %p",
                          SRCNAME, __func__, m_mail);
-          if (!m_mail->is_crypto_mail())
+          if (!m_mail->isCryptoMail ())
             {
               log_debug ("%s:%s: Non crypto mail %p opened. Updating sigstatus.",
                          SRCNAME, __func__, m_mail);
@@ -202,26 +202,26 @@ EVENT_SINK_INVOKE(MailItemEvents)
                                         NULL));
               break;
             }
-          if (m_mail->set_uuid ())
+          if (m_mail->setUUID_o ())
             {
               log_debug ("%s:%s: Failed to set uuid.",
                          SRCNAME, __func__);
               delete m_mail; /* deletes this, too */
               return S_OK;
             }
-          if (m_mail->decrypt_verify ())
+          if (m_mail->decryptVerify_o ())
             {
               log_error ("%s:%s: Decrypt message failed.",
                          SRCNAME, __func__);
             }
-          if (!opt.enable_smime && m_mail->is_smime ())
+          if (!opt.enable_smime && m_mail->isSMIME_m ())
             {
               /* We want to save the mail when it's an smime mail and smime
                  is disabled to revert it. */
               log_debug ("%s:%s: S/MIME mail but S/MIME is disabled."
                          " Need save.",
                          SRCNAME, __func__);
-              m_mail->set_needs_save (true);
+              m_mail->setNeedsSave (true);
             }
           break;
         }
@@ -236,7 +236,7 @@ EVENT_SINK_INVOKE(MailItemEvents)
               break;
             }
           const wchar_t *prop_name = parms->rgvarg[0].bstrVal;
-          if (!m_mail->is_crypto_mail ())
+          if (!m_mail->isCryptoMail ())
             {
               if (!opt.autoresolve)
                 {
@@ -285,7 +285,7 @@ EVENT_SINK_INVOKE(MailItemEvents)
                 }
               log_debug ("%s:%s: Message %p looks like send again.",
                         SRCNAME, __func__, m_object);
-              m_mail->set_is_send_again (true);
+              m_mail->setIsSendAgain (true);
               return S_OK;
             }
 
@@ -355,7 +355,7 @@ EVENT_SINK_INVOKE(MailItemEvents)
            */
           log_oom_extra ("%s:%s: Send : %p",
                          SRCNAME, __func__, m_mail);
-          if (!m_mail->needs_crypto () && m_mail->crypt_state () == Mail::NoCryptMail)
+          if (!m_mail->needs_crypto () && m_mail->cryptState () == Mail::NoCryptMail)
             {
              log_debug ("%s:%s: No crypto neccessary. Passing send for %p obj %p",
                         SRCNAME, __func__, m_mail, m_object);
@@ -369,13 +369,13 @@ EVENT_SINK_INVOKE(MailItemEvents)
              break;
            }
 
-          if (m_mail->crypt_state () == Mail::NoCryptMail &&
+          if (m_mail->cryptState () == Mail::NoCryptMail &&
               m_mail->needs_crypto ())
             {
               // First contact with a mail to encrypt update
               // state and oom data.
-              m_mail->update_oom_data ();
-              m_mail->set_crypt_state (Mail::NeedsFirstAfterWrite);
+              m_mail->updateOOMData_o ();
+              m_mail->setCryptState (Mail::NeedsFirstAfterWrite);
 
               // Check inline response state before the write.
               m_mail->check_inline_response ();
@@ -385,7 +385,7 @@ EVENT_SINK_INVOKE(MailItemEvents)
               // Save the Mail
               invoke_oom_method (m_object, "Save", NULL);
 
-              if (!m_mail->async_crypt_disabled ())
+              if (!m_mail->isAsyncCryptDisabled ())
                 {
                   // The afterwrite in the save should have triggered
                   // the encryption. We cancel send for our asyncness.
@@ -395,7 +395,7 @@ EVENT_SINK_INVOKE(MailItemEvents)
                 }
               else
                 {
-                  if (m_mail->crypt_state () == Mail::NoCryptMail)
+                  if (m_mail->cryptState () == Mail::NoCryptMail)
                     {
                       // Crypto failed or was canceled
                       log_debug ("%s:%s: Message %p mail %p cancelling send - "
@@ -406,20 +406,20 @@ EVENT_SINK_INVOKE(MailItemEvents)
                     }
                   // For inline response we can't trigger send programatically
                   // so we do the encryption in sync.
-                  if (m_mail->crypt_state () == Mail::NeedsUpdateInOOM)
+                  if (m_mail->cryptState () == Mail::NeedsUpdateInOOM)
                     {
-                      m_mail->update_crypt_oom ();
+                      m_mail->updateCryptOOM_o ();
                     }
-                  if (m_mail->crypt_state () == Mail::NeedsSecondAfterWrite)
+                  if (m_mail->cryptState () == Mail::NeedsSecondAfterWrite)
                     {
-                      m_mail->set_crypt_state (Mail::WantsSendMIME);
+                      m_mail->setCryptState (Mail::WantsSendMIME);
                     }
-                  if (m_mail->do_pgp_inline () && m_mail->crypt_state () != Mail::WantsSendInline)
+                  if (m_mail->getDoPGPInline () && m_mail->cryptState () != Mail::WantsSendInline)
                     {
                       log_debug ("%s:%s: Message %p mail %p cancelling send - "
                                  "Invalid state.",
                                  SRCNAME, __func__, m_object, m_mail);
-                      gpgol_bug (m_mail->get_window (),
+                      gpgol_bug (m_mail->getWindow (),
                                  ERR_INLINE_BODY_INV_STATE);
                       *(parms->rgvarg[0].pboolVal) = VARIANT_TRUE;
                       break;
@@ -427,16 +427,16 @@ EVENT_SINK_INVOKE(MailItemEvents)
                 }
             }
 
-          if (m_mail->crypt_state () == Mail::WantsSendInline)
+          if (m_mail->cryptState () == Mail::WantsSendInline)
             {
-              if (!m_mail->has_crypted_or_empty_body())
+              if (!m_mail->hasCryptedOrEmptyBody_o ())
                 {
                   log_debug ("%s:%s: Message %p mail %p cancelling send - "
                              "not encrypted or not empty body detected.",
                              SRCNAME, __func__, m_object, m_mail);
-                  gpgol_bug (m_mail->get_window (),
+                  gpgol_bug (m_mail->getWindow (),
                              ERR_WANTS_SEND_INLINE_BODY);
-                  m_mail->set_crypt_state (Mail::NoCryptMail);
+                  m_mail->setCryptState (Mail::NoCryptMail);
                   *(parms->rgvarg[0].pboolVal) = VARIANT_TRUE;
                   break;
                 }
@@ -445,9 +445,9 @@ EVENT_SINK_INVOKE(MailItemEvents)
               break;
             }
 
-          if (m_mail->crypt_state () == Mail::WantsSendMIME)
+          if (m_mail->cryptState () == Mail::WantsSendMIME)
             {
-              if (!m_mail->has_crypted_or_empty_body())
+              if (!m_mail->hasCryptedOrEmptyBody_o ())
                 {
 /* The safety checks here trigger too often. Somehow for some
    users the body is not empty after the encryption but when
@@ -462,12 +462,12 @@ EVENT_SINK_INVOKE(MailItemEvents)
 */
 #define DISABLE_SAFTEY_CHECKS
 #ifndef DISABLE_SAFTEY_CHECKS
-                  gpgol_bug (m_mail->get_window (),
+                  gpgol_bug (m_mail->getWindow (),
                              ERR_WANTS_SEND_MIME_BODY);
                   log_debug ("%s:%s: Message %p mail %p cancelling send mime - "
                              "not encrypted or not empty body detected.",
                              SRCNAME, __func__, m_object, m_mail);
-                  m_mail->set_crypt_state (Mail::NoCryptMail);
+                  m_mail->setCryptState (Mail::NoCryptMail);
                   *(parms->rgvarg[0].pboolVal) = VARIANT_TRUE;
                   break;
 #else
@@ -557,10 +557,10 @@ EVENT_SINK_INVOKE(MailItemEvents)
              break;
            }
 
-          if (m_mail->is_crypto_mail () && !m_mail->needs_save ())
+          if (m_mail->isCryptoMail () && !m_mail->needsSave ())
             {
-              Mail *last_mail = Mail::get_last_mail ();
-              if (Mail::is_valid_ptr (last_mail))
+              Mail *last_mail = Mail::getLastMail ();
+              if (Mail::isValidPtr (last_mail))
                 {
                   /* We want to identify here if there was a mail created that
                      should receive the contents of this mail. For this we check
@@ -578,7 +578,7 @@ EVENT_SINK_INVOKE(MailItemEvents)
                      Similarly if we crash or Outlook is closed before we see this
                      revert. But as we immediately revert after the write this should
                      also not happen. */
-                  const std::string lastSubject = last_mail->get_subject ();
+                  const std::string lastSubject = last_mail->getSubject_o ();
                   char *lastEntryID = get_oom_string (last_mail->item (), "EntryID");
                   int lastSize = get_oom_int (last_mail->item (), "Size");
                   std::string lastEntryStr;
@@ -596,7 +596,7 @@ EVENT_SINK_INVOKE(MailItemEvents)
 
                       /* This might be a forward. So don't invalidate yet. */
 
-                      // Mail::invalidate_last_mail ();
+                      // Mail::clearLastMail ();
 
                       do_in_ui_thread_async (REVERT_MAIL, m_mail);
                       return S_OK;
@@ -614,8 +614,8 @@ EVENT_SINK_INVOKE(MailItemEvents)
               return S_OK;
             }
 
-          if (m_mail->is_crypto_mail () && m_mail->needs_save () &&
-              m_mail->revert ())
+          if (m_mail->isCryptoMail () && m_mail->needsSave () &&
+              m_mail->revert_o ())
             {
               /* An error cleaning the mail should not happen normally.
                  But just in case there is an error we cancel the
@@ -625,8 +625,8 @@ EVENT_SINK_INVOKE(MailItemEvents)
               *(parms->rgvarg[0].pboolVal) = VARIANT_TRUE;
             }
 
-          if (!m_mail->is_crypto_mail () && m_mail->is_forwarded_crypto_mail () &&
-              !m_mail->needs_crypto () && m_mail->crypt_state () == Mail::NoCryptMail)
+          if (!m_mail->isCryptoMail () && m_mail->is_forwarded_crypto_mail () &&
+              !m_mail->needs_crypto () && m_mail->cryptState () == Mail::NoCryptMail)
             {
               /* We are sure now that while this is a forward of an encrypted
                * mail that the forward should not be signed or encrypted. So
@@ -635,7 +635,7 @@ EVENT_SINK_INVOKE(MailItemEvents)
               log_debug ("%s:%s: Writing unencrypted forward of crypt mail. "
                          "Removing attachments. mail: %p item: %p",
                          SRCNAME, __func__, m_mail, m_object);
-              if (m_mail->remove_our_attachments ())
+              if (m_mail->removeOurAttachments_o ())
                 {
                   // Worst case we forward some encrypted data here not
                   // a security problem, so let it pass.
@@ -643,34 +643,34 @@ EVENT_SINK_INVOKE(MailItemEvents)
                              SRCNAME, __func__);
                 }
               /* Remove marker because we did this now. */
-              m_mail->set_is_forwarded_crypto_mail (false);
+              m_mail->setIsForwardedCryptoMail (false);
             }
 
           log_debug ("%s:%s: Passing write event.",
                      SRCNAME, __func__);
-          m_mail->set_needs_save (false);
+          m_mail->setNeedsSave (false);
           break;
         }
       case AfterWrite:
         {
           log_oom_extra ("%s:%s: AfterWrite : %p",
                          SRCNAME, __func__, m_mail);
-          if (m_mail->crypt_state () == Mail::NeedsFirstAfterWrite)
+          if (m_mail->cryptState () == Mail::NeedsFirstAfterWrite)
             {
               /* Seen the first after write. Advance the state */
-              m_mail->set_crypt_state (Mail::NeedsActualCrypt);
-              if (m_mail->encrypt_sign_start ())
+              m_mail->setCryptState (Mail::NeedsActualCrypt);
+              if (m_mail->encryptSignStart_o ())
                 {
                   log_debug ("%s:%s: Encrypt sign start failes.",
                              SRCNAME, __func__);
-                  m_mail->set_crypt_state (Mail::NoCryptMail);
+                  m_mail->setCryptState (Mail::NoCryptMail);
                 }
               return S_OK;
             }
-          if (m_mail->crypt_state () == Mail::NeedsSecondAfterWrite)
+          if (m_mail->cryptState () == Mail::NeedsSecondAfterWrite)
             {
-              m_mail->set_crypt_state (Mail::NeedsUpdateInMAPI);
-              m_mail->update_crypt_mapi ();
+              m_mail->setCryptState (Mail::NeedsUpdateInMAPI);
+              m_mail->updateCryptMAPI_m ();
               return S_OK;
             }
           break;
@@ -679,7 +679,7 @@ EVENT_SINK_INVOKE(MailItemEvents)
         {
           log_oom_extra ("%s:%s: Close : %p",
                          SRCNAME, __func__, m_mail);
-          if (m_mail->is_crypto_mail ())
+          if (m_mail->isCryptoMail ())
             {
               /* Close. This happens when an Opened mail is closed.
                  To prevent the question of wether or not to save the changes
@@ -696,10 +696,10 @@ EVENT_SINK_INVOKE(MailItemEvents)
                              SRCNAME, __func__);
                   break;
                 }
-              if (m_mail->get_close_triggered ())
+              if (m_mail->getCloseTriggered ())
                 {
                   /* Our close with discard changes, pass through */
-                  m_mail->set_close_triggered (false);
+                  m_mail->setCloseTriggered (false);
                   return S_OK;
                 }
               *(parms->rgvarg[0].pboolVal) = VARIANT_TRUE;
@@ -743,7 +743,7 @@ EVENT_SINK_INVOKE(MailItemEvents)
             {
               draft_flags += 2;
             }
-          bool is_crypto_mail = m_mail->is_crypto_mail();
+          bool is_crypto_mail = m_mail->isCryptoMail ();
 
           /* If it is a crypto mail and the settings should not be taken
            * from the crypto mail and always encrypt / sign is on. Or
@@ -780,8 +780,8 @@ EVENT_SINK_INVOKE(MailItemEvents)
               break;
             }
 
-          Mail *last_mail = Mail::get_last_mail ();
-          if (Mail::is_valid_ptr (last_mail))
+          Mail *last_mail = Mail::getLastMail ();
+          if (Mail::isValidPtr (last_mail))
             {
               /* We want to identify here if there was a mail created that
                  should receive the contents of this mail. For this we check
@@ -809,7 +809,7 @@ EVENT_SINK_INVOKE(MailItemEvents)
                                  SRCNAME, __func__, last_mail,
                                  last_mail->item ());
 
-                      last_mail->set_is_forwarded_crypto_mail (true);
+                      last_mail->setIsForwardedCryptoMail (true);
                     }
                   else
                     {
@@ -818,7 +818,7 @@ EVENT_SINK_INVOKE(MailItemEvents)
                                  SRCNAME, __func__, last_mail,
                                  last_mail->item ());
                     }
-                  if (m_mail->is_block_html())
+                  if (m_mail->isBlockHTML ())
                     {
                       std::string caption = _("GpgOL") + std::string (": ");
                       caption += is_reply ? _("Dangerous reply") :
@@ -845,7 +845,7 @@ EVENT_SINK_INVOKE(MailItemEvents)
                     }
                 }
               // We can now invalidate the last mail
-              Mail::invalidate_last_mail ();
+              Mail::clearLastMail ();
             }
 
           log_oom_extra ("%s:%s: Reply Forward ReplyAll: %p",
@@ -855,7 +855,7 @@ EVENT_SINK_INVOKE(MailItemEvents)
               break;
             }
           int crypto_flags = 0;
-          if (!(crypto_flags = m_mail->get_crypto_flags ()))
+          if (!(crypto_flags = m_mail->getCryptoFlags ()))
             {
               break;
             }
@@ -883,8 +883,8 @@ EVENT_SINK_INVOKE(MailItemEvents)
         {
           log_oom_extra ("%s:%s: AttachmentRemove: %p",
                          SRCNAME, __func__, m_mail);
-          if (!m_mail->is_crypto_mail () || attachRemoveWarnShown ||
-              m_mail->attachment_remove_warning_disabled ())
+          if (!m_mail->isCryptoMail () || attachRemoveWarnShown ||
+              m_mail->attachmentRemoveWarningDisabled ())
             {
               return S_OK;
             }
diff --git a/src/mimedataprovider.cpp b/src/mimedataprovider.cpp
index d2eaa30..2b48382 100644
--- a/src/mimedataprovider.cpp
+++ b/src/mimedataprovider.cpp
@@ -1017,7 +1017,7 @@ MimeDataProvider::create_attachment()
   /* TODO handle encoding */
 }
 
-const std::string &MimeDataProvider::get_body()
+const std::string &MimeDataProvider::get_body ()
 {
   if (m_rawbuf.size())
     {
@@ -1031,7 +1031,7 @@ const std::string &MimeDataProvider::get_body()
   return m_body;
 }
 
-const std::string &MimeDataProvider::get_html_body()
+const std::string &MimeDataProvider::get_html_body ()
 {
   if (!m_has_html_body)
     {
diff --git a/src/mimemaker.cpp b/src/mimemaker.cpp
index e4bd4aa..b1dfc31 100644
--- a/src/mimemaker.cpp
+++ b/src/mimemaker.cpp
@@ -97,7 +97,7 @@ int
 sink_string_write (sink_t sink, const void *data, size_t datalen)
 {
   Mail *mail = static_cast<Mail *>(sink->cb_data);
-  mail->append_to_inline_body (std::string((char*)data, datalen));
+  mail->appendToInlineBody (std::string((char*)data, datalen));
   return 0;
 }
 
@@ -1026,7 +1026,7 @@ write_attachments (sink_t sink,
 static int
 is_related (Mail *mail, mapi_attach_item_t *table)
 {
-  if (!mail || !mail->is_html_alternative () || !table)
+  if (!mail || !mail->isHTMLAlternative () || !table)
     {
       return 0;
     }
@@ -1287,7 +1287,7 @@ add_body (Mail *mail, const char *boundary, sink_t sink,
   bool is_alternative = false;
   if (mail)
     {
-      is_alternative = mail->is_html_alternative ();
+      is_alternative = mail->isHTMLAlternative ();
     }
 
   int rc = 0;
@@ -1334,7 +1334,7 @@ add_body (Mail *mail, const char *boundary, sink_t sink,
   /* Now the html body. It is somehow not accessible through PR_HTML,
      OutlookSpy also shows MAPI Unsupported (but shows the data) strange.
      We just cache it. Memory is cheap :-) */
-  char *html_body = mail->take_cached_html_body();
+  char *html_body = mail->takeCachedHTMLBody ();
   if (!html_body)
     {
       log_error ("%s:%s: BUG: Body but no html body in alternative mail?",
diff --git a/src/parsecontroller.cpp b/src/parsecontroller.cpp
index d14af9f..5adada8 100644
--- a/src/parsecontroller.cpp
+++ b/src/parsecontroller.cpp
@@ -485,11 +485,11 @@ ParseController::parse()
 }
 
 const std::string
-ParseController::get_html_body() const
+ParseController::get_html_body () const
 {
   if (m_outputprovider)
     {
-      return m_outputprovider->get_html_body();
+      return m_outputprovider->get_html_body ();
     }
   else
     {
@@ -498,11 +498,11 @@ ParseController::get_html_body() const
 }
 
 const std::string
-ParseController::get_body() const
+ParseController::get_body () const
 {
   if (m_outputprovider)
     {
-      return m_outputprovider->get_body();
+      return m_outputprovider->get_body ();
     }
   else
     {
diff --git a/src/parsecontroller.h b/src/parsecontroller.h
index c318b9d..863b94c 100644
--- a/src/parsecontroller.h
+++ b/src/parsecontroller.h
@@ -74,7 +74,7 @@ public:
   void parse();
 
   /** Get the Body. Call parse first. */
-  const std::string get_body() const;
+  const std::string get_body () const;
 
   /** Get the charset of the body. Call parse first.
     *
@@ -86,7 +86,7 @@ public:
   const std::string get_html_charset() const;
 
   /** Get an alternative? HTML Body. Call parse first. */
-  const std::string get_html_body() const;
+  const std::string get_html_body () const;
 
   /** Get the decrypted / verified attachments. Call parse first.
   */
diff --git a/src/revert.cpp b/src/revert.cpp
index 302de55..1d3834d 100644
--- a/src/revert.cpp
+++ b/src/revert.cpp
@@ -105,7 +105,7 @@ gpgol_mailitem_revert (LPDISPATCH mailitem)
       return -1;
     }
 
-  mail = Mail::get_mail_for_item (mailitem);
+  mail = Mail::getMailForItem (mailitem);
   if (!mail)
     {
       xfree (msgcls);
@@ -113,7 +113,7 @@ gpgol_mailitem_revert (LPDISPATCH mailitem)
                  SRCNAME, __func__);
       return -1;
     }
-  is_smime = mail->is_smime ();
+  is_smime = mail->isSMIME_m ();
 
   message = get_oom_base_message (mailitem);
   attachments = get_oom_object (mailitem, "Attachments");
@@ -349,7 +349,7 @@ gpgol_mailitem_revert (LPDISPATCH mailitem)
       else if (is_smime && !opt.enable_smime)
         {
           /* SMIME is disabled remove our categories. */
-          mail->remove_categories ();
+          mail->removeCategories_o ();
         }
     }
 
diff --git a/src/ribbon-callbacks.cpp b/src/ribbon-callbacks.cpp
index 87ceab6..c38dd55 100644
--- a/src/ribbon-callbacks.cpp
+++ b/src/ribbon-callbacks.cpp
@@ -210,13 +210,13 @@ mark_mime_action (LPDISPATCH ctrl, int flags, bool is_explorer)
   Mail *mail = nullptr;
   if (uid)
     {
-      mail = Mail::get_mail_for_uuid (uid);
+      mail = Mail::getMailForUUID (uid);
       xfree (uid);
     }
 
   if (mail)
     {
-      mail->set_crypto_selected_manually (true);
+      mail->setCryptoSelectedManually (true);
     }
   else
     {
@@ -260,7 +260,7 @@ mark_mime_action (LPDISPATCH ctrl, int flags, bool is_explorer)
 
   if (newflags & 1)
     {
-      Mail::locate_all_crypto_recipients ();
+      Mail::locateAllCryptoRecipients_o ();
     }
 
   return S_OK;
@@ -485,7 +485,7 @@ get_mail_from_control (LPDISPATCH ctrl, bool *none_selected)
         }
     }
 
-  auto ret = Mail::get_mail_for_uuid (uid);
+  auto ret = Mail::getMailForUUID (uid);
   xfree (uid);
   if (!ret)
     {
@@ -544,7 +544,7 @@ HRESULT get_sig_label (LPDISPATCH ctrl, VARIANT *result)
       xfree (w_result);
       return S_OK;
     }
-  w_result = utf8_to_wchar (mail->get_crypto_summary ().c_str ());
+  w_result = utf8_to_wchar (mail->getCryptoSummary ().c_str ());
   result->bstrVal = SysAllocString (w_result);
   xfree (w_result);
   return S_OK;
@@ -558,7 +558,7 @@ HRESULT get_sig_ttip (LPDISPATCH ctrl, VARIANT *result)
   wchar_t *w_result;
   if (mail)
     {
-      w_result = utf8_to_wchar (mail->get_crypto_one_line().c_str());
+      w_result = utf8_to_wchar (mail->getCryptoOneLine ().c_str());
     }
   else if (!none_selected)
     {
@@ -583,7 +583,7 @@ HRESULT get_sig_stip (LPDISPATCH ctrl, VARIANT *result)
       result->bstrVal = SysAllocString (L"");
       return S_OK;
     }
-  if (!mail || !mail->is_crypto_mail ())
+  if (!mail || !mail->isCryptoMail ())
     {
       wchar_t *w_result;
       w_result = utf8_to_wchar (utf8_gettext ("You cannot be sure who sent, "
@@ -593,7 +593,7 @@ HRESULT get_sig_stip (LPDISPATCH ctrl, VARIANT *result)
       xfree (w_result);
       return S_OK;
     }
-  const auto message = mail->get_crypto_details ();
+  const auto message = mail->getCryptoDetails_o ();
   wchar_t *w_message = utf8_to_wchar (message.c_str());
   result->bstrVal = SysAllocString (w_message);
   xfree (w_message);
@@ -604,14 +604,14 @@ HRESULT launch_cert_details (LPDISPATCH ctrl)
 {
   MY_MAIL_GETTER
 
-  if (!mail || (!mail->is_signed () && !mail->is_encrypted ()))
+  if (!mail || (!mail->isSigned () && !mail->isEncrypted ()))
     {
       ShellExecuteA(NULL, NULL, "https://emailselfdefense.fsf.org/infographic",
                     0, 0, SW_SHOWNORMAL);
       return S_OK;
     }
 
-  if (!mail->is_signed () && mail->is_encrypted ())
+  if (!mail->isSigned () && mail->isEncrypted ())
     {
       /* Encrypt only, no information but show something. because
          we want the button to be active.
@@ -625,18 +625,18 @@ HRESULT launch_cert_details (LPDISPATCH ctrl)
       char * buf;
       gpgrt_asprintf (&buf, _("The message was not cryptographically signed.\n"
                       "There is no additional information available if it "
-                      "was actually sent by '%s' or if someone faked the sender address."), mail->get_sender ().c_str());
+                      "was actually sent by '%s' or if someone faked the sender address."), mail->getSender_o ().c_str());
       MessageBox (NULL, buf, _("GpgOL"),
                   MB_ICONINFORMATION|MB_OK);
       xfree (buf);
       return S_OK;
     }
 
-  if (!mail->get_sig_fpr())
+  if (!mail->getSigFpr ())
     {
       std::string buf = _("There was an error verifying the signature.\n"
                            "Full details:\n");
-      buf += mail->get_verification_result_dump();
+      buf += mail->getVerificationResultDump ();
       gpgol_message_box (get_active_hwnd(), buf.c_str(), _("GpgOL"), MB_OK);
     }
 
@@ -662,7 +662,7 @@ HRESULT launch_cert_details (LPDISPATCH ctrl)
             std::string parentWid = std::to_string ((int) (intptr_t) get_active_hwnd ());
             const char *argv[] = {path.c_str(),
                                   "--query",
-                                  mail->get_sig_fpr(),
+                                  mail->getSigFpr (),
                                   "--parent-windowid",
                                   parentWid.c_str(),
                                   NULL };
@@ -701,7 +701,7 @@ HRESULT get_crypto_icon (LPDISPATCH ctrl, VARIANT *result)
 
   if (mail)
     {
-      return getIcon (mail->get_crypto_icon_id (), result);
+      return getIcon (mail->getCryptoIconID (), result);
     }
   return getIcon (IDI_LEVEL_0, result);
 }
@@ -712,7 +712,7 @@ HRESULT get_is_crypto_mail (LPDISPATCH ctrl, VARIANT *result)
 
   result->vt = VT_BOOL | VT_BYREF;
   result->pboolVal = (VARIANT_BOOL*) xmalloc (sizeof (VARIANT_BOOL));
-  *(result->pboolVal) = (mail && (mail->is_signed () || mail->is_encrypted ())) ?
+  *(result->pboolVal) = (mail && (mail->isSigned () || mail->isEncrypted ())) ?
                           VARIANT_TRUE : VARIANT_FALSE;
 
   return S_OK;
diff --git a/src/windowmessages.cpp b/src/windowmessages.cpp
index 082dfa8..787f435 100644
--- a/src/windowmessages.cpp
+++ b/src/windowmessages.cpp
@@ -47,7 +47,7 @@ gpgol_window_proc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
           case (PARSING_DONE):
             {
               auto mail = (Mail*) ctx->data;
-              if (!Mail::is_valid_ptr (mail))
+              if (!Mail::isValidPtr (mail))
                 {
                   log_debug ("%s:%s: Parsing done for mail which is gone.",
                              SRCNAME, __func__);
@@ -59,26 +59,26 @@ gpgol_window_proc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
           case (RECIPIENT_ADDED):
             {
               auto mail = (Mail*) ctx->data;
-              if (!Mail::is_valid_ptr (mail))
+              if (!Mail::isValidPtr (mail))
                 {
                   log_debug ("%s:%s: Recipient add for mail which is gone.",
                              SRCNAME, __func__);
                   break;
                 }
-              mail->locate_keys();
+              mail->locateKeys_o ();
               break;
             }
           case (REVERT_MAIL):
             {
               auto mail = (Mail*) ctx->data;
-              if (!Mail::is_valid_ptr (mail))
+              if (!Mail::isValidPtr (mail))
                 {
                   log_debug ("%s:%s: Revert mail for mail which is gone.",
                              SRCNAME, __func__);
                   break;
                 }
 
-              mail->set_needs_save (true);
+              mail->setNeedsSave (true);
               /* Some magic here. Accessing any existing inline body cements
                  it. Otherwise updating the body through the revert also changes
                  the body of a inline mail. */
@@ -91,7 +91,7 @@ gpgol_window_proc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
               invoke_oom_method (mail->item (), "Save", NULL);
               log_debug ("%s:%s: Revert mail. Save done. Updating body..",
                          SRCNAME, __func__);
-              mail->update_body ();
+              mail->updateBody_o ();
               log_debug ("%s:%s: Revert mail done.",
                          SRCNAME, __func__);
               break;
@@ -109,13 +109,13 @@ gpgol_window_proc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
             {
               log_debug ("%s:%s: Invalidating last mail",
                          SRCNAME, __func__);
-              Mail::invalidate_last_mail ();
+              Mail::clearLastMail ();
               break;
             }
           case (CLOSE):
             {
               auto mail = (Mail*) ctx->data;
-              if (!Mail::is_valid_ptr (mail))
+              if (!Mail::isValidPtr (mail))
                 {
                   log_debug ("%s:%s: Close for mail which is gone.",
                              SRCNAME, __func__);
@@ -127,21 +127,21 @@ gpgol_window_proc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
           case (CRYPTO_DONE):
             {
               auto mail = (Mail*) ctx->data;
-              if (!Mail::is_valid_ptr (mail))
+              if (!Mail::isValidPtr (mail))
                 {
                   log_debug ("%s:%s: Crypto done for mail which is gone.",
                              SRCNAME, __func__);
                   break;
                 }
               // modify the mail.
-              if (mail->crypt_state () == Mail::NeedsUpdateInOOM)
+              if (mail->cryptState () == Mail::NeedsUpdateInOOM)
                 {
                   // Save the Mail
                   log_debug ("%s:%s: Crypto done for %p updating oom.",
                              SRCNAME, __func__, mail);
-                  mail->update_crypt_oom();
+                  mail->updateCryptOOM_o ();
                 }
-              if (mail->crypt_state () == Mail::NeedsSecondAfterWrite)
+              if (mail->cryptState () == Mail::NeedsSecondAfterWrite)
                 {
                   invoke_oom_method (mail->item (), "Save", NULL);
                   log_debug ("%s:%s: Second save done for %p Invoking second send.",
@@ -185,38 +185,38 @@ gpgol_window_proc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
           case (CLEAR_REPLY_FORWARD):
             {
               auto mail = (Mail*) ctx->data;
-              if (!Mail::is_valid_ptr (mail))
+              if (!Mail::isValidPtr (mail))
                 {
                   log_debug ("%s:%s: Clear reply forward for mail which is gone.",
                              SRCNAME, __func__);
                   break;
                 }
-              mail->wipe (true);
-              mail->remove_all_attachments ();
+              mail->wipe_o (true);
+              mail->removeAllAttachments_o ();
               break;
             }
           case (DO_AUTO_SECURE):
             {
               auto mail = (Mail*) ctx->data;
-              if (!Mail::is_valid_ptr (mail))
+              if (!Mail::isValidPtr (mail))
                 {
                   log_debug ("%s:%s: DO_AUTO_SECURE for mail which is gone.",
                              SRCNAME, __func__);
                   break;
                 }
-              mail->set_do_autosecure_mapi (true);
+              mail->setDoAutosecure_m (true);
               break;
             }
           case (DONT_AUTO_SECURE):
             {
               auto mail = (Mail*) ctx->data;
-              if (!Mail::is_valid_ptr (mail))
+              if (!Mail::isValidPtr (mail))
                 {
                   log_debug ("%s:%s: DO_AUTO_SECURE for mail which is gone.",
                              SRCNAME, __func__);
                   break;
                 }
-              mail->set_do_autosecure_mapi (false);
+              mail->setDoAutosecure_m (false);
               break;
             }
           default:
@@ -368,7 +368,7 @@ gpgol_hook(int code, WPARAM wParam, LPARAM lParam)
                 log_debug ("%s:%s: WM_CLOSE windowmessage for explorer. "
                            "Closing all mails.",
                            SRCNAME, __func__);
-                Mail::close_all_mails();
+                Mail::closeAllMails_o ();
                 break;
               }
           }
@@ -382,7 +382,7 @@ gpgol_hook(int code, WPARAM wParam, LPARAM lParam)
         {
           log_debug ("%s:%s: SC_CLOSE syscommand. Closing all mails.",
                      SRCNAME, __func__);
-          Mail::close_all_mails();
+          Mail::closeAllMails_o ();
         } */
        break;
      default:
diff --git a/src/wks-helper.cpp b/src/wks-helper.cpp
index 52c05c1..9799576 100644
--- a/src/wks-helper.cpp
+++ b/src/wks-helper.cpp
@@ -621,16 +621,16 @@ WKSHelper::send_mail (const std::string &mimeData) const
      a different value then the one with which we saw the ItemLoad
      event. But we want to get the mail object. So,.. surpise
      a Hack! :-) */
-  auto last_mail = Mail::get_last_mail ();
+  auto last_mail = Mail::getLastMail ();
 
-  if (!Mail::is_valid_ptr (last_mail))
+  if (!Mail::isValidPtr (last_mail))
     {
       log_error ("%s:%s: Invalid last mail %p.",
                  SRCNAME, __func__, last_mail);
       return -1;
     }
-  last_mail->set_override_mime_data (mimeData);
-  last_mail->set_crypt_state (Mail::NeedsSecondAfterWrite);
+  last_mail->setOverrideMIMEData (mimeData);
+  last_mail->setCryptState (Mail::NeedsSecondAfterWrite);
 
   if (invoke_oom_method (mail, "Save", nullptr))
     {
@@ -760,7 +760,7 @@ WKSHelper::handle_confirmation_notify (const std::string &mbox) const
                         _("GpgOL: Request confirmed!"), MB_OK);
    }
 
-  if (mail && Mail::is_valid_ptr (mail))
+  if (mail && Mail::isValidPtr (mail))
     {
       invoke_oom_method (mail->item(), "Delete", nullptr);
     }
@@ -782,7 +782,7 @@ WKSHelper::handle_confirmation_read (Mail *mail, LPSTREAM stream) const
     }
 
   /* Get the recipient of the confirmation mail */
-  char **recipients = mail->get_recipients ();
+  char **recipients = mail->getRecipients_o ();
 
   /* We assert that we have one recipient as the mail should have been
      sent by the wks-server. */

commit b0d80b45053d6c705377f26a5eff95e34f4070ff
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Jun 21 14:34:21 2018 +0200

    Constify some calls
    
    --

diff --git a/src/mail.cpp b/src/mail.cpp
index f2be77c..e817b1e 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -1576,7 +1576,7 @@ Mail::get_sender ()
 }
 
 std::string
-Mail::get_cached_sender ()
+Mail::get_cached_sender () const
 {
   return m_sender;
 }
@@ -1963,7 +1963,7 @@ Mail::update_sigstate ()
 }
 
 bool
-Mail::is_valid_sig ()
+Mail::is_valid_sig () const
 {
    return m_is_valid;
 }
@@ -2227,7 +2227,7 @@ level_4_check (const UserID &uid)
 }
 
 std::string
-Mail::get_crypto_summary ()
+Mail::get_crypto_summary () const
 {
   const int level = get_signature_level ();
 
@@ -2273,7 +2273,7 @@ Mail::get_crypto_summary ()
 }
 
 std::string
-Mail::get_crypto_one_line()
+Mail::get_crypto_one_line() const
 {
   bool sig = is_signed ();
   bool enc = is_encrypted ();
diff --git a/src/mail.h b/src/mail.h
index 19f9859..7190306 100644
--- a/src/mail.h
+++ b/src/mail.h
@@ -197,6 +197,19 @@ public:
     */
   static int close_all_mails ();
 
+  /** @brief closes the inspector for a mail
+    *
+    * @returns true on success.
+  */
+  static int close_inspector (Mail *mail);
+
+  /** Call close with discard changes to discard
+      plaintext. returns the value of the oom close
+      call. This may have delete the mail if the close
+      triggers an unload.
+  */
+  static int close (Mail *mail);
+
   /** @brief locate recipients for all crypto mails
     *
     * To avoid lookups of recipients for non crypto mails we only
@@ -238,7 +251,7 @@ public:
   int encrypt_sign_start ();
 
   /** @brief Necessary crypto operations were completed successfully. */
-  bool crypto_successful () { return !needs_crypto() || m_crypt_successful; }
+  bool crypto_successful () { return m_crypt_successful || !needs_crypto(); }
 
   /** @brief Message should be encrypted and or signed.
     0: No
@@ -286,7 +299,7 @@ public:
    * Like get_sender but ensures not to touch oom or mapi
    *
    * @returns A reference to the utf8 sender address. Or an empty string. */
-  std::string get_cached_sender ();
+  std::string get_cached_sender () const;
 
   /** @brief get the subject string (UTF-8 encoded).
     *
@@ -318,12 +331,6 @@ public:
     */
   bool is_smime ();
 
-  /** @brief closes the inspector for a mail
-    *
-    * @returns true on success.
-  */
-  static int close_inspector (Mail *mail);
-
   /** @brief get the associated parser.
     only valid while the actual parsing happens. */
   std::shared_ptr<ParseController> parser () { return m_parser; }
@@ -348,7 +355,7 @@ public:
   bool is_encrypted () const;
 
   /** Are we "green" */
-  bool is_valid_sig ();
+  bool is_valid_sig () const;
 
   /** Get UID gets UniqueID property of this mail. Returns
     an empty string if the uid was not set with set uid.*/
@@ -361,7 +368,7 @@ public:
 
   /** Returns a localized string describing in one or two
     words the crypto status of this mail. */
-  std::string get_crypto_summary ();
+  std::string get_crypto_summary () const;
 
   /** Returns a localized string describing the detailed
     crypto state of this mail. */
@@ -369,7 +376,7 @@ public:
 
   /** Returns a localized string describing a one line
     summary of the crypto state. */
-  std::string get_crypto_one_line ();
+  std::string get_crypto_one_line () const;
 
   /** Get the icon id of the appropiate icon for this mail */
   int get_crypto_icon_id () const;
@@ -392,13 +399,6 @@ public:
       by the caller. */
   char ** get_recipients () const;
 
-  /** Call close with discard changes to discard
-      plaintext. returns the value of the oom close
-      call. This may have delete the mail if the close
-      triggers an unload.
-  */
-  static int close (Mail *mail);
-
   /** Try to locate the keys for all recipients */
   void locate_keys();
 

commit f8a13fcbfcbf2b04f9763621d0917b4f402b5670
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Jun 21 14:28:26 2018 +0200

    Introduce naming conventions
    
    * src/mail.h: Add comment explaining naming convetions and
    explain window message and OOM interaction.

diff --git a/src/mail.h b/src/mail.h
index afd8d09..19f9859 100644
--- a/src/mail.h
+++ b/src/mail.h
@@ -44,6 +44,42 @@ class CryptController;
  *
  * This class bundles such information and also provides a way to
  * access the event handler of a mail.
+ *
+ * Naming conventions of the suffixes:
+ *  _o functions that work on OOM and possibly also MAPI.
+ *  _m functions that work on MAPI.
+ *  _s functions that only work on internal data and are safe to call
+ *     from any thread.
+ *
+ * O and M functions _must_ only be called from the main thread. Use
+ * a WindowMessage to signal the Main thread. But be wary. A WindowMessage
+ * might be handled while an OOM call in the main thread waits for completion.
+ *
+ * An example for this is how update_oom_data can work:
+ *
+ * Main Thread:
+ *   call update_oom_data
+ *    └> internally invokes an OOM function that might do network access e.g.
+ *       to connect to the exchange server to fetch the address.
+ *
+ *   Counterintutively the Main thread does not return from that function or
+ *   blocks for it's completion but handles windowmessages.
+ *
+ *   After a windowmessage was handled and if the OOM invocation is
+ *   completed the invocation returns and normal execution continues.
+ *
+ *   So if the window message handler's includes for example
+ *   also a call to lookup recipients we crash. Note that it's usually
+ *   safe to do OOM / MAPI calls from a window message.
+ *
+ *
+ * While this seems impossible, remember that we do not work directly
+ * with functions but everything is handled through COM. Without this
+ * logic Outlook would probably become unusable because as any long running
+ * call to the OOM would block it completely and freeze the UI.
+ * (no windowmessages handled).
+ *
+ * So be wary when accessing the OOM from a Window Message.
  */
 class Mail
 {

-----------------------------------------------------------------------

Summary of changes:
 src/cryptcontroller.cpp  |  40 +++---
 src/gpgoladdin.cpp       |   2 +-
 src/keycache.cpp         |  20 +--
 src/mail.cpp             | 312 +++++++++++++++++++++++------------------------
 src/mail.h               | 234 ++++++++++++++++++++---------------
 src/mailitem-events.cpp  | 122 +++++++++---------
 src/mimedataprovider.cpp |   4 +-
 src/mimemaker.cpp        |   8 +-
 src/parsecontroller.cpp  |   8 +-
 src/parsecontroller.h    |   4 +-
 src/revert.cpp           |   6 +-
 src/ribbon-callbacks.cpp |  32 ++---
 src/windowmessages.cpp   |  42 +++----
 src/wks-helper.cpp       |  12 +-
 14 files changed, 441 insertions(+), 405 deletions(-)


hooks/post-receive
-- 
GnuPG extension for MS Outlook
http://git.gnupg.org




More information about the Gnupg-commits mailing list