test_mail_account
Verify whether IMAP mail account settings can connect to the server. Test new credentials directly, or pass a saved account's ID with its masked password to validate existing configurations.
Instructions
Test IMAP connection settings without saving them. Pass the full account fields. To test a SAVED account, pass its id together with the masked password exactly as get_mail_account returns it (all asterisks) — Paperless then uses the stored password (without id it would try the literal asterisks and report a login failure). Note: Paperless 3.2 answers an unreachable server or refused connection with a bare HTTP 500 rather than a message — treat a 500 as 'could not connect'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ID of a saved account whose stored password should be used | |
| name | Yes | ||
| owner | No | ||
| is_token | No | true when `password` is an OAuth/app token | |
| password | Yes | IMAP password or OAuth token. Write-only: Paperless returns it masked as all asterisks (at least 10, one per character), and sending any all-asterisks value back leaves the stored password unchanged. | |
| username | Yes | ||
| imap_port | Yes | Usually 993 (SSL) or 143 (STARTTLS / none) | |
| imap_server | Yes | ||
| account_type | No | 1=IMAP, 2=Gmail OAuth, 3=Outlook OAuth | |
| character_set | No | e.g. UTF-8 (default) or US-ASCII | |
| imap_security | No | 1=no encryption, 2=SSL, 3=STARTTLS |