+2003-12-25 Jesper Harder <harder@ifa.au.dk>
+
+ * mml1991.el (mml1991-pgg-sign): Encode and decode according to
+ CTE header. Don't insert gpg output as unibyte.
+
2003-12-25 Katsumi Yamaoka <yamaoka@jpl.org>
* lpath.el: Remove display-time-event-handler and open-ssl-stream;
(defvar pgg-errors-buffer)
(defun mml1991-pgg-sign (cont)
- (let (headers)
+ (let (headers cte)
;; Don't sign headers.
(goto-char (point-min))
(while (not (looking-at "^$"))
(setq headers (buffer-substring (point-min) (point)))
(forward-line) ;; skip header/body separator
(delete-region (point-min) (point)))
- (quoted-printable-decode-region (point-min) (point-max))
+ (when (string-match "^Content-Transfer-Encoding: \\(.+\\)" headers)
+ (setq cte (intern (match-string 1 headers))))
+ (mm-decode-content-transfer-encoding cte)
(unless (let ((pgg-default-user-id
(or (message-options-get 'mml-sender)
pgg-default-user-id)))
(pop-to-buffer pgg-errors-buffer)
(error "Encrypt error"))
(delete-region (point-min) (point-max))
- (mm-with-unibyte-current-buffer
- (insert-buffer-substring pgg-output-buffer))
+ (insert-buffer-substring pgg-output-buffer)
(goto-char (point-min))
(while (re-search-forward "\r+$" nil t)
(replace-match "" t t))
- (quoted-printable-encode-region (point-min) (point-max))
+ (mm-encode-content-transfer-encoding cte)
(goto-char (point-min))
- (if headers (insert headers))
+ (when headers
+ (insert headers))
(insert "\n")
t))