--- 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']: