Revision 3911,
446 bytes
checked in by brunocosta, 14 years ago
(diff) |
Ticket #1694 - Coloca os flags das mensagens desarquivadas.
|
Rev | Line | |
---|
[1000] | 1 | import imaplib |
---|
| 2 | import sys |
---|
| 3 | import base64 |
---|
| 4 | |
---|
| 5 | host=sys.argv[1] |
---|
| 6 | port=int(sys.argv[2]) |
---|
| 7 | user=sys.argv[3] |
---|
| 8 | password=sys.argv[4] |
---|
| 9 | date_time=int(sys.argv[5]) |
---|
| 10 | mailbox=sys.argv[6] |
---|
| 11 | imap_file = open(sys.argv[7],"r") |
---|
| 12 | tmp=imap_file.read() |
---|
| 13 | message=base64.b64decode(tmp) |
---|
| 14 | #print message |
---|
| 15 | imap_file.close() |
---|
| 16 | M = imaplib.IMAP4(host,port) |
---|
| 17 | M.login(user,password) |
---|
[3911] | 18 | flags="" |
---|
[1000] | 19 | M.append(mailbox,flags,date_time,message) |
---|
| 20 | #print mailbox+flags+date_time+message |
---|
| 21 | M.logout() |
---|
| 22 | #M.close() |
---|
Note: See
TracBrowser
for help on using the repository browser.