* gnus.texi (Posting Styles): Mention X-Message-SMTP-Method.
[gnus] / lisp / mm-archive.el
index d8f47df..43a951e 100644 (file)
@@ -24,6 +24,7 @@
 
 (defvar mm-archive-decoders
   '(("application/ms-tnef" "tnef" "-f" "-" "-C")
+    ("application/zip" "unzip" "-j" "-x" "%f" "-d")
     ("application/x-gtar-compressed" "tar" "xzf" "-" "-C")
     ("application/x-tar" "tar" "xf" "-" "-C")))
 
        (progn
          (mm-with-unibyte-buffer
            (mm-insert-part handle)
-           (apply 'call-process-region (point-min) (point-max) (car decoder)
-                  nil (get-buffer-create "*tnef*")
-                  nil (append (cdr decoder) (list dir))))
+           (if (member "%f" decoder)
+               (let ((file (expand-file-name "mail.zip" dir)))
+                 (write-region (point-min) (point-max) file nil 'silent)
+                 (setq decoder (copy-sequence decoder))
+                 (setcar (member "%f" decoder) file)
+                 (apply 'call-process (car decoder) nil nil nil
+                        (append (cdr decoder) (list dir)))
+                 (delete-file file))
+             (apply 'call-process-region (point-min) (point-max) (car decoder)
+                    nil (get-buffer-create "*tnef*")
+                    nil (append (cdr decoder) (list dir)))))
          `("multipart/mixed"
            ,handle
            ,@(mm-archive-list-files (gnus-recursive-directory-files dir))))
@@ -60,7 +69,7 @@
                "attachment"))
        (insert (format "Content-type: %s\n" type))
        (insert "Content-Transfer-Encoding: 8bit\n\n")
-       (insert-file-contents (expand-file-name file dir))
+       (insert-file-contents file)
        (push
         (mm-make-handle (mm-copy-to-buffer)
                         (list type)