Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Elisp: get pop3 password from .authinfo
@ 2006-11-08 11:21 Sebastian Schubert
  2006-11-08 13:02 ` Hadron Quark
  2006-11-08 19:02 ` Johan Bockgård
  0 siblings, 2 replies; 4+ messages in thread
From: Sebastian Schubert @ 2006-11-08 11:21 UTC (permalink / raw)


Hallo,

I want to get the pop3 password from the .authinfo file to have all
password together.  I found a function to do it:
http://groups.google.de/group/de.comm.software.gnus/msg/d3e772d5f684ce68?hl=de&

,----
| (setq mail-sources `(... (pop :server "foo" :user "bar"
|                               :passwd ,(pw-from-authinfo)) ...))
| 
| (defun pw-from-authinfo ()
|   (require 'nntp)
|   (let* ((x (gnus-parse-netrc nntp-authinfo-file))
|          (item (gnus-netrc-machine x "pop"))
|          (pw (gnus-netrc-get item "password")))
|     pw))
`----


I need an additional argument for the server, so I changed the function
to:

,----
| (defun pw-from-authinfo (popserver)
|   (require 'nntp)
|   (let* ((x (gnus-parse-netrc nntp-authinfo-file))
|          (item (gnus-netrc-machine x popserver))
|          (pw (gnus-netrc-get item "password")))
|     pw)) 
`----

and use

:passwd ,(pw-from-authinfo("my.server.org"))

That does not work. Why? Because of the let? What is correct? Can I use
the server string I added in the mail-sources?

Thanks
Sebastian

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

* Re: Elisp: get pop3 password from .authinfo
  2006-11-08 11:21 Elisp: get pop3 password from .authinfo Sebastian Schubert
@ 2006-11-08 13:02 ` Hadron Quark
  2006-11-08 19:02 ` Johan Bockgård
  1 sibling, 0 replies; 4+ messages in thread
From: Hadron Quark @ 2006-11-08 13:02 UTC (permalink / raw)


Sebastian Schubert <sebastian-schubert@gmx.de> writes:

> Hallo,
>
> I want to get the pop3 password from the .authinfo file to have all
> password together.  I found a function to do it:
> http://groups.google.de/group/de.comm.software.gnus/msg/d3e772d5f684ce68?hl=de&
>
> ,----
> | (setq mail-sources `(... (pop :server "foo" :user "bar"
> |                               :passwd ,(pw-from-authinfo)) ...))
> | 
> | (defun pw-from-authinfo ()
> |   (require 'nntp)
> |   (let* ((x (gnus-parse-netrc nntp-authinfo-file))
> |          (item (gnus-netrc-machine x "pop"))
> |          (pw (gnus-netrc-get item "password")))
> |     pw))
> `----
>
>
> I need an additional argument for the server, so I changed the function
> to:
>
> ,----
> | (defun pw-from-authinfo (popserver)
> |   (require 'nntp)
> |   (let* ((x (gnus-parse-netrc nntp-authinfo-file))
> |          (item (gnus-netrc-machine x popserver))
> |          (pw (gnus-netrc-get item "password")))
> |     pw)) 
> `----
>
> and use
>
> :passwd ,(pw-from-authinfo("my.server.org"))
>
> That does not work. Why? Because of the let? What is correct? Can I use
> the server string I added in the mail-sources?

I look forward to seeing the solution to this : I ended up "require"ing
an external file with the smtp specifics for my outgoing email in order
to keep passwords hidden should I ever publish my .gnus or
sections of to help someone.

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

* Re: Elisp: get pop3 password from .authinfo
  2006-11-08 11:21 Elisp: get pop3 password from .authinfo Sebastian Schubert
  2006-11-08 13:02 ` Hadron Quark
@ 2006-11-08 19:02 ` Johan Bockgård
  2006-11-11 11:34   ` Sebastian Schubert
  1 sibling, 1 reply; 4+ messages in thread
From: Johan Bockgård @ 2006-11-08 19:02 UTC (permalink / raw)


Sebastian Schubert <sebastian-schubert@gmx.de> writes:

> |   (let* ((x (gnus-parse-netrc nntp-authinfo-file))
> |          (item (gnus-netrc-machine x "pop"))
> |          (pw (gnus-netrc-get item "password")))

Those functions have been renamed:

gnus-parse-netrc     ->   netrc-parse
gnus-netrc-machine   ->   netrc-machine
gnus-netrc-get       ->   netrc-get

-- 
Johan Bockgård

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

* Re: Elisp: get pop3 password from .authinfo
  2006-11-08 19:02 ` Johan Bockgård
@ 2006-11-11 11:34   ` Sebastian Schubert
  0 siblings, 0 replies; 4+ messages in thread
From: Sebastian Schubert @ 2006-11-11 11:34 UTC (permalink / raw)


bojohan+news@dd.chalmers.se (Johan Bockgård) writes:

> Sebastian Schubert <sebastian-schubert@gmx.de> writes:
>
>> |   (let* ((x (gnus-parse-netrc nntp-authinfo-file))
>> |          (item (gnus-netrc-machine x "pop"))
>> |          (pw (gnus-netrc-get item "password")))
>
> Those functions have been renamed:
>
> gnus-parse-netrc     ->   netrc-parse
> gnus-netrc-machine   ->   netrc-machine
> gnus-netrc-get       ->   netrc-get

Thank you.  It works now:
the function:

(defun pw-from-authinfo (popserver)
  (require 'nntp)
  (let* ((x (netrc-parse nntp-authinfo-file))
         (item (netrc-machine x popserver))
         (pw (netrc-get item "password")))
    pw)) 


in the mail sources:

:password (pw-from-authinfo "your.mail.server")

Is there any reason to not include it in gnus nativly?

Sebastian

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

end of thread, other threads:[~2006-11-11 11:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-08 11:21 Elisp: get pop3 password from .authinfo Sebastian Schubert
2006-11-08 13:02 ` Hadron Quark
2006-11-08 19:02 ` Johan Bockgård
2006-11-11 11:34   ` Sebastian Schubert

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 NNTP newsgroup(s).