[Date Prev] [Date Index] [Date Next]
[Thread Prev] [Thread Index] [Thread Next]

[xyzzy:08572] ケータイに画像添付のための kamail-patch



ケータイで認識するmultipartのcontent-type のとこに、ちょっとクセがあるみたい
なので、修正してみました。
ソフトウェア工学的に美しくない、最小限度のpatchです。

改造しすぎて、ちゃんとdiffがとれない。。。

(defun kamail-add-attachments (attachments)
  (let* ((boundary (kamail-change-to-multipart))
	 (end-reg (format nil "^--~A--$" boundary)))
    (save-excursion
      (goto-char (point-min))
      (unless (scan-buffer end-reg :regexp t :tail nil)
	(error "Multipartの終わりがないっす: ~A" end-reg))
      (dolist (f (reverse attachments))
	(let* ((file (car f))
	       (filename (file-namestring file)))
	  (when file
	    (insert (format nil "--~A~%" boundary))
	    (setq beg (point))
-	    (insert (format nil "Content-Type: ~A ~%"
-			    (kamail-retrieve-content-type filename)))
+	    (insert (format nil "Content-Type: ~A ; name=\"~A\"~%"
+			    (kamail-retrieve-content-type filename) filename))
	    (insert (format nil "Content-Disposition: attachment;~% ~A~%"
			    (kamail-attachment-filename-string filename)))

以下略。

                       /*  OHKUBO KOHEI <kuboon@xxxxxxxxxxxxx>
                                         http://kuboon.fly.to/

Index Home