getfider / fider

Open platform to collect and prioritize feedback
https://fider.io
GNU Affero General Public License v3.0
2.75k stars 620 forks source link

[BUG] SMTP open relay #1158

Open endquote opened 5 months ago

endquote commented 5 months ago

Fider Cloud or Self Hosted

Self-hosted, getfider/fider:stable image

Describe the bug A clear and concise description of what the bug is.

My SMTP server is internal to my network and does not require a username/password. Mail does not send with the error:

smtp: server doesn't support AUTH (app/services/email/smtp/smtp.go:131)

To Reproduce

I have EMAIL_SMTP_HOST, EMAIL_NOREPLY, and EMAIL_SMTP_PORT (587) set. I do not have EMAIL_SMTP_USERNAME, EMAIL_SMTP_PASSWORD, or EMAIL_SMTP_ENABLE_STARTTLS set.

Expected behavior

The initial activation email should go out.

Additional context

I set up an earlier version of Fider in this same environment and did have mail go out — so maybe this is a recent bug, or I have an incorrect configuration.

endquote commented 5 months ago

Tried again with EMAIL_SMTP_ENABLE_STARTTLS=true

ERROR [2024-01-17T18:19:05Z] [BGW] Error Trace: 
- app/middlewares/setup.go:61
- goroutine 52 [running]:
runtime/debug.Stack()
    /usr/local/go/src/runtime/debug/stack.go:24 +0x65
github.com/getfider/fider/app/pkg/errors.Panicked({0x1eabe80, 0xc0001c2520})
    /server/app/pkg/errors/errors.go:40 +0xcc
github.com/getfider/fider/app/middlewares.WorkerSetup.func1.1.2()
    /server/app/middlewares/setup.go:61 +0x4a
panic({0x1eabe80, 0xc0001c2520})
    /usr/local/go/src/runtime/panic.go:838 +0x207
github.com/getfider/fider/app/services/email/smtp.sendMail({0x21ccfe8, 0xc0002dc300}, 0xc00010e1e0)
    /server/app/services/email/smtp/smtp.go:105 +0x146e
reflect.Value.call({0x1e8db60?, 0x2023948?, 0x21d2740?}, {0x1f9957d, 0x4}, {0xc000555ca0, 0x2, 0x21d2740?})
    /usr/local/go/src/reflect/value.go:556 +0x845
reflect.Value.Call({0x1e8db60?, 0x2023948?, 0xc0001c8100?}, {0xc000555ca0, 0x2, 0x2})
    /usr/local/go/src/reflect/value.go:339 +0xbf
github.com/getfider/fider/app/pkg/bus.Publish({0x21ccfe8?, 0xc0002dc300}, {0xc0005cdd78?, 0x1, 0xc000555d68?})
    /server/app/pkg/bus/bus.go:154 +0x46f
github.com/getfider/fider/app/tasks.SendSignUpEmail.func1(0x21cccd8?)
    /server/app/tasks/signup.go:19 +0x337
github.com/getfider/fider/app/middlewares.WorkerSetup.func1.1(0xc0002dc300)
    /server/app/middlewares/setup.go:68 +0x363
github.com/getfider/fider/app/pkg/worker.(*BackgroundWorker).Run(0xc00012a8c0, {0x1fc0a33, 0x1})
    /server/app/pkg/worker/worker.go:73 +0x22a
created by github.com/getfider/fider/app/pkg/web.(*Engine).Start
    /server/app/pkg/web/engine.go:128 +0x71a
 (app/pkg/errors/errors.go:40)
- github.com/getfider/fider/app/services/email/smtp.sendMail:105 (app/pkg/errors/errors.go:39)
- failed to send email with template signup_email (app/services/email/smtp/smtp.go:105)
- smtp: server doesn't support AUTH (app/services/email/smtp/smtp.go:131)
INFO [2024-01-17T18:19:05Z] [BGW] Task 'Send sign up email' finished in 120ms (panicked)