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

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

Re: Help with simple function


From: Adrian Aichner
Subject: Re: Help with simple function
Date: 09 Jan 2003 20:28:03 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Native Windows TTY Support (RC1))

>>>>> "Peter" == Peter Davis <address@hidden> writes:

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

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

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

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

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

See
`mail-sources' (buffer: .gnus, mode: Emacs-Lisp)


Customizable user variable:

  value: see below

  *Where the mail backends will look for incoming mail.
  This variable is a list of mail source specifiers.
  See Info node `(gnus)Mail Source Specifiers'.

Adrian

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

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

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

    Peter> Thanks *very* much,

    Peter> -pd


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

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

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


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

-- 
Adrian Aichner
 mailto:address@hidden
 http://www.xemacs.org/


reply via email to

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