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

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).