+2003-02-20 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * message.el (message-user-fqdn, message-valid-fqdn-regexp): New
+ variables.
+ (message-make-fqdn): Use it. Improved validity check.
+
+2003-02-23 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * message.el (message-user-mail-address): Check whether
+ user-mail-address looks valid.
+
+ * gnus-msg.el (gnus-mailing-list-followup-to): New function.
+
+ * gnus-util.el (gnus-fetch-original-field): New function.
+
+2003-02-23 Kai Gro\e,A_\e(Bjohann <kai.grossjohann@uni-duisburg.de>
+
+ * message.el (message-mode): \\(...\\) around additional
+ paragraph-separate alternative.
+
2003-02-23 Jesper Harder <harder@ifa.au.dk>
* gnus-art.el (gnus-mime-button-commands): Add ellipsis.
(interactive
(list (completing-read "Action: " gnus-mime-action-alist nil t)))
(gnus-article-check-buffer)
- (let ((action-pair (assoc action gnus-mime-action-alistq)))
+ (let ((action-pair (assoc action gnus-mime-action-alist)))
(if action-pair
(funcall (cdr action-pair)))))
(insert " ")))
(insert "\n")))))))
+(defun gnus-mailing-list-followup-to ()
+ "Look at the headers in the current buffer and return a Mail-Followup-To address."
+ (let ((x-been-there (gnus-fetch-original-field "x-beenthere"))
+ (list-post (gnus-fetch-original-field "list-post")))
+ (when (and list-post
+ (string-match "mailto:\\([^>]+\\)" list-post))
+ (setq list-post (match-string 1 list-post)))
+ (or list-post
+ x-been-there)))
+
;;; Posting styles.
(defun gnus-configure-posting-styles (&optional group-name)
(nnheader-narrow-to-headers)
(message-fetch-field field)))))
+(defun gnus-fetch-original-field (field)
+ "Fetch FIELD from the original version of the current article."
+ (with-current-buffer gnus-original-article-buffer
+ (gnus-fetch-field field)))
+
+
(defun gnus-goto-colon ()
(beginning-of-line)
(let ((eol (gnus-point-at-eol)))
:group 'message-headers
:type 'boolean)
+(defcustom message-user-fqdn nil
+ "*Domain part of Messsage-Ids."
+ :group 'message-headers
+ :link '(custom-manual "(message)News Headers")
+ :type 'string)
+
;;; Internal variables.
(defvar message-sending-message "Sending...")
(defvar message-bogus-system-names "^localhost\\."
"The regexp of bogus system names.")
+(defcustom message-valid-fqdn-regexp
+ (concat "[a-z0-9][-.a-z0-9]+\\." ;; [hostname.subdomain.]domain.
+ ;; valid TLDs:
+ "\\([a-z][a-z]" ;; two letter country TDLs
+ "\\|biz\\|com\\|edu\\|gov\\|int\\|mil\\|net\\|org"
+ "\\|aero\\|coop\\|info\\|name\\|museum"
+ "\\|arpa\\|pro\\|uucp\\|bitnet\\|bofh" ;; old style?
+ "\\)")
+ "Regular expression that matches a valid FQDN."
+ ;; see also: gnus-button-valid-fqdn-regexp
+ :group 'message-headers
+ :type 'regexp)
+
(eval-and-compile
(autoload 'message-setup-toolbar "messagexmas")
(autoload 'mh-new-draft-name "mh-comp")
(setq message-parameter-alist
(copy-sequence message-startup-parameter-alist))
(message-setup-fill-variables)
- (set (make-local-variable 'paragraph-separate)
- (concat paragraph-separate
- "\\|<#!*/?\\(multipart\\|part\\|external\\|mml\\|secure\\)"))
+ (set
+ (make-local-variable 'paragraph-separate)
+ (format "\\(%s\\)\\|\\(%s\\)"
+ paragraph-separate
+ "<#!*/?\\(multipart\\|part\\|external\\|mml\\|secure\\)"))
;; Allow using comment commands to add/remove quoting.
(set (make-local-variable 'comment-start) message-yank-prefix)
(if (featurep 'xemacs)
(defun message-user-mail-address ()
"Return the pertinent part of `user-mail-address'."
- (when user-mail-address
+ (when (and user-mail-address
+ (string-match "@.*\\." user-mail-address))
(if (string-match " " user-mail-address)
(nth 1 (std11-extract-address-components user-mail-address))
user-mail-address)))
(defun message-make-fqdn ()
"Return user's fully qualified domain name."
- (let ((system-name (system-name))
- (user-mail (message-user-mail-address)))
+ (let* ((system-name (system-name))
+ (user-mail (message-user-mail-address))
+ (user-domain
+ (if (string-match "@\\(.*\\)\\'" user-mail)
+ (match-string 1 user-mail))))
(cond
- ((and (string-match "[^.]\\.[^.]" system-name)
+ ((and message-user-fqdn
+ (stringp message-user-fqdn)
+ (string-match message-valid-fqdn-regexp message-user-fqdn)
+ (not (string-match message-bogus-system-names message-user-fqdn)))
+ message-user-fqdn)
+ ;; `message-user-fqdn' seems to be valid
+ ((and (string-match message-valid-fqdn-regexp system-name)
(not (string-match message-bogus-system-names system-name)))
;; `system-name' returned the right result.
system-name)
;; Try `mail-host-address'.
((and (boundp 'mail-host-address)
(stringp mail-host-address)
- (string-match "\\." mail-host-address))
+ (string-match message-valid-fqdn-regexp mail-host-address)
+ (not (string-match message-bogus-system-names mail-host-address)))
mail-host-address)
;; We try `user-mail-address' as a backup.
- ((and user-mail
- (string-match "\\." user-mail)
- (string-match "@\\(.*\\)\\'" user-mail))
- (match-string 1 user-mail))
+ ((and user-domain
+ (stringp user-domain)
+ (string-match message-valid-fqdn-regexp user-domain)
+ (not (string-match message-bogus-system-names user-domain)))
+ user-domain)
;; Default to this bogus thing.
(t
(concat system-name ".i-did-not-set--mail-host-address--so-tickle-me")))))
+2003-02-20 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * message.texi (News Headers): Update description of Message-ID.
+
2003-02-23 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus.texi (Startup Files): Addition.
@item Message-ID
@cindex Message-ID
+@vindex message-user-fqdn
@vindex mail-host-address
+@vindex user-mail-address
@findex system-name
@cindex Sun
+@cindex i-did-not-set--mail-host-address--so-tickle-me
\e$B$3$NI,MW$J%X%C%@!<$O\e(B Message \e$B$K$h$j:n@.$5$l$^$9!#F|IU!";~4V!"MxMQ<TL>!"\e(B
-\e$B%7%9%F%`L>$K4p$E$$$?B>$KL5$$\e(B ID \e$B$,:n@.$5$l$^$9!#\e(B
-Message \e$B$O\e(B @code{system-name} \e$B$r%7%9%F%`L>$r7h$a$k$?$a$K;H$$$^$9!#$b$7$3\e(B
-\e$B$l$,\e(B fully qualified domain name (FQDN) (\e$B40A4$K>r7o$rK~$?$7$?%I%a%$%s\e(B
-\e$BL>\e(B) \e$B$G$J$$$J$i\e(B \e$B$P!"\e(BMessage \e$B$O\e(B @code{mail-host-address} \e$B$r\e(B FQDN \e$B$H$7$F;H\e(B
-\e$B$$$^$9!#\e(B
+\e$B%7%9%F%`L>$K4p$E$$$?B>$KL5$$\e(B ID \e$B$,:n@.$5$l$^$9!#%I%a%$%s$N9`$K$D$$$F$O!"\e(B
+\e$BM-8z$J\e(B FQDN (\e$B40A4$K>r7o$rK~$?$7$?%I%a%$%sL>\e(B) \e$B$i$7$$$b$N$,8+$D$+$i$J$$>l\e(B
+\e$B9g!"\e(Bmessage \e$B$O\e(B @code{message-user-fqdn}, @code{system-name},
+@code{mail-host-address} \e$B$*$h$S\e(B @code{message-user-mail-address} (\e$B$9$J$o\e(B
+\e$B$A\e(B @code{user-mail-address}) \e$B$r\e(B (\e$B$3$N=g$G\e(B) \e$BC5$7$^$9!#\e(B
@item User-Agent
@cindex User-Agent
@item Message-ID
@cindex Message-ID
+@vindex message-user-fqdn
@vindex mail-host-address
+@vindex user-mail-address
@findex system-name
@cindex Sun
+@cindex i-did-not-set--mail-host-address--so-tickle-me
This required header will be generated by Message. A unique ID will be
-created based on the date, time, user name and system name. Message
-will use @code{system-name} to determine the name of the system. If
-this isn't a fully qualified domain name (FQDN), Message will use
-@code{mail-host-address} as the FQDN of the machine.
+created based on the date, time, user name and system name. For the
+domain part, message will look (in this order) at
+@code{message-user-fqdn}, @code{system-name}, @code{mail-host-address}
+and @code{message-user-mail-address} (i.e. @code{user-mail-address})
+until a probably valid fully qualified domain name (FQDN) was found.
@item User-Agent
@cindex User-Agent