unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22824: Use smtpmail-smtp-user if auth-source-search doesn't return user field
@ 2016-02-27  7:52 Jun Hao
  2016-02-28  5:32 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Jun Hao @ 2016-02-27  7:52 UTC (permalink / raw)
  To: 22824

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]

Hi,

On OSX when calling auth-source-search to search from keychain with
account has '\' in it, the function doesn't return user info back but
only password. This patch is to fix smtpmail if for whatever reason
above situation happened.

Long term is to fix auth-source-search. Looks like it missed this case
in auth-source-macos-keychain-search-items. If account has '\' in it,
security will return something like:

"acct"<blob>=0x414E545C6A756E68616F  "ANT\134junhao"

instead of form current code expects:

"acct"<blob>="junhao"

Even auth-source-search is fixed, I still think this patch is nice
to have to make smtpmail more robust.

Thanks - Jun


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Use-default-user-if-auth-search-doesn-t-return-one.patch --]
[-- Type: text/x-patch, Size: 1006 bytes --]

From 6306eddd9bf0fe3b47ea4139337792761d32a61b Mon Sep 17 00:00:00 2001
From: Jun Hao <jun_hao@aol.com>
Date: Sat, 27 Feb 2016 15:01:35 +0800
Subject: [PATCH] Use default user if auth search doesn't return one

* smtpmail.el (smtpmail-try-auth-methods):Use smtpmail-smpt-user if
auth-source-search doesn't return user field

Copyright-paperwork-exempt: yes
---
 lisp/mail/smtpmail.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index 8e0bb3a..be9807f 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -505,7 +505,7 @@ The list is in preference order.")
 		      :require (and ask-for-password
 				    '(:user :secret))
 		      :create ask-for-password)))
-         (user (plist-get auth-info :user))
+         (user (or (plist-get auth-info :user) smtpmail-smtp-user))
          (password (plist-get auth-info :secret))
 	 (save-function (and ask-for-password
 			     (plist-get auth-info :save-function)))
-- 
2.7.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-04-25 14:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-27  7:52 bug#22824: Use smtpmail-smtp-user if auth-source-search doesn't return user field Jun Hao
2016-02-28  5:32 ` Lars Ingebrigtsen
2016-02-28  9:07   ` Jun Hao
2016-02-29  2:22     ` Lars Ingebrigtsen
     [not found]       ` <m2si09f19c.fsf@aol.com>
2016-03-02 16:58         ` Lars Ingebrigtsen
     [not found]           ` <m2k2ljfyuj.fsf@aol.com>
2016-03-03 16:54             ` Lars Ingebrigtsen
2016-03-03 16:59               ` Glenn Morris
     [not found]                 ` <m2mvqegwtu.fsf@aol.com>
     [not found]                   ` <m2bn5d7fjw.fsf@aol.com>
2016-04-24 12:37                     ` Lars Magne Ingebrigtsen
2016-04-24 12:43                       ` Lars Magne Ingebrigtsen
2016-04-25 14:41                         ` Jun Hao

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).