comparison lisp/gnus/message.el @ 124:9b50b4588a93 r20-1b15

Import from CVS: tag r20-1b15
author cvs
date Mon, 13 Aug 2007 09:26:39 +0200
parents d2f30a177268
children b980b6286996
comparison
equal deleted inserted replaced
123:c77884c6318d 124:9b50b4588a93
2030 ;; Check the body. 2030 ;; Check the body.
2031 (message-check-news-body-syntax))))) 2031 (message-check-news-body-syntax)))))
2032 2032
2033 (defun message-check-news-header-syntax () 2033 (defun message-check-news-header-syntax ()
2034 (and 2034 (and
2035 ;; Check the Subject header.
2036 (message-check 'subject
2037 (let* ((case-fold-search t)
2038 (subject (message-fetch-field "subject")))
2039 (or
2040 (and subject
2041 (not (string-match "\\`[ \t]*\\'" subject)))
2042 (ignore
2043 (message
2044 "The subject field is empty or missing. Posting is denied.")))))
2035 ;; Check for commands in Subject. 2045 ;; Check for commands in Subject.
2036 (message-check 'subject-cmsg 2046 (message-check 'subject-cmsg
2037 (if (string-match "^cmsg " (message-fetch-field "subject")) 2047 (if (string-match "^cmsg " (message-fetch-field "subject"))
2038 (y-or-n-p 2048 (y-or-n-p
2039 "The control code \"cmsg\" is in the subject. Really post? ") 2049 "The control code \"cmsg\" is in the subject. Really post? ")
2103 (and (string-match "@" message-id) 2113 (and (string-match "@" message-id)
2104 (string-match "@[^\\.]*\\." message-id)) 2114 (string-match "@[^\\.]*\\." message-id))
2105 (y-or-n-p 2115 (y-or-n-p
2106 (format "The Message-ID looks strange: \"%s\". Really post? " 2116 (format "The Message-ID looks strange: \"%s\". Really post? "
2107 message-id))))) 2117 message-id)))))
2108 ;; Check the Subject header.
2109 (message-check 'subject
2110 (let* ((case-fold-search t)
2111 (subject (message-fetch-field "subject")))
2112 (or
2113 (and subject
2114 (not (string-match "\\`[ \t]*\\'" subject)))
2115 (ignore
2116 (message
2117 "The subject field is empty or missing. Posting is denied.")))))
2118 ;; Check the Newsgroups & Followup-To headers. 2118 ;; Check the Newsgroups & Followup-To headers.
2119 (message-check 'existing-newsgroups 2119 (message-check 'existing-newsgroups
2120 (let* ((case-fold-search t) 2120 (let* ((case-fold-search t)
2121 (newsgroups (message-fetch-field "newsgroups")) 2121 (newsgroups (message-fetch-field "newsgroups"))
2122 (followup-to (message-fetch-field "followup-to")) 2122 (followup-to (message-fetch-field "followup-to"))
2706 ;; Rename any old Sender headers to Original-Sender. 2706 ;; Rename any old Sender headers to Original-Sender.
2707 (when (re-search-forward "^\\(Original-\\)*Sender:" nil t) 2707 (when (re-search-forward "^\\(Original-\\)*Sender:" nil t)
2708 (beginning-of-line) 2708 (beginning-of-line)
2709 (insert "Original-") 2709 (insert "Original-")
2710 (beginning-of-line)) 2710 (beginning-of-line))
2711 (insert "Sender: " secure-sender "\n")))))) 2711 (when (or (message-news-p)
2712 (string-match "^[^@]@.+\\..+" secure-sender))
2713 (insert "Sender: " secure-sender "\n")))))))
2712 2714
2713 (defun message-insert-courtesy-copy () 2715 (defun message-insert-courtesy-copy ()
2714 "Insert a courtesy message in mail copies of combined messages." 2716 "Insert a courtesy message in mail copies of combined messages."
2715 (let (newsgroups) 2717 (let (newsgroups)
2716 (save-excursion 2718 (save-excursion
3070 (or message-id "")))) 3072 (or message-id ""))))
3071 nil)) 3073 nil))
3072 cur))) 3074 cur)))
3073 3075
3074 ;;;###autoload 3076 ;;;###autoload
3075 (defun message-wide-reply (&optional to-address) 3077 (defun message-wide-reply (&optional to-address ignore-reply-to)
3076 "Make a \"wide\" reply to the message in the current buffer." 3078 "Make a \"wide\" reply to the message in the current buffer."
3077 (interactive) 3079 (interactive)
3078 (message-reply to-address t)) 3080 (message-reply to-address t ignore-reply-to))
3079 3081
3080 ;;;###autoload 3082 ;;;###autoload
3081 (defun message-followup (&optional to-newsgroups) 3083 (defun message-followup (&optional to-newsgroups)
3082 "Follow up to the message in the current buffer. 3084 "Follow up to the message in the current buffer.
3083 If TO-NEWSGROUPS, use that as the new Newsgroups line." 3085 If TO-NEWSGROUPS, use that as the new Newsgroups line."