IMAP email source
Version: 3.2.0 Date: 2026-11-17
Goal: A client can send scanned photos by email and Tower protects each attachment the same way it polls an FTP directory.
Solution: One IMAP connector (imapflow + mailparser). The mailbox is polled on the hourly discover and on demand from the source page. Each matching attachment becomes a task. The last IMAP UID is the cursor, stored like the FTP last-trigger timestamp.
Features:
- Source type
emailin YAML and in the workflow wizard (host,user:password, mailbox, sender allowlist, extensions) - Default mailbox
INBOX, default extensions.jpg .jpeg .png .tif .tiff .pdf - Check now on an FTP or email source page, disabled when the source is disconnected or when saved changes are not reloaded yet
- Pending reload badge when the source is connected but its saved config is not the one Tower is running
- Hourly discover skips FTP and email sources whose init report has a failed connection entry
Implementation Details:
POST /api/v1/config/source/watchwith{ name }so a source name that contains spaces is not part of the URL- Watch refuses with 409 while that source differs from the last reloaded snapshot (
pendingSourcesonGET /ping) - First poll (no cursor) only takes unseen mail; later polls take every UID after the cursor, including mail already marked read
DataService.isSourceDisconnectedis the shared rule used by FTP and email discover
Files Modified:
src/protocol/source/email/- IMAP poll, filters, task queuesrc/protocol/source/source.service.ts- discover and per-source watchsrc/protocol/source/ftp/ftp.service.ts- watch count and disconnected skipsrc/core/data/data.service.ts- shared disconnected checksrc/app.controller.ts-POST config/source/watchsrc/config.dto.ts- email fields and watch bodysrc/core/configuration/config.schema.ts- email config validationui/src/pages/workflows/- wizard, summary, Check nowdocs/user/configuration/sources.md- email source (EN and FR)docs/user/configuration/examples.md- email YAML example (EN and FR)
Release fragment: feat-email-source