Message302577
It is not saving the unix from line.
#!/usr/bin/env python3
with open("test.mbox",'w') as f:
f.write("From sender@invalid Thu Nov 17 00:49:30 2016\n")
f.write("Subject: Test\n")
f.write("\n")
f.write("\n")
import mailbox
messages = mailbox.mbox("test.mbox")
for msg in messages:
print(msg.get('subject'))
print(msg.get_from())
print(msg.get_unixfrom()) |
|
Date |
User |
Action |
Args |
2017-09-20 01:05:19 | bpoaugust | set | recipients:
+ bpoaugust, barry, r.david.murray |
2017-09-20 01:05:19 | bpoaugust | set | messageid: <1505869519.0.0.559564062212.issue31524@psf.upfronthosting.co.za> |
2017-09-20 01:05:18 | bpoaugust | link | issue31524 messages |
2017-09-20 01:05:18 | bpoaugust | create | |
|