Skip to content

Fix saving email notification settings with an empty From address - #3408

Open
Marijn0 wants to merge 1 commit into
motioneye-project:devfrom
Marijn0:fix/email-from-optional
Open

Fix saving email notification settings with an empty From address#3408
Marijn0 wants to merge 1 commit into
motioneye-project:devfrom
Marijn0:fix/email-from-optional

Conversation

@Marijn0

@Marijn0 Marijn0 commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

The backend input_sanity_check() throws a error:

raise ValueError(
ERROR: Value "" for setting "email_notifications_from" did not match regex "^[A-Za-z0-9 _+.@^~<>,-]+$": Email addresses are only allowed to contain alphanumerical characters, underscore _, plus +, dot ., at @, caret ^, tilde ~, angle brackets <>, hyphen -, and may be separated by comma, and space

when the From address field in the email notification settings is empty, preventing the settings from being saved. The sanity-check regex requires at least one character. The frontend does not require this field to be set. The UI help mark says:

msgstr "set a custom From address, if your SMTP service requires one (the first destination email address will be used if left blank)."
We now skip the sanity check when email_notifications_from is empty. I guess we could also edit the regex itself if preferred, but it is shared across multiple input fields.

The backend input_sanity_check() throws a ValueError when the From address field in the email notification settings is empty, preventing the settings from being saved. The sanity-check regex requires at least one character. The frontend does not require this field to be set. The UI help mark says: “the first destination email address will be used if left blank.” We now skip the sanity check for an empty value. I guess we could also edit the regex itself if preferred, but it is shared across multiple input fields.
@Marijn0 Marijn0 added this to the v0.45.0 milestone Aug 18, 2026
@Marijn0
Marijn0 requested review from MichaIng and zagrim August 18, 2026 18:36
@Marijn0 Marijn0 self-assigned this Aug 18, 2026
@Marijn0 Marijn0 added the bug label Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant