RFC3156 (MIME Security with OpenPGP)

TAKAHASHI Kaoru <[email protected]> Sun, 13 Nov 2005 12:53:26 +0900
Newsgroups gmane.mail.emacs.mime.japanese
Message-ID <rrpveyxdwzt%[email protected]>
高橋です。spam filter に食われたかもしれないので出し直します。

RFC3156 の

3.  Content-Transfer-Encoding restrictions
[snip]
   Additionally, implementations MUST make sure that no trailing
   whitespace is present after the MIME encoding has been applied.

に対応するように mime-edit.el を手元で変えてみました。
署名する部分の末尾の空白を取ります。

delete-trailing-whitespace() はおそらく portable でないので、ヘッダ
中に空白のみの行がある場合を考慮して、ほぼ同様の動作をする関数を用
意するのがいいかと思います。


mime-edit でやるべきか pgg でやるべきかはわかりませんが、とりあえず
mime-edit で簡単に対処してみました。

-- 
TAKAHASHI "beatmaria" Kaoru (高橋 郁) <[email protected]>
 志は気の師なり。気は体の充なり。
mime-edit.el.diff (application/octet-stream, 420 B)
Index: mime-edit.el
===================================================================
--- mime-edit.el	28 Oct 2004 07:25:04 -0000	1.8
+++ mime-edit.el	13 Nov 2005 03:45:16 -0000
@@ -1801,6 +1801,7 @@
 	     (encoding (nth 1 ret))
 	     (pgp-boundary (concat "pgp-sign-" boundary))
 	     micalg)
+	(delete-trailing-whitespace)	; RFC3156
 	(goto-char beg)
 	(insert (format "Content-Type: %s\n" ctype))
 	(if encoding