Mailing List Archive

Support open source code!


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

Re: How to automate email retrieval



Sounds like you need fetchmail, which pulls mail from
the ISP via POP and delivers it locally (via sendmail or other
mechanism). You can "deliver" to a program using an
alias (e.g. in /etc/aliases), .forward or something procmail.

fetchmail is probably on your system already, or you can
get it from http://tuxedo.org/~esr/fetchmail/

Another option would be to write a program to do this.
The Python (http://www.python.org/) poplib module makes this stuff
simple to do:

import poplib

host = 'pop.primuscapital.com'
user = 'jake'
pw = 'secret'

M = poplib.POP3(host)
M.user(user)
M.pass_(pw)
numMessages = len(M.list()[1])
print "messages: %d" % (numMessages)

#for i in range(numMessages):
#    for j in M.retr(i+1)[1]:
#        print j

 
Regards,
Jake


--- Jean-Christian Imbeault <jean_christian@example.com> wrote:
> This is my first posting to this list so please excuse me if it's off
> topic 
> or too simple ...
> 
> I'm trying to automate mail retrieval on my Red Hat linux 6.2 machine
> from 
> my ISP's POP server. Could anyone point me to some documentation on
> how to 
> do this?
> 
> Ideally I would like to download all the emails and then send then to
> a 
> script for processing.
> 
> Jc
>
_________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at
> http://www.hotmail.com.
> 
>
-----------------------------------------------------------------------
> Next Technical Meeting:  Prof. Jim Breen  Sat, March 10 13:30- 
> Next Nomikai Meeting:    Fri, April 13 19:30- Tengu Tokyo Eki Mae
>
-----------------------------------------------------------------------
> more info: http://www.tlug.gr.jp           Sponsor: Global Online
> Japan
> 


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links