aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/base/routes.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/routes.go')
-rw-r--r--plugins/base/routes.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/base/routes.go b/plugins/base/routes.go
index 623a5cc..4640c93 100644
--- a/plugins/base/routes.go
+++ b/plugins/base/routes.go
@@ -1243,6 +1243,8 @@ type Settings struct {
Signature string
From string
Subscriptions []string
+ SMTPUsername string
+ SMTPPassword string
}
func loadSettings(s alps.Store) (*Settings, error) {
@@ -1268,6 +1270,12 @@ func (s *Settings) check() error {
if len(s.From) > 512 {
return fmt.Errorf("Full name must be 512 characters or fewer")
}
+ if len(s.SMTPUsername) > 255 {
+ return fmt.Errorf("SMTP username must be 255 characters or fewer")
+ }
+ if len(s.SMTPPassword) > 255 {
+ return fmt.Errorf("SMTP password must be 255 characters or fewer")
+ }
return nil
}
@@ -1311,6 +1319,8 @@ func handleSettings(ctx *alps.Context) error {
}
settings.Signature = ctx.FormValue("signature")
settings.From = ctx.FormValue("from")
+ settings.SMTPUsername = ctx.FormValue("smtp_username")
+ settings.SMTPPassword = ctx.FormValue("smtp_password")
params, err := ctx.FormParams()
if err != nil {