Fix #9151 - smtp logger configuration sendTos should be an array #9154
Labels
No Label
backport/done
backport/v1.0
backport/v1.1
backport/v1.10
backport/v1.11
backport/v1.12
backport/v1.13
backport/v1.14
backport/v1.15
backport/v1.2
backport/v1.3
backport/v1.4
backport/v1.5
backport/v1.6
backport/v1.7
backport/v1.8
backport/v1.9
bounty
changelog
dependencies
frontport/done
frontport/main
good first issue
Hacktoberfest
hacktoberfest-accepted
in progress
kind/api
kind/breaking
kind/bug
kind/build
kind/deployment
kind/deprecated
kind/docs
kind/enhancement
kind/feature
kind/lint
kind/misc
kind/moderation
kind/package
kind/proposal
kind/question
kind/refactor
kind/regression
kind/security
kind/summary
kind/testing
kind/translation
kind/ui
kind/upstream-related
kind/usability
kind/ux
lgtm/done
lgtm/need 1
lgtm/need 2
performance/bigrepo
performance/cpu
performance/memory
performance/speed
priority/critical
priority/low
priority/maybe
priority/medium
proposal/rejected
reviewed/confirmed
reviewed/duplicate
reviewed/fixed
reviewed/invalid
reviewed/not-a-bug
reviewed/wontfix
skip-changelog
stale
status/blocked
status/needs-feedback
status/wip
theme/2fa
theme/authentication
theme/avatar
theme/backup-restore
theme/docker
theme/federation
theme/issues
theme/kanban
theme/markdown
theme/migration
theme/mobile
theme/pr
theme/signing
theme/sqlite
theme/timetracker
theme/webhook
theme/wiki
No Milestone
No project
No Assignees
2 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: lunny/gitea#9154
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix-9151"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The settings code for managing smtp configuration is incorrect and should generate an array of email addresses. This fixes this problem.
Fix #9151
What about a regexp? That could suport several kinds of syntaxes. What is it that we expect here? The standard full-name format for an e-mail is:
"John Snow" <john@thewall.com>
. Entries are usually separated by;
but,
could also be supported.Anyway, we should validate the addresses and avoid using anything that will make the server fail.
Validation, however is something really tricky.
Validating email addresses is extremely non-trivial as just about the only thing you have to have is @ - possibly not even that depending on your local SMTP server config.
Even splitting potential lists of them by "," is incorrect as "," can be in there too.
In any case it can't blow up the server - SendMail will simply return an error and any error whilst logging an event just ends being printed blandly to stdout.
See modules/log/event.go
Mmm.... not even
TrimSpace()
on each value? Anyway, this is a closed list, so admins should be responsible and use whatever Gitea supports (i.e. not e-mails with,
in it ?).OK, I've added the TrimSpace. If you start looking too hard we'll have to fix the:
802aa6d5f3/modules/log/smtp.go (L84)
And make it do proper quoting of email addresses - but I think that could be done in a different PR.