Read the http header from the proxy to get the client IP

This commit is contained in:
Greg Burri 2022-11-27 02:01:23 +01:00
parent b6235fb76c
commit 8a3fef096d
6 changed files with 29 additions and 25 deletions

View file

@ -1,8 +1,7 @@
use lettre::{transport::smtp::{authentication::Credentials}, Message, SmtpTransport, Transport};
use lettre::{transport::smtp::authentication::Credentials, Message, SmtpTransport, Transport};
///
pub fn send_validation(site_url: &str, email: &str, token: &str, smtp_login: &str, smtp_password: &str) -> Result<(), Box<dyn std::error::Error>> {
let email = Message::builder()
.message_id(None)
.from("recipes@gburri.org".parse()?)
@ -15,7 +14,7 @@ pub fn send_validation(site_url: &str, email: &str, token: &str, smtp_login: &st
let mailer = SmtpTransport::relay("mail.gandi.net")?.credentials(credentials).build();
if let Err(error) = mailer.send(&email) {
println!("Error when sending E-mail:\n{:?}", &error);
eprintln!("Error when sending E-mail:\n{:?}", &error);
}
Ok(())