用于从mbox文件导出附件的实用程序
mboxattachments的Python项目详细描述
mboxattachments是一个Python类,用于提取 一组电子邮件它是为了帮助 摄影俱乐部。俱乐部成员会定期发送电子邮件 包含给俱乐部秘书的图像秘书会手动 保存附件,组织这些文件,并为 成员。手动保存过程耗时且容易出错。
此实用程序允许下载一组电子邮件中的所有附件 包含在MBOX文件中。方便的是,gmail允许导出电子邮件 作为MBOX文件
安装
在debian和Windows7上,下面的代码可以工作
pip install mboxattachments
运行
mboxattachments --exportpath images emails.mbox
示例
mboxattachments --filter_from flur --exportpath images emails.mbox
以上行将测试文件emails.mbox中的所有电子邮件 要查看发件人名称(from字段)是否与正则表达式匹配 弗勒。如果邮件匹配,则其所有附件都将写入 映像目录中的文件。
mboxattachments --SQstart 1000 --exportpath images emails.mbox
上面的命令将保存中每个文件的附件 电子邮件.bmox。文件名的格式如下 1000平方米…。, SQ1001…., SQ1003….
选项
options: specify output directory filter by sender filter by recipient filter by date specify destination diretory for attachments set sequence number field starting value (default 0) usage: mboxattachments [--help] [--version] [--debug] [--filter_from regexp] [--filter_to regexp] [--filter_date regexp] [--exportpath path] [--SQstart value] input_mbox_file ... attachments are stored as separate files file names are of the form <sequence number>-<email subject>-<email sender>-<file name of attachment> for example, a possible file name is SQ0146-CellPhone - Action-johndoe@gmail.com-myPrettyPicture.jpg ------ ------------------ ----------------- ------------------- seqnum email subject sender file name in email
网站
http://www.chuck-jackson-photos.com/mboxattachments
下载
http://www.chuck-jackson-photos.com/mboxattachments/mboxattachments-0.5.32.tar.gz