mail.py
changeset 5590 a56eb02f9ce7
parent 5556 9ab2b4c74baf
parent 5579 297b2002a083
child 5736 375819ec7d43
--- a/mail.py	Tue May 25 11:51:48 2010 +0200
+++ b/mail.py	Wed May 26 12:33:48 2010 +0200
@@ -84,8 +84,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']: