Merge pull request #417 from amousset/logs
fix(transport): Remove last info logs (fixes #398)
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user