[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Elisp: get pop3 password from .authinfo
From: |
Sebastian Schubert |
Subject: |
Elisp: get pop3 password from .authinfo |
Date: |
Wed, 08 Nov 2006 12:21:39 +0100 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.90 (gnu/linux) |
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
- Elisp: get pop3 password from .authinfo,
Sebastian Schubert <=