* wl-vars.el (wl-message-id-use-wl-from): New variable.
authorokada <okada>
Thu, 17 Jan 2002 09:23:52 +0000 (09:23 +0000)
committerokada <okada>
Thu, 17 Jan 2002 09:23:52 +0000 (09:23 +0000)
* wl-utils.el (wl-draft-make-message-id-string):
Use `wl-from' for domain part of Message-ID
if `wl-message-id-use-wl-from' if non-nil.
* wl.el (wl-check-environment): Fix for `wl-message-id-use-wl-from'

doc/wl-ja.texi
doc/wl.texi
samples/en/dot.wl
samples/ja/dot.wl
wl/ChangeLog
wl/wl-util.el
wl/wl-vars.el
wl/wl.el

index 9555fca..955b82d 100644 (file)
@@ -4344,6 +4344,11 @@ Wanderlust \e$B$N%*%U%i%$%s%b!<%I\e(B/\e$B%*%s%i%$%s%b!<%I$r%H%0%k$7$^$9!#\e(B
 \e$B=i4|@_Dj$O\e(B @code{t}\e$B!#\e(B
 Non-nil \e$B$J$i!"Aw?.;~$K\e(B @samp{Message-ID:} \e$B%U%#!<%k%I$r<+F0E*$KA^F~$7$^$9!#\e(B
 
+@item wl-message-id-use-wl-from
+@vindex wl-message-id-use-wl-from
+\e$B=i4|@_Dj$O\e(B @code{nil}\e$B!#\e(BNon-nil \e$B$J$i!"\e(B@samp{Message-ID:} \e$B$N%I%a%$%s%Q!<%H$K\e(B 
+@code{wl-from} \e$B$rMxMQ$7$^$9!#\e(B
+
 @item wl-local-domain
 @vindex wl-local-domain
 \e$B=i4|@_Dj$O\e(B @code{nil}\e$B!#\e(B@code{nil} \e$B$J$i$P\e(B @samp{Message-ID:} \e$B$N%I%a%$%s%Q!<\e(B
index 2a9752d..0ffc6e0 100644 (file)
@@ -4382,6 +4382,11 @@ draft buffer.  If @code{nil}, it is not automatically inserted.
 The initial setting is @code{t}.  If non-nil, @samp{Message-ID:} field
 is automatically inserted on the transmission.
 
+@item wl-message-id-use-wl-from
+@vindex wl-message-id-use-wl-from
+The initial setting is @code{nil}.  If non-nil, the value of
+@code{wl-from} will be used as the domain part of @samp{Message-ID:}.
+
 @item wl-local-domain
 @vindex wl-local-domain
 The initial setting is @code{nil}.  If @code{nil}, the return value of
index 1fbf9c4..0cd00aa 100644 (file)
@@ -54,6 +54,9 @@
 ;; Specific domain part for message-id.
 ;(setq wl-message-id-domain "hostname.example.com")
 
+;; Use wl-from for generating message-id.
+;; wl-message-id-use-wl-from precedes wl-local-domain and wl-message-id-domain.
+;(setq wl-message-id-use-wl-from t)
 
 ;;; [[ Server Setting ]]
 
index 87c9b65..1f374fa 100644 (file)
 ;; Message-ID \e$B$N%I%a%$%s%Q!<%H$r6/@)E*$K;XDj\e(B
 ;(setq wl-message-id-domain "hostname.example.com")
 
+;; Message-ID \e$B$N%I%a%$%s%Q!<%H$r\e(B wl-from \e$B$+$i@8@.$7$^$9!#\e(B
+;; global\e$B$J\e(BIP\e$B$r;}$?$J$$>l9g$K;H$C$F$/$@$5$$!#\e(B
+;; wl-local-domain, wl-message-id-domain\e$B$KM%@h$7$^$9!#\e(B
+;(setq wl-message-id-use-wl-from t)
 
 ;;; [[ \e$B%5!<%P$N@_Dj\e(B ]]
 
index 96c2fc6..ddc58af 100644 (file)
@@ -1,5 +1,13 @@
 2002-01-17  Kenichi OKADA  <okada@opaopa.org>
 
+       * wl-vars.el (wl-message-id-use-wl-from): New variable.
+       * wl-utils.el (wl-draft-make-message-id-string):
+       Use `wl-from' for domain part of Message-ID
+       if `wl-message-id-use-wl-from' if non-nil.
+       * wl.el (wl-check-environment): Fix for `wl-message-id-use-wl-from'
+
+2002-01-17  Kenichi OKADA  <okada@opaopa.org>
+
        * wl.el (wl): Call `wl-check-type'
        Do not 'condition-case'.
 
index 7a74af1..54d53a3 100644 (file)
@@ -642,12 +642,20 @@ that `read' can handle, whenever this is possible."
 
 (defun wl-draft-make-message-id-string ()
   "Return Message-ID field value."
-  (concat "<" (wl-unique-id) "@"
-         (or wl-message-id-domain
-             (if wl-local-domain
-                 (concat (system-name) "." wl-local-domain)
-               (system-name)))
-         ">"))
+  (concat "<" (wl-unique-id)
+         (let (from user domain)
+           (if (and wl-message-id-use-wl-from
+                    (progn
+                      (setq from (wl-address-header-extract-address wl-from))
+                      (and (string-match "^\\(.*\\)@\\(.*\\)$" from)
+                           (setq user   (match-string 1 from))
+                           (setq domain (match-string 2 from)))))
+               (format "%%%s@%s>" user domain)
+             (format "@%s>"
+                     (or wl-message-id-domain
+                         (if wl-local-domain
+                             (concat (system-name) "." wl-local-domain)
+                           (system-name))))))))
 
 ;;; Profile loading.
 (defvar wl-load-profile-function 'wl-local-load-profile)
index b24d7cc..9ad4af2 100644 (file)
@@ -1166,6 +1166,11 @@ Allowed situations are:
   :group 'wl-summary
   :group 'wl-pref)
 
+(defcustom wl-message-id-use-wl-from nil
+  "*Use `wl-from' for domain part of Message-ID if non-nil."
+  :type 'boolean
+  :group 'wl-pref)
+
 (defcustom wl-local-domain nil
   "*Domain part of this client (without hostname).
 Set this if (system-name) does not return FQDN."
index ac52444..1dbe681 100644 (file)
--- a/wl/wl.el
+++ b/wl/wl.el
@@ -703,22 +703,25 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
 (defun wl-check-environment (no-check-folder)
   (unless wl-from (error "Please set `wl-from'"))
   ;; Message-ID
-  (unless (string-match "[^.]\\.[^.]" (or wl-message-id-domain
-                                         (if wl-local-domain
-                                             (concat (system-name)
-                                                     "." wl-local-domain)
-                                           (system-name))))
-    (error "Please set `wl-local-domain' to get valid FQDN"))
-  (if (string-match "@" (or wl-message-id-domain
-                           (if wl-local-domain
-                               (concat (system-name)
-                                       "." wl-local-domain)
-                             (system-name))))
-      (error "Please remove `@' from `wl-message-id-domain'"))
-  (if (string= wl-local-domain "localdomain")
-      (error "Please set `wl-local-domain'"))
-  (if (string= wl-message-id-domain "localhost.localdomain")
-      (error "Please set `wl-message-id-domain'"))
+  (let ((from domain))
+    (if wl-message-id-use-wl-from
+       (if (and (setq from (wl-address-header-extract-address wl-from))
+                (string-match "^\\(.*\\)@\\(.*\\)$" from))
+           (setq domain (match-string 2 from))
+         (error "Please set `wl-from' to get valid Message-ID string."))
+      (setq domain
+           (or wl-message-id-domain
+               (if wl-local-domain
+                   (concat (system-name) "." wl-local-domain)
+                 (system-name)))))
+    (unless (string-match "[^.]\\.[^.]" domain)
+      (error "Please set `wl-local-domain' to get valid FQDN"))
+    (if (string-match "@" domain)
+       (error "Please remove `@' from `wl-message-id-domain'"))
+    (if (string= wl-local-domain "localdomain")
+       (error "Please set `wl-local-domain'"))
+    (if (string= wl-message-id-domain "localhost.localdomain")
+       (error "Please set `wl-message-id-domain'")))
   ;; folders
   (when (not no-check-folder)
     (let ((draft-folder (wl-folder-get-elmo-folder wl-draft-folder))