+2001-01-20 Simon Josefsson <sj@extundo.com>
+
+ * mm-decode.el (mm-handle-multipart-from): Add.
+ (mm-dissect-buffer): Save From: header value.
+ (mm-security-from): Remove.
+ (mm-possibly-verify-or-decrypt): Don't set mm-security-from.
+
+ * mml-smime.el (mml-smime-verify): Use `mm-handle-multipart-from'
+ instead of `mml-security-from'. Protect null from value.
+
2001-01-20 Simon Josefsson <sj@extundo.com>
* mailcap.el (mailcap-mime-data): Run `gnumeric' on
`(nth 7 ,handle))
(defmacro mm-handle-multipart-original-buffer (handle)
`(get-text-property 0 'buffer (car ,handle)))
+(defmacro mm-handle-multipart-from (handle)
+ `(get-text-property 0 'from (car ,handle)))
(defmacro mm-handle-multipart-ctl-parameter (handle parameter)
`(get-text-property 0 ,parameter (car ,handle)))
(defun mm-dissect-buffer (&optional no-strict-mime)
"Dissect the current buffer and return a list of MIME handles."
(save-excursion
- (let (ct ctl type subtype cte cd description id result)
+ (let (ct ctl type subtype cte cd description id result from)
(save-restriction
(mail-narrow-to-head)
(when (or no-strict-mime
cte (mail-fetch-field "content-transfer-encoding")
cd (mail-fetch-field "content-disposition")
description (mail-fetch-field "content-description")
+ from (cadr (mail-extract-address-components
+ (or (mail-fetch-field "from") "")))
id (mail-fetch-field "content-id"))))
(when cte
(setq cte (mail-header-strip cte)))
(add-text-properties 0 (length (car ctl))
(list 'buffer (mm-copy-to-buffer))
(car ctl))
+ (add-text-properties 0 (length (car ctl))
+ (list 'from from)
+ (car ctl))
(cons (car ctl) (mm-dissect-multipart ctl))))
(t
(mm-dissect-singlepart
result))
(defvar mm-security-handle nil)
-(defvar mm-security-from nil)
(defsubst mm-set-handle-multipart-parameter (handle parameter value)
;; HANDLE could be a CTL.
(defun mm-possibly-verify-or-decrypt (parts ctl)
(let ((subtype (cadr (split-string (car ctl) "/")))
(mm-security-handle ctl) ;; (car CTL) is the type.
- (mm-security-from
- (save-restriction
- (mail-narrow-to-head)
- (cadr (mail-extract-address-components
- (or (mail-fetch-field "from") "")))))
protocol func functest)
(cond
((equal subtype "signed")
(point-min) (point)) addresses)))
(delete-region (point-min) (point)))
(setq addresses (mapcar 'downcase addresses))))
- (if (not (member (downcase mm-security-from) addresses))
+ (if (not (member (downcase (or (mm-handle-multipart-from ctl) "")) addresses))
(mm-set-handle-multipart-parameter
mm-security-handle 'gnus-info "Sender address forged")
(if good-certificate
mm-security-handle 'gnus-info "Integrity OK (sender unknown)")))
(mm-set-handle-multipart-parameter
mm-security-handle 'gnus-details
- (concat "Sender clamed to be: " mm-security-from "\n"
+ (concat "Sender clamed to be: " (mm-handle-multipart-from ctl) "\n"
(if addresses
(concat "Addresses in certificate: "
(mapconcat 'identity addresses ", "))