From: Stefan Huber Date: Tue, 7 Jan 2014 18:20:24 +0000 (+0100) Subject: bug: do not crash when To: header is not found X-Git-Tag: v1.1^0 X-Git-Url: https://git.sthu.org/?p=smailq.git;a=commitdiff_plain;h=6cb15cebfa30c025d5996bc3015b4285b25a59cf bug: do not crash when To: header is not found --- 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