IMAP Email Question

Charel Yueng cy at no-spam-artic.net
Fri Jul 5 02:41:48 EDT 2002


I am trying to use the imaplib module to read messages in a remote
mailbox and enter the data retrieved from the BODY[TEXT] into a mysql
database for later processing.  I have formatted the email to be:
fname=charles
fname=yueng
address=someaddress

when I get the mail thru Imap it comes in with:
('OK', [('2 (BODY[TEXT] {378}',
'fname=charles\r\nfname=yueng\r\naddress=someaddress\r\n\r\n\r\n),
')', '2 (FLAGS (\\Seen))']) 

I  cannot process any string data because it's a tuple. I can't seem
to be able to parse any data. 

What should be my approach to this problem?
what I need to extract is separated by the '=' sign ie.
charles,yueng,someaddress

I then copy the message to another mailbox end then expunge it from
the INBOX (that all works great)

Any help would be appreciated

Charles






More information about the Python-list mailing list