Skip to main content

mboxattachments

mboxattachments is a Python class for extracting all embedded files in a group of emails. It was developed to assist in the running of a photography club. Members of the club would regularly send emails containing images to the club secretary. The secretary would manually save the attachments, organize those files, and prepare a show for the members. The manual saving process was time consuming and error prone.

This utility allows downloading all the attachments in a set of emails contained in an mbox file. Conveniently, gmail permits exporting emails as mbox files

Installation

On debian and Windows 7 the following is known to work

pip install mboxattachments

Running

mboxattachments --exportpath  images  emails.mbox

Examples

mboxattachments --filter_from flur  --exportpath images emails.mbox

The above line will test all email messages in the file emails.mbox to see the the senders name (FROM field) matches the regular expression flur. If an mail matches, all of its attachments will be written to a file in the directory images.

mboxattachments --SQstart 1000  --exportpath images emails.mbox

The above command will save the attachments from every file in emails.bmox. The file names will be of the form SQ1000…., SQ1001…., SQ1003….

Options

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

Website

http://www.chuck-jackson-photos.com/mboxattachments

download

http://www.chuck-jackson-photos.com/mboxattachments/mboxattachments-0.5.32.tar.gz

Metadata

Release files for mboxattachments 0.5.35

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mboxattachments 0.5.35
File Size Uploaded
mboxattachments-0.5.35.tar.gz 8.9 kB Details

Release files / mboxattachments-0.5.35.tar.gz

Download URL mboxattachments-0.5.35.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
890e35dd91f12587d9304b90b9ff0de1380eb464b37d2d308139934e9854796e
BLAKE2b-256 checksum
How to use checksums
a9bcd973d5b92b93bc8d7ab5e32ac5945def38498f369240339bbb410e71ae54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.5.35 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page