mail.py
branchstable
changeset 5579 297b2002a083
parent 5424 8ecbcbff9777
child 5590 a56eb02f9ce7
child 5733 d00d1fab42af
--- a/mail.py	Tue May 25 10:55:57 2010 +0200
+++ b/mail.py	Tue May 25 11:56:16 2010 +0200
@@ -85,8 +85,11 @@
     assert type(content) is unicode, repr(content)
     msg = MIMEText(content.encode('UTF-8'), 'plain', 'UTF-8')
     # safety: keep only the first newline
-    subject = subject.splitlines()[0]
-    msg['Subject'] = header(subject)
+    try:
+        subject = subject.splitlines()[0]
+        msg['Subject'] = header(subject)
+    except IndexError:
+        pass # no subject
     if uinfo.get('email'):
         email = uinfo['email']
     elif config and config['sender-addr']: