[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnus PGP signature bug and fix
From: |
Max Froumentin |
Subject: |
gnus PGP signature bug and fix |
Date: |
Wed, 01 Feb 2006 14:01:29 +0000 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) |
Hi,
Gnus (latest CVS) generates wrong MIME encoded messages
when an inline PGP signature is included along with an attachment.
When a multipart message is sent, gnus builds a buffer by adding each
part sequentially, top to bottom. But there's a bug with the code that
generates inline signed parts: the point is not moved back to the bottom of
the buffer, and so the following parts are inserted at the wrong place.
A fix is simple: after each part is generated, move the point back to
the end. i.e, in mml.el, around line 590, where it iterates over each
part, inserting a separator between each part and at the end.
(let ((cont cont) part)
(while (setq part (pop cont))
;; Skip `multipart' and attributes.
(when (and (consp part) (consp (cdr part)))
(insert "\n--" mml-boundary "\n")
(mml-generate-mime-1 part))))
(insert "\n--" mml-boundary "--\n")))))
Just insert "(goto-char (point-max))" after the call to mml-generate-mime-1:
(let ((cont cont) part)
(while (setq part (pop cont))
;; Skip `multipart' and attributes.
(when (and (consp part) (consp (cdr part)))
(insert "\n--" mml-boundary "\n")
(mml-generate-mime-1 part)
(goto-char (point-max)))))
(insert "\n--" mml-boundary "--\n")))))
I've tried it on various messages containing various attachments and it
seems to do the trick. A diff against mml.el 7.40 is attached.
Max.
592,593c592
< (mml-generate-mime-1 part)
< (goto-char (point-max)))))
---
> (mml-generate-mime-1 part))))
- gnus PGP signature bug and fix,
Max Froumentin <=