--- a/Allura/allura/tasks/mail_tasks.py
+++ b/Allura/allura/tasks/mail_tasks.py
@@ -68,7 +68,10 @@
addrs_plain = []
addrs_html = []
addrs_multi = []
- if '@' not in fromaddr:
+ if fromaddr is None:
+ fromaddr = 'noreply@in.sf.net'
+ elif '@' not in fromaddr:
+ log.warning('Looking up user with fromaddr %s', fromaddr)
user = M.User.query.get(_id=ObjectId(fromaddr))
if not user:
log.warning('Cannot find user with ID %s', fromaddr)
@@ -127,7 +130,10 @@
message_id,
in_reply_to=None):
from allura import model as M
- if '@' not in fromaddr:
+ if fromaddr is None:
+ fromaddr = 'noreply@in.sf.net'
+ elif '@' not in fromaddr:
+ log.warning('Looking up user with fromaddr %s', fromaddr)
user = M.User.query.get(_id=ObjectId(fromaddr))
if not user:
log.warning('Cannot find user with ID %s', fromaddr)