source: sandbox/expressoMail1_2/corretor_ortografico/imap.py @ 1000

Revision 1000, 452 bytes checked in by rafaelraymundo, 12 years ago (diff)

Ticket #550 - Unificação de funcionalidade do SERPRO referentes ao arquivamento local.

Line 
1import imaplib
2import sys
3import base64
4
5host=sys.argv[1]
6port=int(sys.argv[2])
7user=sys.argv[3]
8password=sys.argv[4]
9date_time=int(sys.argv[5])
10mailbox=sys.argv[6]
11imap_file = open(sys.argv[7],"r")
12tmp=imap_file.read()
13message=base64.b64decode(tmp)
14#print message
15imap_file.close()
16M = imaplib.IMAP4(host,port)
17M.login(user,password)
18flags="\\Seen"
19M.append(mailbox,flags,date_time,message)
20#print mailbox+flags+date_time+message
21M.logout()
22#M.close()
Note: See TracBrowser for help on using the repository browser.