\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
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
;; 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 ]]
;; 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 ]]
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'.
(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)
: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."
(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))