[Mew-dist 16875] s/mime content disposition
Ryutaroh Matsumoto
ryutaroh at example.com
2001年 3月 17日 (土) 21:43:56 JST
S/MIMEの署名で
Content-Disposition: attachment; filename="smime.p7s"
となっているべきところが
Content-Description: attachment; filename="smime.p7s"
なっていることに気づいたので修正するパッチを作りました。よかったら次の
ベータリリースに入れてください。
Mew本体への変更点として、Content-Dispositionに入れるファイル名から常に
ディレクトリ名を取り除くようにmew-syntax-cdp-formatを修正しています。
またmew-encode-syntax-singleでオプショナルな引数ctlが指定されていると
きは局所変数ctをctlから持ってきたほうがいいような気がします。
松本 隆太郎
-------------- next part --------------
diff -ru mew-1.95b113/mew-encode.el mew-1.95b113-cdp/mew-encode.el
--- mew-1.95b113/mew-encode.el Fri Mar 9 11:07:58 2001
+++ mew-1.95b113-cdp/mew-encode.el Sat Mar 17 20:46:50 2001
@@ -749,7 +749,7 @@
(let* ((boundary (mew-security-multipart-boundary depth))
(switch mew-encode-multipart-signed-switch) ;; save length
(func (mew-encode-get-security-func proto switch))
- file1 file2 micalg cte2 fmc errmsg ct2 cd2)
+ file1 file2 micalg cte2 fmc errmsg ct2 cdp2)
(setq file1 (mew-save-transfer-form (point-min) (point-max) 'retain))
;; The narrowed region still the ORIGINAL part (i.e. line breaks are LF)
;; Call the protocol function
@@ -762,7 +762,7 @@
mew-ct-mls mew-temp-dir))))
(setq file2 (nth 0 fmc) cte2 (nth 1 fmc) micalg (nth 2 fmc))
(setq errmsg (nth 3 fmc))
- (setq ct2 (nth 4 fmc) cd2 (nth 5 fmc))
+ (setq ct2 (nth 4 fmc) cdp2 (nth 5 fmc))
(if errmsg
(progn
(if (file-exists-p file1) (delete-file file1))
@@ -782,7 +782,7 @@
;; After the sigend part
(insert (format "\n--%s\n" boundary))
(mew-encode-singlepart
- (mew-encode-syntax-single file2 (or ct2 (list proto)) cte2 cd2))
+ (mew-encode-syntax-single file2 (or ct2 (list proto)) cte2 nil nil cdp2))
(insert (format "\n--%s--\n" boundary))
;; Throw away the garbage
(if (file-exists-p file1) (delete-file file1))
diff -ru mew-1.95b113/mew-smime.el mew-1.95b113-cdp/mew-smime.el
--- mew-1.95b113/mew-smime.el Sun Mar 4 21:35:07 2001
+++ mew-1.95b113-cdp/mew-smime.el Sat Mar 17 21:02:25 2001
@@ -61,6 +61,8 @@
(defconst mew-smime-passtag "S/MIME")
+(defconst mew-smime-signature-filename "smime.p7s")
+
;; The following variables are used only in the variable
;; mew-decode-multipart-signed-switch in mew-decode.el.
(defvar mew-smime-ver 0)
@@ -96,7 +98,7 @@
(setq mew-smime-running 'signing)
(let ((process-connection-type mew-connection-type2)
file2 process)
- (setq file2 (mew-make-temp-name))
+ (setq file2 (mew-make-temp-name mew-smime-signature-filename))
;; not perfectly unique but OK
(setq process
(mew-start-process-lang
@@ -120,8 +122,8 @@
(discard-input)))
(message "S/MIME signing ... done")
(list file2 mew-b64 "sha1" mew-smime-sign-error
- (list "application/x-pkcs7-signature" (list "name" "smime.p7s"))
- (list "attachment" (list "filename" "smime.p7s"))))));; return
+ (list "application/x-pkcs7-signature" (list "name" mew-smime-signature-filename))
+ t))));; return
(defun mew-smime-verify (file1 file2)
(message "S/MIME verifying ... ")
diff -ru mew-1.95b113/mew-syntax.el mew-1.95b113-cdp/mew-syntax.el
--- mew-1.95b113/mew-syntax.el Sun Mar 4 13:30:37 2001
+++ mew-1.95b113-cdp/mew-syntax.el Sat Mar 17 21:30:12 2001
@@ -149,7 +149,8 @@
(defun mew-syntax-cdp-format (file ct)
(when file
- (setq file (mew-header-sanity-check-string file))
+ (setq file (file-name-nondirectory (mew-header-sanity-check-string file)))
+ (princ mew-content-disposition-inline-list)
(if (mew-member-case-equal ct mew-content-disposition-inline-list)
(list "inline" (list "filename" file))
(list "attachment" (list "filename" file)))))
diff -ru mew-1.95b113/mew-vars2.el mew-1.95b113-cdp/mew-vars2.el
--- mew-1.95b113/mew-vars2.el Tue Mar 13 01:48:49 2001
+++ mew-1.95b113-cdp/mew-vars2.el Sat Mar 17 21:28:47 2001
@@ -326,6 +326,8 @@
mew-prog-mspowerpoint mew-icon-text)
("application/pgp-keys" "\\.pka$" nil
mew-prog-pgp-keys mew-icon-unknown)
+ ("application/x-pkcs7-signature" "\\.p7s$" mew-b64
+ nil mew-icon-unknown)
("application/octet-stream"
"\\.tar$\\|\\.tar\\.gz$\\|\\.tgz$\\|\\.gz$\\|\\.Z$\\|\\.taz$\\|\\.tar\\.bz2?$\\|\\.bz2?$\\|\\.lzh$\\|\\.zip$\\|\\.bin$\\|\\.pgp$|\\.gpg$"
mew-b64 mew-prog-octet-stream mew-icon-application/octet-stream)
-------------- next part --------------
テキスト形式以外の添付ファイルを保管しました...
ファイル名: smime.p7s
型: application/x-pkcs7-signature
サイズ: 3207 バイト
説明: 無し
URL: <http://www.mew.org/pipermail/mew-dist/attachments/20010317/56bdcb12/attachment.bin>
Mew-dist メーリングリストの案内