Save the evidence, not only the filename

A useful email-attachment automation records where each file came from and proves that usable content reached the destination. Keep mailbox identity, message ID, attachment ID, original filename, received time, saved-file ID and processing state. A filename such as invoice.pdf is not unique, and an attachment record is not proof that its content bytes were retrieved.

Microsoft documents attachment metadata arriving without content bytes. Configure content retrieval deliberately and test the saved file before allowing it into extraction or review.

Design the intake route

  1. Choose an authorized bookkeeping mailbox and a restricted intake folder. Confirm the account running the connection can access both.
  2. Capture new messages and classify whether they contain candidate business attachments, no attachments or only inline images. Keep all relevant message outcomes visible.
  3. Retrieve each accepted attachment’s actual content. Save under a collision-resistant name or path while retaining its original name in the manifest.
  4. Verify the saved object is nonempty and corresponds to the expected attachment identity. Record its destination ID and size.
  5. Move only verified files to the next processing state. Keep retrieval failures and unsupported content in an owned exception queue.

Do not open or execute attachments simply because they passed a filename filter. Use the organization’s approved security and file-handling process before any downstream processing.

Use four synthetic messages

MessageContentsExpected intake result
M1A1 invoice.pdf, nonempty PDFOne saved candidate linked to M1/A1
M2No attachmentNo-file outcome; review if a file was expected
M3Inline logo.png onlyExcluded inline-image outcome
M4A4 invoice.pdf, different nonempty PDFSeparate saved candidate linked to M4/A4

Expect two distinct saved candidates despite the repeated invoice.pdf name. M2 and M3 must not disappear from the intake manifest. The two saved file IDs must differ, and opening the approved test files should reveal the correct fictional content for each message. These are proposed test cases, not emails processed from a customer mailbox.

Make mailbox behavior part of the handover

Microsoft notes that moving old mail does not trigger a new-arrival flow. Do not test historical catch-up by dragging archived messages into the watched folder and assuming they will be processed. Give archive intake its own deliberate path and overlap checks.

For shared mailboxes, preserve which mailbox owns the message ID when retrieving attachments. If content retrieval fails, log the message and attachment references without copying sensitive full message bodies into general error logs. Name a person who can resolve permission problems and inspect the original message.

Test retries and downstream readiness

Replay M1 and require the same intake identity to link to one saved candidate, not a new duplicate. Keep M4 distinct even though its filename matches. Set A1 content retrieval to empty in a test and require a failed intake state rather than a successfully processed invoice. Confirm that no-file and inline-only outcomes have an owner when follow-up is needed.

ParseMill can work with supported invoice PDFs after they have been obtained through your approved process, with review before Excel export. The mailbox connection described here is a proposed external workflow requiring separate setup. Bring the mailbox, file types and desired review boundary to a ParseMill workflow discussion.

Assisted setup with ParseMill

Turn one intake task into a reviewed workflow

Start with one type of message or document, its expected result and the cases that need a person. We can scope an assisted setup with clear review and delivery checks.

Discuss this deployment

Describe your tools, the repeated task, its frequency and the result you need. We agree the scope and any fee before starting. Third-party connections need their own fit assessment; sending a request does not activate an integration.

For supplier invoice PDFs, try the invoice-to-Excel example to see ParseMill’s extraction, source review and workbook export.

Sources and editorial notes

Written by ParseMill. Worked examples are illustrative process examples, not customer results. Software availability can vary by subscription and region; check the linked documentation for your account. Review decisions and approvals remain with your team.

Explore the wider workflow