From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/80840 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: Re: smtpmail authentication again Date: Sun, 08 Jan 2012 14:36:44 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87fwfqouk3.fsf@lifelogs.com> References: <87d3awtgda.fsf@lifelogs.com> <878vlktfy6.fsf@lifelogs.com> <874nw7slnv.fsf@lifelogs.com> Reply-To: ding@gnus.org NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1326051490 6344 80.91.229.12 (8 Jan 2012 19:38:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 8 Jan 2012 19:38:10 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M29122@lists.math.uh.edu Sun Jan 08 20:38:04 2012 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RjyZA-0003Ig-Ii for ding-account@gmane.org; Sun, 08 Jan 2012 20:38:04 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1RjyYU-0003ZD-LF; Sun, 08 Jan 2012 13:37:22 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1RjyYS-0003Yz-V2 for ding@lists.math.uh.edu; Sun, 08 Jan 2012 13:37:20 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1RjyYP-0006RA-FQ for ding@lists.math.uh.edu; Sun, 08 Jan 2012 13:37:18 -0600 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1RjyYM-0002iP-Lo for ding@gnus.org; Sun, 08 Jan 2012 20:37:14 +0100 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RjyYL-0002va-EB for ding@gnus.org; Sun, 08 Jan 2012 20:37:13 +0100 Original-Received: from c-76-28-40-19.hsd1.vt.comcast.net ([76.28.40.19]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 08 Jan 2012 20:37:13 +0100 Original-Received: from tzz by c-76-28-40-19.hsd1.vt.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 08 Jan 2012 20:37:13 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-Lines: 58 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-76-28-40-19.hsd1.vt.comcast.net X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Copies-To: never User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux) Cancel-Lock: sha1:WwrBFv31fKj0dD3WsGxA1poAr6w= X-Spam-Score: -4.9 (----) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:80840 Archived-At: On Sat, 07 Jan 2012 15:45:54 +0100 Richard Riley wrote: RR> Ted Zlatanov writes: >> On Sat, 07 Jan 2012 06:33:11 +0100 Richard Riley wrote: >> RR> So long as the passwords are encrypted in the authinfo.gpg.... >> >> .gpg files are always encrypted if EPA/EPG is enabled, so yes. >> >> You can also encrypt individual passwords in an otherwise unencrypted >> netrc/authinfo file with `auth-source-netrc-use-gpg-tokens'. But they >> are not usable with other tools then. RR> ,---- RR> | Documentation: RR> | Set this to tell auth-source when to create GPG password RR> | tokens in netrc files. It's either an alist or `never'. RR> | Note that if EPA/EPG is not available, this should NOT be used. RR> `---- RR> I dont understand the docstring. How does auth-source create passwords? `auth-source-search' can, in some cases, create a whole entry, including a password. If this is created in an unencrypted file, you can choose to encrypt just the password. Also there's a "plstore" auth-source backend (in addition to the "netrc" default backend) which stores passwords and other secrets safely in an otherwise unencrypted file. RR> While on the subject, whats the best elisp example/snippet to get a RR> password from the authinfo based on only machine name or machine name RR> and user id so I can use this in other elisp apps (e.g use authinfo to RR> get my irc password from .authinfo.gpg). Which IRC client? I had a ERC patch a while ago but Deniz Dogan (the maintainer then IIRC) didn't have the time to work on it. In any case, I'd rather submit a patch to the IRC client so you don't have to do this yourself. To answer your question about how to search, and assuming you don't want to auto-create entries: (let* ((auth-info (car (auth-source-search :host "yourhost.com" :user "yourusername" :max 1 :require '(:user :secret) :create nil))) (user (plist-get auth-info :user)) (password (plist-get auth-info :secret))) (when (functionp password) (setq password (funcall password))) (list user password auth-info)) If this returns nil, you can repeat the search without the :user query, so you'll get any "yourhost.com" entries. Ted