diff --git a/changelog/unreleased/fix-notifications-email-settings.md b/changelog/unreleased/fix-notifications-email-settings.md new file mode 100644 index 00000000000..afbf22c764f --- /dev/null +++ b/changelog/unreleased/fix-notifications-email-settings.md @@ -0,0 +1,7 @@ +Bugfix: Fix notifications service settings + +We've fixed two notifications service setting: +- `NOTIFICATIONS_MACHINE_AUTH_API_KEY` was previously not picked up (only `OCIS_MACHINE_AUTH_API_KEY` was loaded) +- If you used a email sender address in the format of the default value of `NOTIFICATIONS_SMTP_SENDER` no email could be send. + +https://github.com/owncloud/ocis/pull/4652 diff --git a/services/notifications/pkg/channels/channels.go b/services/notifications/pkg/channels/channels.go index a86fff60d9b..1003c459892 100644 --- a/services/notifications/pkg/channels/channels.go +++ b/services/notifications/pkg/channels/channels.go @@ -118,7 +118,7 @@ func (m Mail) SendMessage(userIDs []string, msg, subject, senderDisplayName stri email := mail.NewMSG() if senderDisplayName != "" { - email.SetFrom(fmt.Sprintf("%s via owncloud <%s>", senderDisplayName, m.conf.Notifications.SMTP.Sender)).AddTo(to...) + email.SetFrom(fmt.Sprintf("%s via %s", senderDisplayName, m.conf.Notifications.SMTP.Sender)).AddTo(to...) } else { email.SetFrom(m.conf.Notifications.SMTP.Sender).AddTo(to...) } diff --git a/services/notifications/pkg/command/server.go b/services/notifications/pkg/command/server.go index 5387cbbbe3d..892205355f2 100644 --- a/services/notifications/pkg/command/server.go +++ b/services/notifications/pkg/command/server.go @@ -55,7 +55,7 @@ func Server(cfg *config.Config) *cli.Command { logger.Fatal().Err(err).Str("addr", cfg.Notifications.RevaGateway).Msg("could not get reva client") } - svc := service.NewEventsNotifier(evts, channel, logger, gwclient, cfg.Commons.MachineAuthAPIKey, cfg.Notifications.EmailTemplatePath) + svc := service.NewEventsNotifier(evts, channel, logger, gwclient, cfg.Notifications.MachineAuthAPIKey, cfg.Notifications.EmailTemplatePath) return svc.Run() }, }