Well, I will show you how to do something like these.
Scenario: An chronological script will download new e-mails, then a Python script will process on these e-mails.
For downloading e-mails, I used getmail4. The best tutorial for it can be found here.
For my case, /home/manchurian/.getmail/getmailrc looks like this:
[retriever] type = SimplePOP3Retriever server = [my_mail_server] username = [my_mail] password = [my_mail_password] [destination] type = Mboxrd path = /home/manchurian/inbox
Make the mail downloading automatic using crontab -e
:
* * * * * getmail -n
-n
is for retrieving new mails only.
Now it is time to process the downloaded mails anyway you want:
import mailbox mails = mailbox.mbox("/home/manchurian/inbox") mails.lock() try: for m in mailbox: if m['from'] == 'abc@abc.org': print m['subject'] finally: mails.unlock()Cheers,
blogoor ni zochilloo,ene mergejliig ezemshij bui humuust medeelel uguhuur blog bn gj bodloo, amjilt hu:)
ReplyDeleteHumuus Anonymous reply hiiheer haanahiin hen gedeg ni medegdehgui :(
ReplyDeletehehe,Zulaa bnaa.Bi sain yavj irsen kk,ta nar bgagui bol ongotsnooso hotsroh bsan shu gj:)
ReplyDeleteaan ashgui dee neeree sandargasan shuu te hehe, avtobusand bsan humuus dooglood ineej bsanuu hehe.
ReplyDeleteNice information, valuable and excellent design, as share good stuff with good ideas and concepts, lots of great information and inspiration, both of which I need, thanks to offer such a helpful information here. youtube to mp3 converter
ReplyDelete