π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[server] Make sender email configurable
Manav Rathi321f97cdae12
diff --git a/server/configurations/local.yaml b/server/configurations/local.yamlindex 7785f56019..196c56f1f9 100644--- a/server/configurations/local.yaml+++ b/server/configurations/local.yaml@@ -180,6 +180,9 @@ smtp:port:username:password:+ # The email address from which to send the email. Set this to an email+ # address whose credentials you're providing.+ email:# Zoho Zeptomail config (optional)#diff --git a/server/pkg/utils/email/email.go b/server/pkg/utils/email/email.goindex 46202313e7..a19987a1d8 100644--- a/server/pkg/utils/email/email.go+++ b/server/pkg/utils/email/email.go@@ -38,6 +38,7 @@ func sendViaSMTP(toEmails []string, fromName string, fromEmail string, subject ssmtpPort := viper.GetString("smtp.port")smtpUsername := viper.GetString("smtp.username")smtpPassword := viper.GetString("smtp.password")+ smtpEmail := viper.GetString("smtp.email")var emailMessage string@@ -50,6 +51,11 @@ func sendViaSMTP(toEmails []string, fromName string, fromEmail string, subject semailAddresses += email}+ // If an sender email is provided use it instead of the fromEmail.+ if smtpEmail != "" {+ fromEmail = smtpEmail+ }+header := "From: " + fromName + " <" + fromEmail + ">\n" +"To: " + emailAddresses + "\n" +"Subject: " + subject + "\n" +