help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help with simple function


From: Peter Davis
Subject: Help with simple function
Date: 09 Jan 2003 11:22:32 -0500
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Military Intelligence (Windows))

I'm using gnus to read mail and news.  For various reasons (explained
below, if anyone's interested), I use my own Perl script to fetch mail
from a couple of different POP3 servers.  I have a simple function
which calls the Perl script:

(defun pd-fetch-mail ()
  (interactive)
  (message "Running popfetch.pl... ")
  (shell-command "perl c:/home/popfetch.pl")
  )

This works perfectly.  However, because the Perl script is stateless,
I keep all the POP account information, including passwords, in a
file.  I *hate* that.  What I'd like to do is:

1) Keep all the POP account info in a list, sort of like:

    (setq pop-servers '((:server mail.myhomeisp.com
                         :username "pd"
                         :password ""
                         :lmos t)
                        (:server mail.mywork.com
                         :username "pdavis"
                         :password ""
                         :lmos nil)
                        ))

2) Have emacs/XEmacs prompt for the password the first time this is
   used, and store it in there (so I don't have to keep it in my .gnus
   file)

3) Call the Perl script once for each server, passing the arguments,
   password, etc.

I'm sure this can all be done, but I'm not lisp-savvy enough to know
how to do it.  Anyone have some code that does anything like this that
I can use as a starting point?  I don't even know how to create the
pop-servers variable so it will accept this list format.

Thanks *very* much,

-pd


P.S. - If you want to know *why* I'm using my own Perl script, it's
basically for two reasons:

1) I keep track of UIDLs, so can I leave messages on the POP server,
   and not fetch them over and over again, and

2) I add X-POP-Server and X-POP-UIDL fields to the mail headers.  I
   have another lisp function which writes the UIDL to a file whose
   name is the server name.  That way, I can selectively delete
   messages from the POP server if I've left them there.


-- 
--------
                             Peter Davis
               Funny stuff at http://www.pfdstudio.com
                 The artwork formerly shown as prints
    List of resources for children's writers and illustrators at:
                  http://www.pfdstudio.com/cwrl.html


reply via email to

[Prev in Thread] Current Thread [Next in Thread]