From a68ff150ceabdf1b37cf9efe3f3d8e2d2e048ca1 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 7 Nov 2001 12:23:50 +0000 Subject: [PATCH] Synch with Oort Gnus. --- lisp/ChangeLog | 20 ++++++++++++++ lisp/gnus-art.el | 2 -- lisp/mail-source.el | 2 +- lisp/message.el | 75 ++++++++++++++++++++++++++++++++++++--------------- lisp/mml.el | 3 ++- 5 files changed, 76 insertions(+), 26 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5fac699..ed8b0cc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,23 @@ +2001-11-07 06:00:00 ShengHuo ZHU + + * mml.el (mml-preview): Bind mail-header-separator. + +2001-11-07 Katsumi Yamaoka + + * message.el: Always require canlock. + (message-ignored-supersedes-headers): Include Cancel-Lock and + Cancel-Key. + (message-insert-canlock): Don't require canlock. + (message-cancel-news): Don't check whether canlock is available. + (message-supersede): Support cancel-locks. + + * gnus-art.el: Don't autoload canlock. + +2001-11-06 18:00:00 ShengHuo ZHU + + * mail-source.el (mail-source-fetch-imap): ASYNC param. + From: + 2001-11-06 10:00:00 ShengHuo ZHU * many files: Fix copyright lines. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index d77a5db..2c37b71 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -3107,8 +3107,6 @@ If variable `gnus-use-long-file-name' is non-nil, it is (put-text-property (match-end 0) (point-max) 'face eface))))))))) -(autoload 'canlock-verify "canlock") - (defun article-verify-cancel-lock () "Verify Cancel-Lock header." (interactive) diff --git a/lisp/mail-source.el b/lisp/mail-source.el index 43cf3a0..e29e72a 100644 --- a/lisp/mail-source.el +++ b/lisp/mail-source.el @@ -944,7 +944,7 @@ This only works when `display-time' is enabled." fetchflag nil buf)) (if dontexpunge (imap-mailbox-unselect buf) - (imap-mailbox-close buf)) + (imap-mailbox-close nil buf)) (imap-close buf)) (imap-close buf) ;; We nix out the password in case the error diff --git a/lisp/message.el b/lisp/message.el index 9158811..3596194 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -37,10 +37,10 @@ ;;; Code: (eval-when-compile - (require 'canlock) (require 'cl) (require 'smtp) - (defvar gnus-list-identifiers)) ; gnus-sum is required where necessary + (defvar gnus-list-identifiers)) ; gnus-sum is required where necessary +(require 'canlock) (require 'mailheader) (require 'nnheader) ;; This is apparently necessary even though things are autoloaded: @@ -249,7 +249,7 @@ included. Organization, Lines and User-Agent are optional." :group 'message-headers :type 'regexp) -(defcustom message-ignored-supersedes-headers "^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|^Received:\\|^X-From-Line:\\|^X-Trace:\\|^X-Complaints-To:\\|Return-Path:\\|^Supersedes:\\|^NNTP-Posting-Date:\\|^X-Trace:\\|^X-Complaints-To:" +(defcustom message-ignored-supersedes-headers "^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|^Received:\\|^X-From-Line:\\|^X-Trace:\\|^X-Complaints-To:\\|Return-Path:\\|^Supersedes:\\|^NNTP-Posting-Date:\\|^X-Trace:\\|^X-Complaints-To:\\|^Cancel-Lock:\\|^Cancel-Key:" "*Header lines matching this regexp will be deleted before posting. It's best to delete old Path and Date headers before posting to avoid any confusion." @@ -3384,7 +3384,6 @@ Otherwise, generate and save a value for `canlock-password' first." (defun message-insert-canlock () (when message-insert-canlock - (require 'canlock) (message-canlock-password) (canlock-insert-header))) @@ -5282,15 +5281,31 @@ If ARG, allow editing of the cancellation message." message-id (message-fetch-field "message-id" t) distribution (message-fetch-field "distribution"))) ;; Make sure that this article was written by the user. - (unless (or (message-gnksa-enable-p 'cancel-messages) - (and sender - (string-equal - (downcase sender) - (downcase (message-make-sender)))) - (string-equal - (downcase (cadr (std11-extract-address-components from))) - (downcase (cadr (std11-extract-address-components - (message-make-from)))))) + (unless (or + ;; Canlock-logic as suggested by Per Abrahamsen + ;; + ;; + ;; IF article has cancel-lock THEN + ;; IF we can verify it THEN + ;; issue cancel + ;; ELSE + ;; error: cancellock: article is not yours + ;; ELSE + ;; Use old rules, comparing sender... + (if (message-fetch-field "Cancel-Lock") + (if (null (canlock-verify)) + t + (error "Failed to verify Cancel-lock: This article is not yours")) + nil) + (message-gnksa-enable-p 'cancel-messages) + (and sender + (string-equal + (downcase sender) + (downcase (message-make-sender)))) + (string-equal + (downcase (cadr (std11-extract-address-components from))) + (downcase (cadr (std11-extract-address-components + (message-make-from)))))) (error "This article is not yours")) (when (yes-or-no-p "Do you really want to cancel this article? ") ;; Make control message. @@ -5332,15 +5347,31 @@ header line with the old Message-ID." (sender (message-fetch-field "sender")) (from (message-fetch-field "from"))) ;; Check whether the user owns the article that is to be superseded. - (unless (or (message-gnksa-enable-p 'cancel-messages) - (and sender - (string-equal - (downcase sender) - (downcase (message-make-sender)))) - (string-equal - (downcase (cadr (std11-extract-address-components from))) - (downcase (cadr (std11-extract-address-components - (message-make-from)))))) + (unless (or + ;; Canlock-logic as suggested by Per Abrahamsen + ;; + ;; + ;; IF article has cancel-lock THEN + ;; IF we can verify it THEN + ;; issue cancel + ;; ELSE + ;; error: cancellock: article is not yours + ;; ELSE + ;; Use old rules, comparing sender... + (if (message-fetch-field "Cancel-Lock") + (if (null (canlock-verify)) + t + (error "Failed to verify Cancel-lock: This article is not yours")) + nil) + (message-gnksa-enable-p 'cancel-messages) + (and sender + (string-equal + (downcase sender) + (downcase (message-make-sender)))) + (string-equal + (downcase (cadr (std11-extract-address-components from))) + (downcase (cadr (std11-extract-address-components + (message-make-from)))))) (error "This article is not yours")) ;; Get a normal message buffer. (message-pop-to-buffer (message-buffer-name "supersede")) diff --git a/lisp/mml.el b/lisp/mml.el index fda189e..194e632 100644 --- a/lisp/mml.el +++ b/lisp/mml.el @@ -910,7 +910,8 @@ If RAW, don't highlight the article." (if (re-search-forward (concat "^" (regexp-quote mail-header-separator) "\n") nil t) (replace-match "\n")) - (mml-to-mime) + (let ((mail-header-separator "")) ;; mail-header-separator is removed. + (mml-to-mime)) (if raw (when (fboundp 'set-buffer-multibyte) (let ((s (buffer-string))) -- 1.7.10.4