Checks include subject-cmsg multiple-headers sendsys message-id from
long-lines control-chars size new-text redirected-followup signature
approved sender empty empty-headers message-id from subject
-shorten-followup-to existing-newsgroups buffer-file-name unchanged."
+shorten-followup-to existing-newsgroups buffer-file-name unchanged
+newsgroups."
:group 'message-news)
(defcustom message-required-news-headers
:group 'message-various
:type 'hook)
-(defcustom message-header-hook '(eword-encode-header)
+(defcustom message-header-hook '((lambda () (eword-encode-header t)))
"Hook run in a message mode buffer narrowed to the headers."
:group 'message-various
:type 'hook)
(defvar message-draft-coding-system
(cond
((not (fboundp 'find-coding-system)) nil)
- ((find-coding-system 'emacs-mule) 'emacs-mule)
+ ((find-coding-system 'emacs-mule)
+ (if (memq system-type '(windows-nt ms-dos ms-windows))
+ 'emacs-mule-dos 'emacs-mule))
((find-coding-system 'escape-quoted) 'escape-quoted)
((find-coding-system 'no-conversion) 'no-conversion)
(t nil))
;; There might be a continuation header, so we have to search
;; until we find a new non-continuation line.
(progn
- (while (and (zerop (forward-line 1))
- (memq (char-after) '(?\t ?\ ))))
- (point))))
- (while (and (zerop (forward-line 1))
- (memq (char-after) '(?\t ?\ ))))))
+ (forward-line 1)
+ (if (re-search-forward "^[^ \t]" nil t)
+ (goto-char (match-beginning 0))
+ (point-max)))))
+ (forward-line 1)
+ (if (re-search-forward "^[^ \t]" nil t)
+ (goto-char (match-beginning 0))
+ (goto-char (point-max)))))
number))
(defun message-remove-first-header (header)
(defun message-next-header ()
"Go to the beginning of the next header."
- (while (and (zerop (forward-line 1))
- (memq (char-after) '(?\t ?\ ))))
- (not (eobp)))
+ (beginning-of-line)
+ (or (eobp) (forward-char 1))
+ (not (if (re-search-forward "^[^ \t]" nil t)
+ (beginning-of-line)
+ (goto-char (point-max)))))
(defun message-sort-headers-1 ()
"Sort the buffer as headers using `message-rank' text props."
(goto-char (point-min))
(search-forward (concat "\n" mail-header-separator "\n") nil t)
(let ((fill-prefix message-yank-prefix))
- (fill-individual-paragraphs (point) (point-max) justifyp t))))
+ (fill-individual-paragraphs (point) (point-max) justifyp))))
(defun message-indent-citation ()
"Modify text just inserted from a message to be cited.
(car elem))))
(setq success (funcall (caddr elem) arg)))))
(setq sent t))))
+ (unless sent
+ (error "No methods specified to send by"))
(prog1
(when (and success sent)
(message-do-fcc)
;; Remove some headers.
(save-restriction
(message-narrow-to-headers)
+;; We Semi-gnus people have no use for it.
+;; ;; We (re)generate the Lines header.
+;; (when (memq 'Lines message-required-mail-headers)
+;; (message-generate-headers '(Lines)))
;; Remove some headers.
(message-remove-header message-ignored-mail-headers t))
(goto-char (point-max))
;; require one newline at the end.
- (or (bolp)
+ (or (= (preceding-char) ?\n)
(insert ?\n))
(when (and news
(or (message-fetch-field "cc")
(re-search-forward
(concat "^" (regexp-quote mail-header-separator) "\n"))
(replace-match "\n")
- (forward-char -1)
+ (backward-char 1)
(setq delimline (point-marker))
(run-hooks 'message-send-mail-hook)
;; Insert an extra newline if we need it to work around
(re-search-forward
(concat "^" (regexp-quote mail-header-separator) "\n"))
(replace-match "\n")
- (forward-char -1)
+ (backward-char 1)
(run-hooks 'message-send-mail-hook)
;; send the message
(case
(re-search-forward
(concat "^" (regexp-quote mail-header-separator) "\n"))
(replace-match "\n")
- (forward-char -1)
+ (backward-char 1)
(run-hooks 'message-send-mail-hook)
(if recipients
(let ((result (smtp-via-smtp user-mail-address
;; Remove some headers.
(save-restriction
(message-narrow-to-headers)
+;; We Semi-gnus people have no use for it.
+;; ;; We (re)generate the Lines header.
+;; (when (memq 'Lines message-required-mail-headers)
+;; (message-generate-headers '(Lines)))
;; Remove some headers.
(message-remove-header message-ignored-news-headers t))
(goto-char (point-max))
;; require one newline at the end.
- (or (bolp)
+ (or (= (preceding-char) ?\n)
(insert ?\n))
(setq result (message-maybe-split-and-send-news method)))
(kill-buffer tembuf))
(re-search-forward
(concat "^" (regexp-quote mail-header-separator) "\n"))
(replace-match "\n")
- (forward-char -1)
+ (backward-char 1)
(run-hooks 'message-send-news-hook)
(gnus-open-server method)
(gnus-request-post method)
(defun message-check-news-header-syntax ()
(and
+ ;; Check Newsgroups header.
+ (message-check 'newsgroyps
+ (let ((group (message-fetch-field "newsgroups")))
+ (or
+ (and group
+ (not (string-match "\\`[ \t]*\\'" group)))
+ (ignore
+ (message
+ "The newsgroups field is empty or missing. Posting is denied.")))))
;; Check the Subject header.
(message-check 'subject
(let* ((case-fold-search t)
(message-check 'from
(let* ((case-fold-search t)
(from (message-fetch-field "from"))
- (ad (nth 1 (std11-extract-address-components from))))
+ ad)
(cond
((not from)
(message "There is no From line. Posting is denied.")
nil)
- ((or (not (string-match "@[^\\.]*\\." ad)) ;larsi@ifi
+ ((or (not (string-match
+ "@[^\\.]*\\."
+ (setq ad (nth 1 (mail-extract-address-components
+ from))))) ;larsi@ifi
(string-match "\\.\\." ad) ;larsi@ifi..uio
(string-match "@\\." ad) ;larsi@.ifi.uio
(string-match "\\.$" ad) ;larsi@ifi.uio.
(while (re-search-forward "[\t\n]+" nil t)
(replace-match "" t t))
(unless (zerop (buffer-size))
- (buffer-substring (point-min) (point-max))))))
+ (buffer-string)))))
(defun message-make-lines ()
"Count the number of lines and return numeric string."
(replace-match "\\1(\\3)" t)
(goto-char fullname-start)))
(insert ")")))
- (buffer-substring (point-min) (point-max)))))
+ (buffer-string))))
(defun message-make-sender ()
"Return the \"real\" user address.
from subject date to cc
references message-id follow-to
(inhibit-point-motion-hooks t)
+ (message-this-is-mail t)
mct never-mct mft mrt gnus-warning in-reply-to)
(save-restriction
(message-narrow-to-head)
(while (re-search-forward "[ \t]+" nil t)
(replace-match " " t t))
;; Remove addresses that match `rmail-dont-reply-to-names'.
- (insert (prog1 (rmail-dont-reply-to (buffer-substring
- (point-min) (point-max)))
+ (insert (prog1 (rmail-dont-reply-to (buffer-string))
(erase-buffer)))
(goto-char (point-min))
;; Perhaps Mail-Copies-To: never removed the only address?
(mapcar
(lambda (addr)
(cons (mail-strip-quoted-names addr) addr))
- (message-tokenize-header (buffer-substring
- (point-min) (point-max)))))
+ (message-tokenize-header (buffer-string))))
(let ((s ccalist))
(while s
(setq ccalist (delq (assoc (car (pop s)) s) ccalist)))))
(while (re-search-backward "[ \t]+$" nil t)
(replace-match ""))
- (buffer-substring (point-min) (point-max))))
+ (buffer-string)))
;;; Forwarding messages.