thunderbird_accounts.mail.utils
Functions
|
|
|
|
|
|
|
|
|
Return app-password secrets with Appointment CalDAV entry excluded. |
|
Check if the archive folder exists, if it doesn't create it! This fixes a bug with our stalwart instance where it doesn't give us an archives folder... |
|
Checks an email address (thundermail address or custom alias, not recovery email!) against known user's recovery email, thundermail address or custom aliases. |
|
Pass in an email address and see if it's a valid / allowed email domain |
|
|
|
Hashes a given password, formats it with the label and saves it to the secret field. |
|
|
|
Validates the email and local part against Django's built-in email validation. |
- thunderbird_accounts.mail.utils.validate_email(email: str, error_message: str | None = None, min_length: int | None = None) bool[source]
Validates the email and local part against Django’s built-in email validation.
min_length overrides User.USERNAME_MIN_LENGTH when the caller has already enforced its own domain-specific minimum (e.g. the add_email_alias view).
- thunderbird_accounts.mail.utils.save_app_password(label, password)[source]
Hashes a given password, formats it with the label and saves it to the secret field.
- thunderbird_accounts.mail.utils.filter_app_passwords(secrets: list[str], *, filter_prefix: str | None = None) list[str][source]
Return app-password secrets with Appointment CalDAV entry excluded.
If filter_prefix is given, only secrets whose label starts with that prefix are kept (all others are returned). By default the
APPOINTMENT_APP_PASSWORD_PREFIXis stripped out.
- thunderbird_accounts.mail.utils.fix_archives_folder(access_token, account: Account) bool[source]
Check if the archive folder exists, if it doesn’t create it! This fixes a bug with our stalwart instance where it doesn’t give us an archives folder…
This function is a little messy, and will hopefully be removed in the future.