* lisp/message.el (message-multi-smtp-send-mail): New function.
(message-multi-smtp-send-mail): Respect the X-Message-SMTP-Method
header to implement multi-SMTP functionality.
* texi/message.texi (Mail Variables): Document X-Message-SMTP-Method.
** `backtab' in the summary buffer now selects the previous link in
the article buffer.
+** Using the "X-Message-SMTP-Method" header in Message buffers now
+ allows specifying how messages are to be sent. For example:
+
+ X-Message-SMTP-Method: smtp smtp.fsf.org 587
+
* For older news, see Gnus info node "New Features".
----------------------------------------------------------------------
2012-02-02 Lars Ingebrigtsen <larsi@gnus.org>
* message.el (message-multi-smtp-send-mail): New function.
+ (message-multi-smtp-send-mail): Respect the X-Message-SMTP-Method
+ header to implement multi-SMTP functionality.
* gnus-agent.el (gnus-agent-send-mail-function): Removed.
(gnus-agentize): Don't set it.
"Send the current buffer to `message-send-mail-function'.
Or, if there's a header that specifies a different method, use
that instead."
- (funcall message-send-mail-function))
+ (let ((method (message-field-value "X-Message-SMTP-Method")))
+ (if (not method)
+ (funcall message-send-mail-function)
+ (message-remove-header "X-Message-SMTP-Method")
+ (setq method (split-string method))
+ (cond
+ ((equal (car method) "sendmail")
+ (message-send-mail-with-sendmail))
+ ((equal (car method) "smtp")
+ (let ((smtpmail-smtp-server (nth 1 method))
+ (smtpmail-smtp-service (nth 2 method)))
+ (message-smtpmail-send-it)))
+ (t
+ (error "Unknown method %s" method))))))
(defun message-send-mail-with-sendmail ()
"Send off the prepared buffer with sendmail."
+2012-02-02 Lars Ingebrigtsen <larsi@gnus.org>
+
+ * message.texi (Mail Variables): Document X-Message-SMTP-Method.
+
2012-01-31 Lars Ingebrigtsen <larsi@gnus.org>
* gnus.texi (Key Index): Change encoding to utf-8.
requires the @acronym{POP}-before-@acronym{SMTP} authentication.
@xref{POP before SMTP, , POP before SMTP, gnus, The Gnus Manual}.
+@cindex X-Message-SMTP-Method
+If you have a complex @acronym{SMTP} setup, and want some messages to
+go via one mail server, and other messages to go through another, you
+can use the @samp{X-Message-SMTP-Method} header. These are the
+supported values:
+
+@table @samp
+@item smtpmail
+
+@example
+X-Message-SMTP-Method: smtp smtp.fsf.org 587
+@end example
+
+This will send the message via @samp{smtp.fsf.org}, using port 587.
+
+@item sendmail
+
+@example
+X-Message-SMTP-Method: sendmail
+@end example
+
+This will send the message via the locally installed sendmail/exim/etc
+installation.
+
+@end table
+
@item message-mh-deletable-headers
@vindex message-mh-deletable-headers
Most versions of MH doesn't like being fed messages that contain the