Skip to content

Inbox

The Inbox page monitors shared folders and email accounts for incoming PDFs, automatically processes them through the document pipeline, and presents them for review. Documents can arrive by drag-and-drop to the shared Z: drive folders or automatically from configured Outlook email accounts.

How the Inbox Works

The Inbox combines two systems: a folder watcher that scans the shared Z: drive for new PDFs, and an email fetcher that pulls PDF attachments from Outlook mailboxes via Microsoft Graph API. Both feed into the same processing pipeline.

Z: Drive (Drag & Drop)

Place PDF files into the shared inbox folders on the Z: drive. The watcher detects them, runs OCR, entity matching, and LLM refinement automatically. Files appear on the Inbox page ready for review.

Email Fetch (Graph API)

Configure dedicated email addresses for invoices and documents. The system fetches unread PDF and DOCX attachments, converts DOCX to PDF, and saves them to the Z: drive inbox folders for processing.

Inbox Folders

FolderPathPurpose
Invoice InboxZ:\Shared\BBT Asset Management Inc\Inbox\InvoicesIncoming invoices from email or drag-and-drop
Document InboxZ:\Shared\BBT Asset Management Inc\Inbox\DocumentsIncoming documents from email or drag-and-drop

Each folder has a temp subfolder where processing results are cached. This allows multiple PCs to share the same inbox without reprocessing files another machine already handled.

Inbox Watcher

The Inbox Watcher is a background process that continuously monitors the inbox folders. It starts automatically when the dashboard opens with a 30-second delay before the first scan, then scans every 30 seconds.

The watcher toggle appears in the sidebar on every page. When enabled, the watcher:

  1. Fetches new email attachments (if email fetch is enabled)
  2. Scans both inbox folders for new PDFs
  3. Processes any unprocessed files through the appropriate pipeline (invoice or document)
  4. Caches results so they load instantly on the Inbox page

Inbox Page

Inbox page showing two processed invoices in 2-column layout

The Inbox page displays all files found in the inbox folders with their extracted data. Each document shows a PDF preview alongside its detected fields, just like the Invoice and Document processing pages.

View Settings

ControlDescription
Single column viewSwitch between 2-column and single-column layout
Fetch email on scanWhen checked, clicking Scan Now fetches email attachments before scanning folders

Actions

ButtonDescription
Scan NowImmediately scans inbox folders for new files. If “Fetch email on scan” is checked, fetches from email first.
RefreshReloads processed results from disk without re-scanning

Save Options

ControlDescription
Assign PMAutomatically assign property managers when uploading to Monday.com
DestinationsChoose where to save: Monday.com, Server, or both
Save & RemoveSave all items to selected destinations and delete originals from the inbox
Save OnlySave without removing originals
Remove AllDelete all files from the inbox without saving

Document Actions

Each document in the Inbox has a toolbar with the following actions:

ButtonAction
X (Remove)Removes the document from the processing stack and deletes the original file from the inbox folder
DownloadDownloads the document with its generated filename
EmailOpens the email dialog to send the document to recipients
Type dropdownSwitch between Invoice and Document processing for this file

Email Fetch Setup

The email fetcher uses Microsoft Graph API to read PDF and DOCX attachments from configured mailboxes. No classic Outlook installation is required.

Email fetch settings showing Graph API mode with signed-in status

Configuration

Email fetch settings are in the Email Settings expander on the sidebar.

  1. Enable email fetch Check Enable email fetch to activate the feature.

  2. Select fetch method Choose Graph API from the Fetch method dropdown. Graph API works on any PC without needing classic Outlook installed.

  3. Sign in for mail read Click Sign In for Mail Read. A link and code will appear. Open the link in your browser, enter the code, and sign in with your Microsoft account. Return to the dashboard and click Signed in to confirm.

  4. Enter mailbox email addresses Enter the email address for the invoice mailbox and/or document mailbox. These can be your own mailbox or shared mailboxes you have delegate access to.

  5. Configure cutoff date (optional) Check Use cutoff date and select a date to only fetch emails received on or after that date. When unchecked, only unread emails are fetched.

How Email Fetch Works

When email fetch runs (either via the watcher or manually through Scan Now):

  1. The system authenticates with Microsoft Graph API using the stored token
  2. It queries the configured mailbox for unread emails (filtered by cutoff date if enabled)
  3. PDF and DOCX attachments are downloaded to the Z: drive inbox folder
  4. DOCX files are automatically converted to PDF (using Word COM if available, otherwise a text-based fallback)
  5. Processed message IDs are tracked locally to prevent re-downloading the same email
  6. The regular inbox scanner then picks up the new files for processing

Duplicate Prevention

The email fetcher tracks which emails have already been downloaded using a local tracking file. Each email’s unique message ID is recorded after its attachments are saved. On subsequent fetch cycles, emails already in the tracking list are skipped.

To re-fetch an email that was already downloaded, delete the tracking file at:

C:\Users\{username}\Documents\document_preprocessor\inbox\processed_graph_ids.json

Then restart the dashboard. The next fetch cycle will re-download all unread emails matching the current settings.

Security

Token Encryption

Authentication tokens for both email sending and mail reading are encrypted at rest using Windows DPAPI (Data Protection API).

Both files are in C:\Users\{username}\Documents\document_preprocessor\. DPAPI encryption ties the tokens to the Windows user account that created them. They cannot be decrypted on another machine or by another user.

Permissions

The email fetcher uses the following Microsoft Graph API permissions:

ScopePurpose
Mail.ReadRead emails from the signed-in user’s mailbox
Mail.Read.SharedRead emails from shared/delegate mailboxes
Mail.SendSend emails (used by the invoice email feature, separate sign-in)

Multi-PC Workflow

The Inbox is designed for multi-PC environments where multiple team members share the same Z: drive inbox folders.

  • Processing results are cached in the temp subfolder. If one PC processes a file, other PCs loading the Inbox page will see the cached result instantly without re-processing.
  • File hashing ensures each file is identified uniquely. Moving or renaming a file outside the system will cause it to be re-processed.
  • Save & Remove deletes the original file and its cache after saving, preventing other PCs from showing stale data.

Quick Reference