File tree Expand file tree Collapse file tree 4 files changed +11
-10
lines changed
web/api/client/v1/contexts/settings
tests/common/contexts/settings Expand file tree Collapse file tree 4 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 1+ use lettre:: message:: Mailbox ;
12use serde:: { Deserialize , Serialize } ;
23
34/// SMTP configuration.
@@ -6,9 +7,9 @@ pub struct Mail {
67 /// Whether or not to enable email verification on signup.
78 pub email_verification_enabled : bool ,
89 /// The email address to send emails from.
9- pub from : String ,
10+ pub from : Mailbox ,
1011 /// The email address to reply to.
11- pub reply_to : String ,
12+ pub reply_to : Mailbox ,
1213 /// The username to use for SMTP authentication.
1314 pub username : String ,
1415 /// The password to use for SMTP authentication.
@@ -23,8 +24,8 @@ impl Default for Mail {
2324 fn default ( ) -> Self {
2425 Self {
2526 email_verification_enabled : false ,
26- from : "[email protected] " . to_string ( ) , 27- reply_to : "[email protected] " . to_string ( ) , 27+ from : "[email protected] " . parse ( ) . expect ( "valid mailbox" ) , 28+ reply_to : "[email protected] " . parse ( ) . expect ( "valid mailbox" ) , 2829 username : String :: default ( ) ,
2930 password : String :: default ( ) ,
3031 server : String :: default ( ) ,
Original file line number Diff line number Diff line change @@ -121,8 +121,8 @@ impl Service {
121121 let settings = self . cfg . settings . read ( ) . await ;
122122
123123 Message :: builder ( )
124- . from ( settings. mail . from . parse ( ) . unwrap ( ) )
125- . reply_to ( settings. mail . reply_to . parse ( ) . unwrap ( ) )
124+ . from ( settings. mail . from . clone ( ) )
125+ . reply_to ( settings. mail . reply_to . clone ( ) )
126126 . to ( to. parse ( ) . unwrap ( ) )
127127 }
128128
Original file line number Diff line number Diff line change @@ -152,8 +152,8 @@ impl From<DomainMail> for Mail {
152152 fn from ( mail : DomainMail ) -> Self {
153153 Self {
154154 email_verification_enabled : mail. email_verification_enabled ,
155- from : mail. from ,
156- reply_to : mail. reply_to ,
155+ from : mail. from . to_string ( ) ,
156+ reply_to : mail. reply_to . to_string ( ) ,
157157 username : mail. username ,
158158 password : mail. password ,
159159 server : mail. server ,
Original file line number Diff line number Diff line change @@ -151,8 +151,8 @@ impl From<DomainMail> for Mail {
151151 fn from ( mail : DomainMail ) -> Self {
152152 Self {
153153 email_verification_enabled : mail. email_verification_enabled ,
154- from : mail. from ,
155- reply_to : mail. reply_to ,
154+ from : mail. from . to_string ( ) ,
155+ reply_to : mail. reply_to . to_string ( ) ,
156156 username : mail. username ,
157157 password : mail. password ,
158158 server : mail. server ,
You can’t perform that action at this time.
0 commit comments