diff options
| author | Teddy Wing | 2016-04-22 15:57:16 -0400 |
|---|---|---|
| committer | Teddy Wing | 2016-04-22 15:57:16 -0400 |
| commit | a482d55670aa4d960e70add5c387c04f9afa2b2e (patch) | |
| tree | 9dbe89d6d65dbe283d423d95a255fe5a78945efe | |
| parent | 4eff98a64efd573a2a77a5e8f6302860085a289c (diff) | |
| download | mutt-alias-auto-add-a482d55670aa4d960e70add5c387c04f9afa2b2e.tar.bz2 | |
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.
| -rw-r--r-- | src/main.rs | 8 |
1 files changed, 6 insertions, 2 deletions
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), }; } |
