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::Envelope;
|
||||||
use crate::{transport::sendmail::error::SendmailResult, Transport};
|
use crate::{transport::sendmail::error::SendmailResult, Transport};
|
||||||
use log::info;
|
|
||||||
use std::{
|
use std::{
|
||||||
convert::AsRef,
|
convert::AsRef,
|
||||||
io::prelude::*,
|
io::prelude::*,
|
||||||
process::{Command, Stdio},
|
process::{Command, Stdio},
|
||||||
};
|
};
|
||||||
use uuid::Uuid;
|
|
||||||
|
|
||||||
pub mod error;
|
pub mod error;
|
||||||
|
|
||||||
@@ -40,8 +38,6 @@ impl<'a> Transport<'a> for SendmailTransport {
|
|||||||
type Result = SendmailResult;
|
type Result = SendmailResult;
|
||||||
|
|
||||||
fn send_raw(&self, envelope: &Envelope, email: &[u8]) -> Self::Result {
|
fn send_raw(&self, envelope: &Envelope, email: &[u8]) -> Self::Result {
|
||||||
let email_id = Uuid::new_v4();
|
|
||||||
|
|
||||||
// Spawn the sendmail command
|
// Spawn the sendmail command
|
||||||
let mut process = Command::new(&self.command)
|
let mut process = Command::new(&self.command)
|
||||||
.arg("-i")
|
.arg("-i")
|
||||||
@@ -53,9 +49,6 @@ impl<'a> Transport<'a> for SendmailTransport {
|
|||||||
.spawn()?;
|
.spawn()?;
|
||||||
|
|
||||||
process.stdin.as_mut().unwrap().write_all(email)?;
|
process.stdin.as_mut().unwrap().write_all(email)?;
|
||||||
|
|
||||||
info!("Wrote {} message to stdin", email_id);
|
|
||||||
|
|
||||||
let output = process.wait_with_output()?;
|
let output = process.wait_with_output()?;
|
||||||
|
|
||||||
if output.status.success() {
|
if output.status.success() {
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
use crate::Envelope;
|
use crate::Envelope;
|
||||||
use crate::Transport;
|
use crate::Transport;
|
||||||
use log::info;
|
|
||||||
|
|
||||||
/// This transport logs the message envelope and returns the given response
|
/// This transport logs the message envelope and returns the given response
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy)]
|
||||||
@@ -30,15 +29,7 @@ pub type StubResult = Result<(), ()>;
|
|||||||
impl<'a> Transport<'a> for StubTransport {
|
impl<'a> Transport<'a> for StubTransport {
|
||||||
type Result = StubResult;
|
type Result = StubResult;
|
||||||
|
|
||||||
fn send_raw(&self, envelope: &Envelope, _email: &[u8]) -> Self::Result {
|
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()
|
|
||||||
);
|
|
||||||
self.response
|
self.response
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user