From a482d55670aa4d960e70add5c387c04f9afa2b2e Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 22 Apr 2016 15:57:16 -0400 Subject: main: Write message to STDOUT We need to write the full messgae to STDOUT so that Mutt can read it back in. Remove our two return statements as this will interrupt the message. --- src/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 547bae7..9f01fd6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -136,10 +136,14 @@ fn main() { for line in stdin.lock().lines() { let line = line.unwrap(); + + // Write the message to STDOUT so that it can be properly read by Mutt + write!(io::stdout(), "{}\n", line).unwrap(); + if line.starts_with("From: ") { match write_alias(line) { - Ok(_) => return, - Err(AliasSearchError::NotFound) | Err(AliasSearchError::EmailExists) => return, + Ok(_) => continue, + Err(AliasSearchError::NotFound) | Err(AliasSearchError::EmailExists) => continue, Err(e) => panic!(e), }; } -- cgit v1.2.3