- (oinfo (mime-article/rcnum-to-cinfo (cons onum rmcnum)
- mime::article/content-info))
- status str kbuf
- (basename (expand-file-name "tm" mime-temp-directory))
- (orig-file (make-temp-name basename))
- (sig-file (concat orig-file ".sig"))
- )
- (save-excursion
- (setq str (buffer-substring
- (mime::content-info/point-min oinfo)
- (mime::content-info/point-max oinfo)
- ))
- (set-buffer (get-buffer-create mime/temp-buffer-name))
- (insert str)
- (goto-char (point-min))
- (while (re-search-forward "\n" nil t)
- (replace-match "\r\n")
- )
- (as-binary-output-file (write-file orig-file))
- (kill-buffer (current-buffer))
- )
- (save-excursion
- (mime-article/show-output-buffer)
- )
- (save-excursion
- (setq str (buffer-substring
- (save-excursion
- (goto-char beg)
- (and (search-forward "\n\n")
- (match-end 0)))
- end))
- (set-buffer (setq kbuf (get-buffer-create mime/temp-buffer-name)))
- (insert str)
- (mime-decode-region (point-min)(point-max) encoding)
- (as-binary-output-file (write-file sig-file))
- (or (mime::article/call-pgp-to-check-signature
- mime/output-buffer-name orig-file)
- (let (pgp-id)
- (save-excursion
- (set-buffer mime/output-buffer-name)
- (goto-char (point-min))
- (let ((regexp (cdr (assq (or mime-pgp-default-language 'en)
- mime-pgp-key-expected-regexp-alist))))
- (cond ((not (stringp regexp))
- (message
- "Please specify right regexp for specified language")
- )
- ((re-search-forward regexp nil t)
- (setq pgp-id
- (concat "0x" (buffer-substring-no-properties
- (match-beginning 1)
- (match-end 1))))
- ))))
- (if (and pgp-id
- (y-or-n-p
- (format "Key %s not found; attempt to fetch? " pgp-id))
- )
- (progn
- (funcall (pgp-function 'fetch-key) (cons nil pgp-id))
- (mime::article/call-pgp-to-check-signature
- mime/output-buffer-name orig-file)
- ))
- ))
- (let ((other-window-scroll-buffer mime/output-buffer-name))
- (scroll-other-window 8)
- )
- (kill-buffer kbuf)
- (delete-file orig-file)
- (delete-file sig-file)
- )))
-
-(set-atype 'mime/content-decoding-condition
- '((type . "application/pgp-signature")
- (method . mime-article/check-pgp-signature)
- ))