Repository: lettre/lettre (language: rust)

Issue:
Stop logging email addresses into info level logs
Fixes #390 


Discussion / hints:

Fix patch:
diff --git a/src/transport/sendmail/mod.rs b/src/transport/sendmail/mod.rs
index 4ba76178b..9d8f066be 100644
--- a/src/transport/sendmail/mod.rs
+++ b/src/transport/sendmail/mod.rs
@@ -3,13 +3,11 @@
 
 use crate::Envelope;
 use crate::{transport::sendmail::error::SendmailResult, Transport};
-use log::info;
 use std::{
     convert::AsRef,
     io::prelude::*,
     process::{Command, Stdio},
 };
-use uuid::Uuid;
 
 pub mod error;
 
@@ -40,8 +38,6 @@ impl<'a> Transport<'a> for SendmailTransport {
     type Result = SendmailResult;
 
     fn send_raw(&self, envelope: &Envelope, email: &[u8]) -> Self::Result {
-        let email_id = Uuid::new_v4();
-
         // Spawn the sendmail command
         let mut process = Command::new(&self.command)
             .arg("-i")
@@ -53,9 +49,6 @@ impl<'a> Transport<'a> for SendmailTransport {
             .spawn()?;
 
         process.stdin.as_mut().unwrap().write_all(email)?;
-
-        info!("Wrote {} message to stdin", email_id);
-
         let output = process.wait_with_output()?;
 
         if output.status.success() {
diff --git a/src/transport/stub/mod.rs b/src/transport/stub/mod.rs
index ac41d9afc..a24fb96a6 100644
--- a/src/transport/stub/mod.rs
+++ b/src/transport/stub/mod.rs
@@ -4,7 +4,6 @@
 
 use crate::Envelope;
 use crate::Transport;
-use log::info;
 
 /// This transport logs the message envelope and returns the given response
 #[derive(Debug, Clone, Copy)]
@@ -30,15 +29,7 @@ pub type StubResult = Result<(), ()>;
 impl<'a> Transport<'a> for StubTransport {
     type Result = StubResult;
 
-    fn send_raw(&self, envelope: &Envelope, _email: &[u8]) -> Self::Result {
-        info!(
-            "from=<{}> to=<{:?}>",
-            match envelope.from() {
-                Some(address) => address.to_string(),
-                None => "".to_string(),
-            },
-            envelope.to()
-        );
+    fn send_raw(&self, _envelope: &Envelope, _email: &[u8]) -> Self::Result {
         self.response
     }
 }


Test patch: