Introduce a new variable to allow controlling the SMTP user name
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 21 Aug 2011 04:11:59 +0000 (06:11 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 21 Aug 2011 04:11:59 +0000 (06:11 +0200)
* mail/smtpmail.el (smtpmail-smtp-user): New variable.
(smtpmail-try-auth-methods): Use it.

lisp/ChangeLog
lisp/mail/smtpmail.el

index edb2fc2..e383f86 100644 (file)
@@ -1,3 +1,8 @@
+2011-08-21  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * mail/smtpmail.el (smtpmail-smtp-user): New variable.
+       (smtpmail-try-auth-methods): Use it.
+
 2011-08-21  Chong Yidong  <cyd@stupidchicken.com>
 
        * font-lock.el (font-lock-fontify-region)
index 637d101..caec69e 100644 (file)
@@ -86,6 +86,11 @@ The default value would be \"smtp\" or 25."
   :type '(choice (integer :tag "Port") (string :tag "Service"))
   :group 'smtpmail)
 
+(defcustom smtpmail-smtp-user nil
+  "User name to use when looking up credentials."
+  :type '(choice (const nil) string)
+  :group 'smtpmail)
+
 (defcustom smtpmail-local-domain nil
   "Local domain name without a host name.
 If the function `system-name' returns the full internet address,
@@ -490,6 +495,7 @@ The list is in preference order.")
                     (auth-source-search
                      :host host
                      :port port
+                     :user smtpmail-smtp-user
                      :max 1
                      :require (and ask-for-password
                                    '(:user :secret))
@@ -510,6 +516,7 @@ The list is in preference order.")
              :max 1
              :host host
              :port port
+             :user smtpmail-smtp-user
              :require '(:user :secret)
              :create t))
            password (plist-get auth-info :secret)))