@item message-server-alist
@vindex message-server-alist
-An alist describing how to insert a @code{X-Message-SMTP-Method}
-header before sending out a new message. The key has to be a string,
-that will be matched with the @code{From} header, and will insert the
-value as the SMTP Method if these are equal. Alternatively, the key
-may be a function that will be called in the message buffer without
-any arguments, and matches if a non-nil value is returned.
+An alist describing the rules for generating the
+@code{X-Message-SMTP-Method} header to insert before sending out a new
+message, if the message doesn't yet have such a header. Each element
+of the alist should be of the form
+@w{@code{(@var{cond} . @var{method})}}. If @var{cond} is a string, it
+will be compared with the @code{From} header, and if they compare
+equal, the corresponding @var{method} will be inserted as a string
+into the message headers as the SMTP Method. If @var{cond} is a
+function, it will be called in the message buffer without any
+arguments, and the corresponding @var{method} will be inserted into
+the message headers as the SMTP Method if the function returns a
+non-@code{nil} value; if @var{method} is nil, the value returned by
+the function @code{cond} is used instead.
@end table
*** Message Mode now supports image yanking.
---
-*** New user option 'message-server-alist'
-Enables automatically inserting "X-Message-SMTP-Method" before sending
-a message.
+*** New user option 'message-server-alist'.
+This controls automatic insertion of the "X-Message-SMTP-Method"
+header before sending a message.
** HTML Mode
(autoload 'mml-secure-bcc-is-safe "mml-sec")
(defcustom message-server-alist nil
- "Alist of rules to generate \"X-Message-SMTP-Method\" headers.
-If any entry of the form (COND . METHOD) matches, the header will
-be inserted just before the message is sent. If COND is a
-string, METHOD will be inserted if the \"From\" header matches
-COND. If COND is a function, METHOD will be inserted if COND
-returns a non-nil value, when called in the message buffer
-without any arguments. If METHOD is nil in the last case, the
-return value of the function will be returned instead. None of
-this applies if the buffer already has a\"X-Message-SMTP-Method\"
-header."
+ "Alist of rules to generate \"X-Message-SMTP-Method\" header.
+The header will be inserted just before the message is sent.
+Elements should be of the form (COND . METHOD).
+If COND is a string, METHOD will be inserted if the \"From\"
+address compares equal with COND.
+If COND is a function, METHOD will be inserted if COND returns
+a non-nil value when called in the message buffer without any
+arguments. If METHOD is nil in this case, the return value of
+the function will be inserted instead.
+If the buffer already has a\"X-Message-SMTP-Method\" header,
+it is left unchanged."
:type '(alist :key-type '(choice
(string :tag "From Address")
(function :tag "Predicate"))
:group 'message-sending)
(defun message-update-smtp-method-header ()
- "Check `message-server-alist' to insert a SMTP-Method header."
+ "Insert an X-Message-SMTP-Method header according to `message-server-alist'."
(unless (message-fetch-field "X-Message-SMTP-Method")
(let ((from (cadr (mail-extract-address-components (message-fetch-field "From"))))
method)