+2001-07-29 Simon Josefsson <jas@extundo.com>
+
+ * mail-source.el (top-level): Require message for message-directory.
+ (mail-source-directory): Change default to message-directory.
+
+ * smime.el (smime-keys, smime-CA-directory, smime-CA-file)
+ (smime-certificate-directory, smime-openssl-program)
+ (smime-encrypt-cipher, smime-dns-server): Fix doc (leading "*").
+ (smime-extra-arguments): New variable.
+ (smime-dns-server): Fix customize group.
+ (smime-call-openssl-region): Use `smime-extra-arguments'.
+
+2001-07-29 Simon Josefsson <jas@extundo.com>
+ From Vladimir Volovich <vvv@vsu.ru>
+
+ * smime.el (smime-call-openssl-region): Ignore stderr.
+
+2001-07-29 Simon Josefsson <jas@extundo.com>
+ From Christoph Conrad <christoph.conrad@gmx.de>
+
+ * gnus-agent.el (gnus-agent-save-group-info): Don't destroy active
+ file.
+
+2001-07-29 Simon Josefsson <jas@extundo.com>
+
+ * mm-view.el (mm-view-pkcs7-decrypt): Adhere to `mm-decrypt-option'.
+
+ Support S/MIME decryption.
+
+ * mm-decode.el (mm-inline-media-tests):
+ (mm-inlined-types):
+ (mm-automatic-display):
+ (mm-attachment-override-types): Add application/{x-,}pkcs7-mime.
+
+ * mm-view.el (mm-pkcs7-signed-magic):
+ (mm-pkcs7-enveloped-magic): New variables.
+ (mm-view-pkcs7-get-type): New function; identify PKCS#7 type.
+ (mm-view-pkcs7): New function; mm viewer for PKCS#7 blobs.
+ (mm-view-pkcs7-decrypt): New function; mm viewer for encrypted
+ PKCS#7 blobs.
+
+ * smime.el (smime-decrypt-region): Expand keyfile.
+
+2001-07-29 Simon Josefsson <jas@extundo.com>
+
+ * nntp.el (nntp-open-ssl-stream): Don't mess with internal
+ `ssl.el' variables.
+
+ * gnus-agent.el (gnus-agent-save-group-info): Delete everything
+ but line instead of narrowing to it, because `nnmail-parse-active'
+ calls widen. Thanks to Christoph Conrad
+ <christoph.conrad@gmx.de>.
+
+2001-07-29 Kai Gro\e,A_\e(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
+
+ * gnus.el (gnus-summary-line-format): Mention `gnus-sum-thread-*'
+ for %B spec.
+
+ * gnus-sum.el (gnus-summary-prepare-threads): If
+ gnus-sum-thread-tree-root is nil, use subject instead.
+ (gnus-sum-thread-tree-root, gnus-sum-thread-tree-single-indent)
+ (gnus-sum-thread-tree-vertical, gnus-sum-thread-tree-indent)
+ (gnus-sum-thread-tree-leaf-with-other)
+ (gnus-sum-thread-tree-single-leaf): Documentation.
+ (gnus-sum-thread-tree-single-indent): Allow nil.
+
+2001-07-28 09:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * message.el (message-fill-paragraph): Do nothing if the user
+ wants filladapt-mode.
+
+2001-07-27 23:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * mm-decode.el (mm-image-type-from-buffer): New.
+ (mm-get-image): Use it.
+
+2001-07-27 18:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * gnus.el (gnus-large-newsgroup): If it is nil, ...
+
+ * gnus-art.el (gnus-mime-view-all-parts): buffer-read-only covers
+ mm-display-parts too.
+
+2001-07-27 12:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * nnfolder.el (nnfolder-request-accept-article): Bind
+ nntp-server-buffer.
+
+ * nnmail.el (nnmail-parse-active): Read from buffer instead of
+ nntp-server-buffer.
+
+2001-07-27 11:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * message.el (message-check-news-header-syntax): Use
+ message-post-method.
+ (message-send-news): Bind message-post-method.
+
+2001-07-27 07:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * mml.el (mml-tweak-type-alist): New.
+ (mml-tweak-function-alist): New.
+ (mml-tweak-part): New.
+ (mml-generate-mime-1): Use it.
+
2001-07-26 22:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
* nnfolder.el (nnfolder-request-accept-article): Replace
2001-06-03 Dale Hagglund <rdh@best.com>
- * gnus-mlspl.el (gnus-group-split-fancy): Fix generation of split
+ * gnus-mlspl.el (gnus-group-split-fancy): Fix generation of split
restrict clauses.
2001-06-07 16:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
(file-name-coding-system nnmail-pathname-coding-system)
(pathname-coding-system nnmail-pathname-coding-system)
(file (gnus-agent-lib-file "active"))
- oactive)
+ oactive-min)
(gnus-make-directory (file-name-directory file))
(with-temp-file file
(when (file-exists-p file)
(when (re-search-forward
(concat "^" (regexp-quote group) " ") nil t)
(save-excursion
- (save-restriction
- (narrow-to-region (match-beginning 0)
- (progn
- (forward-line 1)
- (point)))
- (setq oactive (car (nnmail-parse-active)))))
+ (read (current-buffer)) ;; max
+ (setq oactive-min (read (current-buffer)))) ;; min
(gnus-delete-line))
(insert (format "%S %d %d y\n" (intern group)
(cdr active)
- (or (car oactive) (car active))))
+ (or oactive-min (car active))))
(goto-char (point-max))
(while (search-backward "\\." nil t)
(delete-char 1))))))
(goto-char (point-min))
(or (search-forward "\n\n") (goto-char (point-max)))
(let (buffer-read-only)
- (delete-region (point) (point-max)))
- (mm-display-parts handles)))))
+ (delete-region (point) (point-max))
+ (mm-display-parts handles))))))
(defun gnus-mime-save-part-and-strip ()
"Save the MIME part under point then replace it with an external body."
(defvar gnus-tmp-thread-tree-header-string "")
-(defvar gnus-sum-thread-tree-root "> ")
-(defvar gnus-sum-thread-tree-single-indent "")
-(defvar gnus-sum-thread-tree-vertical "| ")
-(defvar gnus-sum-thread-tree-indent " ")
-(defvar gnus-sum-thread-tree-leaf-with-other "+-> ")
-(defvar gnus-sum-thread-tree-single-leaf "\\-> ")
+(defvar gnus-sum-thread-tree-root "> "
+ "With %B spec, used for the root of a thread.
+If nil, use subject instead.")
+(defvar gnus-sum-thread-tree-single-indent ""
+ "With %B spec, used for a thread with just one message.
+If nil, use subject instead.")
+(defvar gnus-sum-thread-tree-vertical "| "
+ "With %B spec, used for drawing a vertical line.")
+(defvar gnus-sum-thread-tree-indent " "
+ "With %B spec, used for indenting.")
+(defvar gnus-sum-thread-tree-leaf-with-other "+-> "
+ "With %B spec, used for a leaf with brothers.")
+(defvar gnus-sum-thread-tree-single-leaf "\\-> "
+ "With %B spec, used for a leaf without brothers.")
(defun gnus-summary-prepare-threads (threads)
"Prepare summary buffer from THREADS and indentation LEVEL.
((not gnus-show-threads) "")
((zerop gnus-tmp-level)
(if (cdar thread)
- gnus-sum-thread-tree-root
- gnus-sum-thread-tree-single-indent))
+ (or gnus-sum-thread-tree-root subject)
+ (or gnus-sum-thread-tree-single-indent subject)))
(t
(concat (apply 'concat
(mapcar (lambda (item)
(defcustom gnus-large-newsgroup 200
"*The number of articles which indicates a large newsgroup.
If the number of articles in a newsgroup is greater than this value,
-confirmation is required for selecting the newsgroup."
+confirmation is required for selecting the newsgroup.
+If it is `nil', no confirmation is required."
:group 'gnus-group-select
:type 'integer)
%L Number of lines in the article (integer)
%I Indentation based on thread level (a string of spaces)
%B A complex trn-style thread tree (string)
+ The variables `gnus-sum-thread-*' can be used for customization.
%T A string with two possible values: 80 spaces if the article
is on thread level two or larger and 0 spaces on level one
%R \"A\" if this article has been replied to, \" \" otherwise (character)
adaptive-fill-regexp babel-history babel-translations
default-enable-multibyte-characters
display-time-mail-function imap-password mail-mode-hook
+ filladapt-mode
mc-pgp-always-sign
nnoo-definition-alist
url-current-callback-func url-be-asynchronous
(autoload 'nnheader-cancel-timer "nnheader")
(autoload 'nnheader-run-at-time "nnheader"))
(require 'format-spec)
+(require 'message) ;; for `message-directory'
(defgroup mail-source nil
"The mail-fetching library."
:group 'mail-source
:type 'file)
-(defcustom mail-source-directory "~/Mail/"
+(defcustom mail-source-directory message-directory
"Directory where files (if any) will be stored."
:group 'mail-source
:type 'directory)
(defun message-fill-paragraph (&optional arg)
"Like `fill-paragraph'."
(interactive (list (if current-prefix-arg 'full)))
- (message-newline-and-reformat arg t)
- t)
+ (if (and (boundp 'filladapt-mode) filladapt-mode)
+ nil
+ (message-newline-and-reformat arg t)
+ t))
(defun message-insert-signature (&optional force)
"Insert a signature. See documentation for variable `message-signature'."
(cons '(valid-newsgroups . disabled)
message-syntax-checks)))
(message-cleanup-headers)
- (if (not (message-check-news-syntax))
+ (if (not (let ((message-post-method method))
+ (message-check-news-syntax)))
nil
(unwind-protect
(save-excursion
(known-groups
(mapcar (lambda (n) (gnus-group-real-name n))
(gnus-groups-from-server
- (cond ((equal gnus-post-method 'current)
- gnus-current-select-method)
- (gnus-post-method gnus-post-method)
- (t gnus-select-method)))))
+ (if (message-functionp message-post-method)
+ (funcall message-post-method)
+ message-post-method))))
errors)
(while groups
(unless (or (equal (car groups) "poster")
("application/pgp-signature" ignore identity)
("application/x-pkcs7-signature" ignore identity)
("application/pkcs7-signature" ignore identity)
+ ("application/x-pkcs7-mime" mm-view-pkcs7 identity)
+ ("application/pkcs7-mime" mm-view-pkcs7 identity)
("multipart/alternative" ignore identity)
("multipart/mixed" ignore identity)
("multipart/related" ignore identity)
'("image/.*" "text/.*" "message/delivery-status" "message/rfc822"
"message/partial" "message/external-body" "application/emacs-lisp"
"application/pgp-signature" "application/x-pkcs7-signature"
- "application/pkcs7-signature")
+ "application/pkcs7-signature" "application/x-pkcs7-mime"
+ "application/pkcs7-mime")
"List of media types that are to be displayed inline.
See also `mm-inline-media-tests', which says how to display a media
type inline."
"text/x-vcard" "image/.*" "message/delivery-status" "multipart/.*"
"message/rfc822" "text/x-patch" "application/pgp-signature"
"application/emacs-lisp" "application/x-pkcs7-signature"
- "application/pkcs7-signature")
+ "application/pkcs7-signature" "application/x-pkcs7-mime"
+ "application/pkcs7-mime")
"A list of MIME types to be displayed automatically."
:type '(repeat string)
:group 'mime-display)
-(defcustom mm-attachment-override-types '("text/x-vcard")
+(defcustom mm-attachment-override-types '("text/x-vcard"
+ "application/pkcs7-mime"
+ "application/x-pkcs7-mime")
"Types to have \"attachment\" ignored if they can be displayed inline."
:type '(repeat string)
:group 'mime-display)
"Return the handle(s) referred to by ID."
(cdr (assoc id mm-content-id-alist)))
+(defconst mm-image-type-regexps
+ '(("/\\*.*XPM.\\*/" . xpm)
+ ("P[1-6]" . pbm)
+ ("GIF8" . gif)
+ ("\377\330" . jpeg)
+ ("\211PNG\r\n" . png)
+ ("#define" . xbm)
+ ("\\(MM\0\\*\\)\\|\\(II\\*\0\\)" . tiff)
+ ("%!PS" . postscript))
+ "Alist of (REGEXP . IMAGE-TYPE) pairs used to auto-detect image types.
+When the first bytes of an image file match REGEXP, it is assumed to
+be of image type IMAGE-TYPE.")
+
+;; Steal from image.el. image-type-from-data suffers multi-line matching bug.
+(defun mm-image-type-from-buffer ()
+ "Determine the image type from data in the current buffer.
+Value is a symbol specifying the image type or nil if type cannot
+be determined."
+ (let ((types mm-image-type-regexps)
+ type)
+ (goto-char (point-min))
+ (while (and types (null type))
+ (let ((regexp (car (car types)))
+ (image-type (cdr (car types))))
+ (when (looking-at regexp)
+ (setq type image-type))
+ (setq types (cdr types))))
+ type))
+
(defun mm-get-image (handle)
"Return an image instance based on HANDLE."
(let ((type (mm-handle-media-subtype handle))
;; Avoid testing `make-glyph' since W3 may define
;; a bogus version of it.
(if (fboundp 'create-image)
- (or
- (create-image (buffer-string) nil 'data-p)
- (create-image (buffer-string) (intern type)
- 'data-p))
+ (create-image (buffer-string)
+ (or (mm-image-type-from-buffer)
+ (intern type))
+ 'data-p)
(cond
((equal type "xbm")
;; xbm images require special handling, since
(delete-file file)))))
(t
(make-glyph
- (vector (intern type) :data (buffer-string))))))))
+ (vector
+ (or (mm-image-type-from-buffer)
+ (intern type))
+ :data (buffer-string))))))))
(mm-handle-set-cache handle spec))))))
(defun mm-image-fit-p (handle)
(defun mm-display-elisp-inline (handle)
(mm-display-inline-fontify handle 'emacs-lisp-mode))
+;; id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
+;; us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 }
+(defvar mm-pkcs7-signed-magic
+ (mm-string-as-unibyte
+ (apply 'concat
+ (mapcar 'char-to-string
+ (list ?\x30 ?\x82 ?\x01 ?\x91 ?\x06 ?\x09 ?\x2a ?\x86 ?\x48
+ ?\x86 ?\xf7 ?\x0d ?\x01 ?\x07 ?\x02)))))
+
+;; id-envelopedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
+;; us(840) rsadsi(113549) pkcs(1) pkcs7(7) 3 }
+(defvar mm-pkcs7-enveloped-magic
+ (mm-string-as-unibyte
+ (apply 'concat
+ (mapcar 'char-to-string
+ (list ?\x30 ?\x82 ?\x01 ?\x91 ?\x06 ?\x09 ?\x2a ?\x86 ?\x48
+ ?\x86 ?\xf7 ?\x0d ?\x01 ?\x07 ?\x03)))))
+
+(defun mm-view-pkcs7-get-type (handle)
+ (with-temp-buffer
+ (mm-insert-part handle)
+ (cond ((looking-at (regexp-quote mm-pkcs7-enveloped-magic))
+ 'enveloped)
+ ((looking-at (regexp-quote mm-pkcs7-signed-magic))
+ 'signed)
+ (t
+ (error "Could not identify PKCS#7 type")))))
+
+(defun mm-view-pkcs7 (handle)
+ (case (mm-view-pkcs7-get-type handle)
+ (enveloped (mm-view-pkcs7-decrypt handle))
+ (otherwise (error "Unknown or unimplemented PKCS#7 type"))))
+
+(defun mm-view-pkcs7-decrypt (handle)
+ (if (cond
+ ((eq mm-decrypt-option 'never) nil)
+ ((eq mm-decrypt-option 'always) t)
+ ((eq mm-decrypt-option 'known) t)
+ (t (y-or-n-p
+ (format "Decrypt (S/MIME) part? "))))
+ (let (res)
+ (with-temp-buffer
+ (insert-buffer (mm-handle-buffer handle))
+ (goto-char (point-min))
+ (insert "MIME-Version: 1.0\n")
+ (mm-insert-headers "application/pkcs7-mime" "base64" "smime.p7m")
+ (smime-decrypt-region
+ (point-min) (point-max)
+ (if (= (length smime-keys) 1)
+ (cadar smime-keys)
+ (smime-get-key-by-email
+ (completing-read "Decrypt this part with which key? "
+ smime-keys nil nil
+ (and (listp (car-safe smime-keys))
+ (caar smime-keys))))))
+ (setq res (buffer-string)))
+ (mm-insert-inline handle res))))
+
(provide 'mm-view)
;;; mm-view.el ends here
:type '(repeat (symbol :tag "Parameter"))
:group 'message)
+(defvar mml-tweak-type-alist nil
+ "A list of (TYPE . FUNCTION) for tweaking MML parts.
+TYPE is a string containing a regexp to match the MIME type. FUNCTION
+is a Lisp function which is called with the MML handle to tweak the
+part. This variable is used only when no TWEAK parameter exists in
+the MML handle.")
+
+(defvar mml-tweak-function-alist nil
+ "A list of (NAME . FUNCTION) for tweaking MML parts.
+NAME is a string containing the name of the TWEAK parameter in the MML
+handle. FUNCTION is a Lisp function which is called with the MML
+handle to tweak the part.")
+
(defvar mml-generate-multipart-alist nil
"*Alist of multipart generation functions.
Each entry has the form (NAME . FUNCTION), where
(or mm-use-ultra-safe-encoding (assq 'sign cont))))
(save-restriction
(narrow-to-region (point) (point))
+ (mml-tweak-part cont)
(cond
((or (eq (car cont) 'part) (eq (car cont) 'mml))
(let ((raw (cdr (assq 'raw cont)))
(interactive)
(mml-parse))
+(defun mml-tweak-part (cont)
+ "Tweak a MML part."
+ (let ((tweak (cdr (assq 'tweak cont)))
+ func)
+ (cond
+ (tweak
+ (setq func
+ (or (cdr (assoc tweak mml-tweak-function-alist))
+ (intern tweak))))
+ (mml-tweak-type-alist
+ (let ((alist mml-tweak-type-alist)
+ (type (or (cdr (assq 'type cont)) "text/plain")))
+ (while alist
+ (if (string-match (caar alist) type)
+ (setq func (cdar alist)
+ alist nil)
+ (setq alist (cdr alist)))))))
+ (if func
+ (funcall func cont)
+ cont)))
+
(provide 'mml)
;;; mml.el ends here
(goto-char (point-min))
(when (looking-at "X-From-Line: ")
(replace-match "From "))
- (let ((nnmail-file-coding-system nnfolder-active-file-coding-system))
- (with-temp-buffer
+ (with-temp-buffer
+ (let ((nnmail-file-coding-system nnfolder-active-file-coding-system)
+ (nntp-server-buffer (current-buffer)))
(nnmail-find-file nnfolder-active-file)
(setq nnfolder-group-alist (nnmail-parse-active))))
(save-excursion
(setq group (read buffer))
(unless (stringp group)
(setq group (symbol-name group)))
- (if (and (numberp (setq max (read nntp-server-buffer)))
- (numberp (setq min (read nntp-server-buffer))))
+ (if (and (numberp (setq max (read buffer)))
+ (numberp (setq min (read buffer))))
(push (list group (cons min max))
group-assoc)))
(error nil))
"nntpd" buffer nntp-address nntp-port-number))
(defun nntp-open-ssl-stream (buffer)
- (let* ((ssl-program-arguments '("-connect" (concat host ":" service)))
- (proc (open-ssl-stream "nntpd" buffer nntp-address nntp-port-number)))
+ (let ((proc (open-ssl-stream "nntpd" buffer nntp-address nntp-port-number)))
(save-excursion
(set-buffer buffer)
(nntp-wait-for-string "^\r*20[01]")
"S/MIME configuration.")
(defcustom smime-keys nil
- "Map mail addresses to a file containing Certificate (and private key).
+ "*Map mail addresses to a file containing Certificate (and private key).
The file is assumed to be in PEM format. You can also associate additional
certificates to be sent with every message to each address."
:type '(repeat (list (string :tag "Mail address")
:group 'smime)
(defcustom smime-CA-directory nil
- "Directory containing certificates for CAs you trust.
+ "*Directory containing certificates for CAs you trust.
Directory should contain files (in PEM format) named to the X.509
hash of the certificate. This can be done using OpenSSL such as:
:group 'smime)
(defcustom smime-CA-file nil
- "Files containing certificates for CAs you trust.
+ "*Files containing certificates for CAs you trust.
File should contain certificates in PEM format."
:type '(choice (const :tag "none" nil)
file)
:group 'smime)
(defcustom smime-certificate-directory "~/Mail/certs/"
- "Directory containing other people's certificates.
+ "*Directory containing other people's certificates.
It should contain files named to the X.509 hash of the certificate,
and the files themself should be in PEM format."
;The S/MIME library provide simple functionality for fetching
(eq 0 (call-process "openssl" nil nil nil "version"))
(error nil))
"openssl")
- "Name of OpenSSL binary."
+ "*Name of OpenSSL binary."
:type 'string
:group 'smime)
;; OpenSSL option to select the encryption cipher
(defcustom smime-encrypt-cipher "-des3"
- "Cipher algorithm used for encryption."
+ "*Cipher algorithm used for encryption."
:type '(choice (const :tag "Triple DES" "-des3")
(const :tag "DES" "-des")
(const :tag "RC2 40 bits" "-rc2-40")
:group 'smime)
(defcustom smime-dns-server nil
- "DNS server to query certificates from.
+ "*DNS server to query certificates from.
If nil, use system defaults."
:type '(choice (const :tag "System defaults")
string)
- :group 'dig)
+ :group 'smime)
+
+(defcustom smime-extra-arguments nil
+ "*List of additional arguments passed to OpenSSL.
+For instance, if you don't have a /dev/random you might be forced
+to set this to e.g. `(\"-rand\" \"/etc/entropy\")'."
+ :type '(repeat string)
+ :group 'smime)
(defvar smime-details-buffer "*OpenSSL output*")
;; OpenSSL wrappers.
(defun smime-call-openssl-region (b e buf &rest args)
- (case (apply 'call-process-region b e smime-openssl-program nil buf nil args)
+ (case (apply 'call-process-region b e smime-openssl-program nil
+ (list buf nil) nil (append smime-extra-arguments args))
(0 t)
(1 (message "OpenSSL: An error occurred parsing the command options.") nil)
(2 (message "OpenSSL: One of the input files could not be read.") nil)
(setenv "GNUS_SMIME_PASSPHRASE" passphrase))
(when (apply 'smime-call-openssl-region
b e buffer "smime" "-decrypt"
- "-recip" keyfile
+ "-recip" (expand-file-name keyfile)
(if passphrase
(list "-passin" "env:GNUS_SMIME_PASSPHRASE" )))
(delete-region b e)
+2001-07-28 09:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
+ From Janne Rinta-Manty <rintaman@cs.helsinki.fi>
+
+ * gnus.texi (Read Articles): Typo.
+
2001-07-25 22:22:22 Raymond Scholz <rscholz@zonix.de>
* gnus.texi (Fancy Mail Splitting): New variable
@item M
@vindex gnus-duplicate-mark
-\e$B=EJ#M^@)$K$h$j4{FI$N0u$N$D$$$?5-;v\e(B (@code{gnus-duplicated-mark})\e$B!#\e(B
+\e$B=EJ#M^@)$K$h$j4{FI$N0u$N$D$$$?5-;v\e(B (@code{gnus-duplicate-mark})\e$B!#\e(B
@xref{Duplicate Suppression}.
@end table
@item M
@vindex gnus-duplicate-mark
Article marked as read by duplicate suppression
-(@code{gnus-duplicated-mark}). @xref{Duplicate Suppression}.
+(@code{gnus-duplicate-mark}). @xref{Duplicate Suppression}.
@end table