Store mail to /srv/mail

We should probably read configuration to determine where mail should
go, but for now should suffice.
This commit is contained in:
Tristan Daniël Maat 2020-07-11 22:21:30 +01:00
parent bd5604be63
commit 9c5f1dbca3
Signed by: tlater
GPG key ID: 49670FD774E43268

View file

@ -22,8 +22,8 @@ fn send_mail(email: &Email) -> Result<(), String> {
.build() .build()
.map_err(|err| format!("Invalid email contents: {}", err))?; .map_err(|err| format!("Invalid email contents: {}", err))?;
let mut mailer = FileTransport::new("mails"); let mut mailer = FileTransport::new("/srv/mail");
if let Err(error) = create_dir_all("mails") { if let Err(error) = create_dir_all("/srv/mail") {
println!("Could not create mail directory: {}", error); println!("Could not create mail directory: {}", error);
}; };
mailer.send(email.into()).map_err(|err| { mailer.send(email.into()).map_err(|err| {