logging.warn("ATTENTION: If you continue, the files\n {}\n {} will be overwritten, if they exist. Make sure that do not have any pending unsent messages!".format(mbox_path,mbox_msf_path))
if(input("Do you want to continue (enter 'yes')? ").lower()!="yes"):
logging.debug("Exiting program because user did not confirm to continue")
exit(0)
# Delete mailbox file and corresponding summary/index file
mbox_path.unlink(missing_ok=True)
mbox_msf_path.unlink(missing_ok=True)
withopen(mail_body_file)asbody_fh:
mail_body=body_fh.read()
mbox=mailbox.mbox(mbox_path)
mbox.lock()
try:
msg=mailbox.mboxMessage()
msg.set_unixfrom('author Sat Feb 7 01:05:34 2009')