askrobots / dbbasic-object-server
Public
Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.
danq9
signup: the person chooses the password and name on the confirm page
83c7aa6
2 weeks, 5 days ago
History
mail_accounts.json · 3.6 KB · 45 lines
| 1 | { |
| 2 | "name": "mail_accounts", |
| 3 | "title": "Mail Accounts", |
| 4 | "version": 1, |
| 5 | "description": "One IMAP mailbox a person asked this server to copy into their inbox. The password is deliberately NOT a field: a record is readable, listable, exported and backed up, and a secret must be none of those (docs/secrets-and-credentials.md). It lives in the owner's identity vault under the service name imap-<this account's id>, written through PUT /identity/users/{user_id}/service-keys and never readable back; the /mail/accounts page shows only whether it is set. The sync_* fields and last_synced_at belong to system_mail_sync: last_synced_at is when the account was last found up to date (refreshed at most hourly while nothing arrives, so an idle account does not rewrite its row every pass), sync_started_at/sync_finished_at are the claim a pass holds while it writes, and sync_attempts/sync_error say how many passes in a row have failed and what the server said. sync_attempts is the one status field the owner may write: setting it to 0 skips the wait after failures and tries again on the next pass.", |
| 6 | "fields": [ |
| 7 | {"name": "id"}, |
| 8 | {"name": "label", "type": "text", "label": "Name", "validation": {"max_length": 100}, |
| 9 | "help": "What you call this mailbox, for example Work."}, |
| 10 | {"name": "email_address", "type": "text", "required": true, "label": "Email address", |
| 11 | "validation": {"max_length": 254, "pattern": "^[^\\s@]+@[^\\s@]+$"}, |
| 12 | "help": "Mail sent from this address is shown as sent by you."}, |
| 13 | {"name": "host", "type": "text", "required": true, "label": "IMAP server", |
| 14 | "validation": {"max_length": 253, "pattern": "^[A-Za-z0-9.-]+$"}, |
| 15 | "help": "A host name such as imap.example.com, no https:// and no port."}, |
| 16 | {"name": "port", "type": "integer", "label": "Port", |
| 17 | "help": "Blank means 993 for ssl and 143 for starttls."}, |
| 18 | {"name": "security", "type": "enum", "default": "ssl", "enum": ["ssl", "starttls", "plain"], |
| 19 | "label": "Security", |
| 20 | "help": "ssl (port 993) or starttls (port 143). plain sends the password unencrypted and is refused for anything but this machine itself."}, |
| 21 | {"name": "username", "type": "text", "label": "User name", |
| 22 | "validation": {"max_length": 254, "pattern": "^[^\\r\\n]*$"}, |
| 23 | "help": "Blank means the email address."}, |
| 24 | {"name": "folders", "type": "text", "label": "Folders", |
| 25 | "validation": {"max_length": 1000, "pattern": "^[^\\r\\n]*$"}, |
| 26 | "help": "Comma-separated. Blank means INBOX plus the Sent folder, found on the first sync and written here."}, |
| 27 | {"name": "enabled", "type": "boolean", "default": "true", "label": "Sync this account"}, |
| 28 | {"name": "last_synced_at", "type": "datetime", "label": "Last synced", "read_only": true}, |
| 29 | {"name": "sync_started_at", "type": "datetime", "label": "Sync started", "read_only": true}, |
| 30 | {"name": "sync_finished_at", "type": "datetime", "label": "Sync finished", "read_only": true}, |
| 31 | {"name": "sync_attempts", "type": "integer", "default": "0", "label": "Failed syncs in a row", |
| 32 | "help": "Set to 0 to try again at once instead of waiting."}, |
| 33 | {"name": "sync_error", "type": "text", "label": "Last error", "read_only": true, |
| 34 | "validation": {"max_length": 500}}, |
| 35 | {"name": "owner_id", "type": "text", "label": "Owner"}, |
| 36 | {"name": "created_at", "type": "datetime", "label": "Created", "read_only": true} |
| 37 | ], |
| 38 | "forms": { |
| 39 | "default": {"fields": ["label", "email_address", "host", "port", "security", "username", "folders", "enabled"]} |
| 40 | }, |
| 41 | "views": { |
| 42 | "list_mode": "table", |
| 43 | "list_fields": ["label", "email_address", "last_synced_at", "sync_error"] |
| 44 | } |
| 45 | } |