Configure Mailimport
In addition to manual upload, PDFs can be imported by email.
How it works
- The email must contain a PDF file.
- The PDF must contain a valid DOCTAG QR code.
- Only if validation is successful, the document is imported.
- If multiple QR codes are found, the PDF is split before each code into separate documents.
Setup
Open Settings > System > E-mail and enter the credentials of a mailbox that is used exclusively by the DOCTAG server.
Mailimport deletes emails from the mailbox after import.
Modern OAuth2 Mail Integration
Starting in 2026, DOCTAG supports secure and universal mailbox integration via OAuth2 (RFC 6749) and XOAUTH2 (RFC 7628). This allows you to connect Google, Microsoft, Yahoo, and many other providers without proprietary APIs or extra libraries.
- ✅ Universal: Works with Google, Microsoft, Yahoo, and any OAuth2 provider
- ✅ Secure: No plain text passwords, tokens are stored encrypted (AES-256)
- ✅ Simple: Unified setup, fewer dependencies
- ✅ Backward compatible: Classic IMAP/POP3 still possible
Supported Providers
- Google: imap.gmail.com
- Microsoft: outlook.office365.com
- Yahoo: imap.mail.yahoo.com
- Others: Any IMAP server with XOAUTH2 support
Setup Steps
- In DOCTAG, go to Settings > System > E-Mail and select provider “OAuth2 (Google, Microsoft, Yahoo)”.
- Select your provider and click “Connect with provider”.
- You will be redirected to the provider and authorize access.
- After successful login, credentials are stored encrypted.
Note: For setup, you may need access to the respective cloud consoles (Google Cloud, Microsoft Azure, Yahoo Developer) to enter the OAuth2 client data. The redirect URL is always: https://<your-domain>/api/oauth2/callback
Security & Token Management
- All OAuth2 tokens are stored encrypted with AES-256.
- Automatic token refresh, no manual action required.
- If problems occur (e.g. expired tokens), simply re-authorize.
Migration & Compatibility
- Existing IMAP/POP3 mailboxes continue to work (legacy mode).
- For new Google/Microsoft/Yahoo mailboxes, OAuth2 is strongly recommended.
Troubleshooting
- "XOAUTH2 not supported": Mail server does not support XOAUTH2 – please use legacy mode.
- "Invalid access token": Token expired – please re-authorize.
- "OAuth2 configuration missing": Check OAuth2 client data in environment variables.