aboutsummaryrefslogtreecommitdiff
path: root/routers/install.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/install.go')
-rw-r--r--routers/install.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/routers/install.go b/routers/install.go
index 1df875ae..f4650832 100644
--- a/routers/install.go
+++ b/routers/install.go
@@ -249,12 +249,14 @@ func InstallPost(ctx *context.Context, form auth.InstallForm) {
}
// Make sure FROM field is valid
- _, err := mail.ParseAddress(form.SMTPFrom)
- if err != nil {
- ctx.Data["Err_SMTP"] = true
- ctx.Data["Err_SMTPFrom"] = true
- ctx.RenderWithErr(ctx.Tr("install.invalid_smtp_from", err), INSTALL, &form)
- return
+ if len(form.SMTPFrom) > 0 {
+ _, err := mail.ParseAddress(form.SMTPFrom)
+ if err != nil {
+ ctx.Data["Err_SMTP"] = true
+ ctx.Data["Err_SMTPFrom"] = true
+ ctx.RenderWithErr(ctx.Tr("install.invalid_smtp_from", err), INSTALL, &form)
+ return
+ }
}
// Check logic loophole between disable self-registration and no admin account.