Merge remote-tracking branch 'origin/no-gnus'
[gnus] / lisp / message.el
index e925e8c..f32981f 100644 (file)
@@ -682,14 +682,16 @@ Done before generating the new subject of a forward."
        (t
         (error "Don't know how to send mail.  Please customize `message-send-mail-function'"))))
 
-;; Useful to set in site-init.el
-(defcustom message-send-mail-function
+(defun message-default-send-mail-function ()
   (cond ((eq send-mail-function 'smtpmail-send-it) 'message-smtpmail-send-it)
        ((eq send-mail-function 'feedmail-send-it) 'feedmail-send-it)
        ((eq send-mail-function 'sendmail-query-once) 'sendmail-query-once)
        ((eq send-mail-function 'mailclient-send-it)
         'message-send-mail-with-mailclient)
-       (t (message-send-mail-function)))
+       (t (message-send-mail-function))))
+
+;; Useful to set in site-init.el
+(defcustom message-send-mail-function (message-default-send-mail-function)
   "Function to call to send the current buffer as mail.
 The headers should be delimited by a line whose contents match the
 variable `mail-header-separator'.
@@ -1137,6 +1139,7 @@ probably want to set this variable only for specific groups,
 e.g. using `gnus-posting-styles':
 
   (eval (set (make-local-variable 'message-cite-reply-position) 'above))"
+  :version "24.1"
   :type '(choice (const :tag "Reply inline" 'traditional)
                 (const :tag "Reply above" 'above)
                 (const :tag "Reply below" 'below))
@@ -4702,6 +4705,7 @@ If you always want Gnus to send messages in one piece, set
     (push 'mail message-sent-message-via)))
 
 (defvar sendmail-program)
+(defvar smtpmail-smtp-user)
 
 (defun message-multi-smtp-send-mail ()
   "Send the current buffer to `message-send-mail-function'.
@@ -4716,8 +4720,10 @@ that instead."
        ((equal (car method) "sendmail")
        (message-send-mail-with-sendmail))
        ((equal (car method) "smtp")
+       (require 'smtpmail)
        (let ((smtpmail-smtp-server (nth 1 method))
-             (smtpmail-smtp-service (nth 2 method)))
+             (smtpmail-smtp-service (nth 2 method))
+             (smtpmail-smtp-user (or (nth 3 method) smtpmail-smtp-user)))
          (message-smtpmail-send-it)))
        (t
        (error "Unknown method %s" method))))))