This is an extraction of a useful pattern for pulling emails and their attached files and processing them.
Kirk Haines
MIT