When I attempt to verify the mime attached signature of
a message in vm using mailcrypt I get the following
message:
Found no signed message in this buffer.
Manually removing the attachments and checking it from
the command line works.
I'm using:
GNU Emacs 20.7.2
Mailcrypt 3.5.6 (Debian package)
gpg 1.0.6
Logged In: NO
mailcrypt doesn't handle mime-attached signatures
Logged In: NO
I wrote this to deal with this problem.
It's my first lisp program, and odds are it will mess up
some mails (most noticably ones with multiple signatures,
for example if someone replies to something that has a
signature)
I have it as my rmail-show-message-hook, it seems to mostly
work.
There is absolutely no guarantee this will work, that this
will not hose your mailbox, or that it will not cause your
computer to explode.
(defun rjl-rfc2015 nil
"This allows rmail (or anything) to support rfc2015
signatures"
(interactive)
(let (
(buffer-read-only nil)
(inhibit-read-only t)
(boundstart nil)
(boundend nil)
(boundname nil)
(goopstart nil)
(goopend nil)
)
(if (and
(search-forward "Content-Type: multipart/signed;" nil t)
(search-forward "micalg=pgp-sha1;" nil t)
(search-forward "protocol=\"application/pgp-signature\";" nil t)
(re-search-forward
"boundary\=\"[\/\+a-zA-Z0-9][\/\+a-zA-Z0-9][\/\+a-zA-Z0-9][\/\+a-zA-Z0-9][\/\+a-zA-Z0-9][\/\+a-zA-Z0-9][\/\+a-zA-Z0-9][\/\+a-zA-Z0-9][\/\+a-zA-Z0-9][\/\+a-zA-Z0-9][\/\+a-zA-Z0-9][\/\+a-zA-Z0-9][\/\+a-zA-Z0-9][\/\+a-zA-Z0-9][\/\+a-zA-Z0-9][\/\+a-zA-Z0-9]\""
nil t)
(setq boundname (car (cdr (split-string (match-string 0)
"\""))))
)
(let ()
(search-forward (concat "--" boundname) nil t)
(replace-match
"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n" nil nil
nil nil)
(setq goopstart (- (search-forward (concat "--" boundname)
nil t)
(+ 2 (string-width boundname))))
(setq goopend (- (search-forward "-----BEGIN PGP
SIGNATURE-----" nil t)
(string-width "-----BEGIN PGP SIGNATURE-----")))
(kill-region goopstart goopend)
(search-forward (concat "--" boundname "--") nil t)
(replace-match "" nil nil nil nil)
(search-backward (concat "boundary=\"" boundname "\"") nil t)
(replace-match "" nil nil nil nil)
(while (re-search-forward "^-.*" nil t)
(if (not (or
(string-equal "-----BEGIN PGP SIGNED MESSAGE-----"
(match-string 0))
(string-equal "-----BEGIN PGP SIGNATURE-----"
(match-string 0))
(string-equal "-----END PGP SIGNATURE-----"
(match-string 0))
))
(replace-match (concat "- " (match-string 0)) nil nil nil nil))
)
(mc-verify)
)
)
))