I receive GnuPG-encrypted (and signed) e-mails through an MS Exchange server. Unfortunately, the exchange server messes up the GPG format, such that mu4e cannot decrypt correctly.
This is a known issue with MS Exchange servers. For instance, Thunderbird-Enigmail pops up a message, "do you want to repair this message", and offers to repair the message. This changes some MIME headers and contents, and then the e-mail can be decrypted correctly.
I wrote a small Python script, which makes similar changes to files containing e-mails in a Maildir directory, which is synced with an IMAP server via
Now, whenever I open an encrypted e-mail in mu4e that cannot be encrypted, I want to run the Python script on the corresponding file, and then re-load it. How can I do this in Emacs Lisp?
Or, is there any other, simple solution to mimic the behaviour of Thunderbird's Enigmail plugin to repair e-mails messed up by Exchange servers?