From 43a0b5cb47d96ab5e38dc83e49a479c4249dd211 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 3 Sep 2020 22:04:44 +0200 Subject: [PATCH] remail/remaild: Fix failure message While handling an exception in process_msg() the handler triggers another one by trying to print a undefined variable (mailfile). Hand the mailfile name into the function. Use 'pipe input' for pipe mode. Signed-off-by: Thomas Gleixner --- remail/remaild.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/remail/remaild.py b/remail/remaild.py index db512eb..bbe5803 100644 --- a/remail/remaild.py +++ b/remail/remaild.py @@ -184,7 +184,7 @@ class remaild(object): except: pass - def process_msg(self, msg): + def process_msg(self, msg, mailfile): # Check whether one of the lists will take it for ml in self.mailinglists: if not ml.enabled: @@ -220,7 +220,7 @@ class remaild(object): self.move_frozen(mailfile) continue - res = self.process_msg(msg) + res = self.process_msg(msg, mailfile) if res == 0: os.unlink(mailfile) @@ -379,7 +379,7 @@ class remaild(object): policy = EmailPolicy(utf8=True) msg = message_from_file(sys.stdin, policy=policy) - return self.process_msg(msg) + return self.process_msg(msg, 'pipe input') # The runner def run(self):