From 6cb15cebfa30c025d5996bc3015b4285b25a59cf Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Tue, 7 Jan 2014 19:20:24 +0100 Subject: [PATCH] bug: do not crash when To: header is not found --- smailq | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/smailq b/smailq index c42b980..7d5286a 100755 --- a/smailq +++ b/smailq @@ -160,6 +160,8 @@ class MailQueue: info = {} info['ctime'] = time.ctime(os.path.getctime(mailfn)) info['size'] = os.path.getsize(mailfn) + info['to'] = "" + info['subject'] = "" with open(mailfn, "r") as f: mail = f.readlines() @@ -173,6 +175,8 @@ class MailQueue: if l.startswith("To:"): info['to'] = l[3:].strip() break + if l.startswith("Cc:"): + info['to'] = l[3:].strip() return info -- 2.39.5