get_fernet() only checked for an empty ENCRYPTION_KEY. A non-empty but
malformed key (not 32 url-safe base64 bytes) let Fernet() raise a raw
ValueError that crashed sync_account. Wrap the constructor and re-raise
as EncryptionError with a clear message.
Paperclip-BIT-33940
The finally block in sync_account and retry_single_message only caught
imaplib.IMAP4.error from imap.logout(). When the underlying socket had
already timed out, logout() raises OSError('cannot read from timed out
object') which escaped the handler and crashed the sync run.
Add OSError to the except tuple so cleanup completes cleanly.
Paperclip-BIT-33892
TimeoutError (OSError subclass) escaped the imaplib.IMAP4.error handler
in sync_account, killing the entire sync run on a single slow fetch.
Catch OSError alongside IMAP4.error to skip the timed-out message and
continue scanning.
Paperclip-BIT-33891
Depth:infinity PROPFIND returns HTTP 500 on servers that disable it (Nextcloud/ownCloud/mod_dav). list_files now falls back to recursive Depth:1 traversal, preserving full relative paths for year-folder filtering and dedup.
BIT-33518
Paperclip-Ref: BIT-33518
Some WebDAV servers (Nextcloud, ownCloud, Apache mod_dav with infinite
depth disabled) reject Depth:infinity PROPFIND with HTTP 500/403/501.
list_files now retries with a recursive Depth:1 traversal of child
collections, preserving full relative paths for year-folder filtering
and dedup keys.
BIT-33518
Paperclip-Ref: BIT-33518
WebDAV sync rejected valid files like 1784074260.pdf when the PDF magic
bytes were not at offset 0 (whitespace/BOM) or when a mobile scanner stored
JPEG bytes under a .pdf name. Scan the first 1KB for %PDF-, allow image
fallback for .pdf, and include validation detail in API errors.
Co-authored-by: Cursor <[email protected]>
Add default vs custom IMAP folder selection with live folder fetch in admin UI,
Alembic migration, sync filtering, and API endpoints for mailbox discovery.
Co-authored-by: Cursor <[email protected]>
- Amazon and Temu Playwright-based invoice scrapers
- BizDocs mobile API client (login + document upload)
- ShopAccount DB model, migration 006, scheduler integration
- REST API routes: GET/POST/PATCH/DELETE /api/shop-accounts
- POST /api/shop-accounts/{id}/trigger for on-demand scrape
- POST /api/shop-accounts/{id}/test for BizDocs credential check
- GET /api/shop-accounts/{id}/runs for scrape history
Co-Authored-By: Paperclip <[email protected]>
Account sync jobs were replaced on each schedule refresh, so the 15-minute
interval never elapsed and WebDAV/IMAP sync never ran after worker restarts.
Files under Faturas/2025/ or /2026/ are eligible even when Nextcloud
reports creationdate 1970. Add --requeue-folder-years to reset wrongly skipped records.
Add webdav_include_years account setting, skip files outside allowed year folders during sync, and a setup tool to mark older paths as already forwarded.
Add optional API upload alongside SMTP, Nextcloud/WebDAV as a document source with the same dedup/retry flow as IMAP, stricter invoice file checks for images, and admin UI for source and delivery modes.
Re-sending the original MIME kept Cc/Bcc (e.g. faturas@) so copies
returned to the monitored inbox. Drop extra recipient headers and
send SMTP RCPT only to the BizDocs destination.