aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTeddy Wing2016-04-22 15:57:16 -0400
committerTeddy Wing2016-04-22 15:57:16 -0400
commita482d55670aa4d960e70add5c387c04f9afa2b2e (patch)
tree9dbe89d6d65dbe283d423d95a255fe5a78945efe /src
parent4eff98a64efd573a2a77a5e8f6302860085a289c (diff)
downloadmutt-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.
Diffstat (limited to 'src')
-rw-r--r--src/main.rs8
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),
};
}