i want to make one program that the steps like this:Can be done via the standard imaplib module. No need to use twisted.
1. download email from email account, for example: ag**@yahoo.com, saved
in a file, for example: downloadedEmail.txt
2. parsing the downloadedEmail.txt, get the sender, subject and theSave it as an eml file. Use the standard email.Parser module for
message.if there is attachmet/s, not be taken.
extracting headers.
3. posting the downloadedEmail.txt that has been parsed into nntp server.I have no clue about it.
4. open nntp client for example 'thunderbird' to acces your nntp server.
i attach my programs to u..Well, I can send you some examples that show how to download and parse
it is very important for me as final project in my study class, too
difficult for me....thanks for your help!!!
emails from imap server. I have never used nntp before so....
Some examples are attached, and also a code fragment:
IMAPDate.py - to convert between IMAP and datetime.date
imaputils.py - to show how to connect to IMAP server and list folders on
it (you need to create your own local.py file...), also shows how to
append a new message to a folder on the imap server.
code_fragment.py - to show how to search for messages on the server and
download them as pure data string, it is NOT a complete program!
And finally, here is how you parse and email:
import email.Parser
email_data = file('test2.eml','rb').read()
parser = email.Parser.Parser()
Then you need to example "parser" and its methods.
Anyway, it is your homework, I don't think that I'm going to give more
help unless you have a specific question. :-)
Best,
Laszlo