1943: [ReviewBoard] Sending e-mail raise exception in Django framework (under some condition)

Jan.Ko*******@gmai***** (Google Code) (Is this you? Claim this profile.)
chipx86
chipx86
Aug. 20, 2011
What version are you running?
ReviewBoard 1.5

What steps will reproduce the problem?
1. Create "robot" user in admin panel but don't set e-mail for them
2. Send review using post-review on behalf someone using robot username publishing it and passing all necessary informations in parameters
3. Look do Apache logs. Django was crashed sending e-mail

What is the expected output? What do you see instead?
E-mail should be send to reviewer and submitter. Instead of that I see following in Apache log:
[Tue Jan 11 09:44:36 2011] [error] ERROR:root:Error sending e-mail notification with subject 'Review title' to '"Jan Koprowski" <submitter@address>,,"Christina Hammond" <reviewer@address>': need more than 1 value to unpack
[Tue Jan 11 09:44:36 2011] [error] Traceback (most recent call last):
[Tue Jan 11 09:44:36 2011] [error]   File "/reviewboard/lib/python2.7/site-packages/ReviewBoard-1.5.00.000.0_intel-py2.7.egg/reviewboard/notifications/email.py", line 177, in send_review_mail
[Tue Jan 11 09:44:36 2011] [error]     message.send()
[Tue Jan 11 09:44:36 2011] [error]   File "/reviewboard/lib/python2.7/site-packages/Django-1.2.4-py2.7.egg/django/core/mail/message.py", line 179, in send
[Tue Jan 11 09:44:36 2011] [error]     return self.get_connection(fail_silently).send_messages([self])
[Tue Jan 11 09:44:36 2011] [error]   File "/reviewboard/lib/python2.7/site-packages/Django-1.2.4-py2.7.egg/django/core/mail/backends/smtp.py", line 85, in send_messages
[Tue Jan 11 09:44:36 2011] [error]     sent = self._send(message)
[Tue Jan 11 09:44:36 2011] [error]   File "/reviewboard/lib/python2.7/site-packages/Django-1.2.4-py2.7.egg/django/core/mail/backends/smtp.py", line 104, in _send
[Tue Jan 11 09:44:36 2011] [error]     recipients = map(self._sanitize, email_message.recipients())
[Tue Jan 11 09:44:36 2011] [error]   File "/reviewboard/lib/python2.7/site-packages/Django-1.2.4-py2.7.egg/django/core/mail/backends/smtp.py", line 95, in _sanitize
[Tue Jan 11 09:44:36 2011] [error]     name, domain = email.split('@', 1)
[Tue Jan 11 09:44:36 2011] [error] ValueError: need more than 1 value to unpack

What operating system are you using? What browser?
Linux
Apache2
mod_wsgi

Please provide any additional information below.
Cause of this issue is in reviewboard/notification/email.py in function send_review_mail (approximately line 122):

    from_email = get_email_address_for_user(user)

    recipients = set([from_email])

In those lines "from_email" is empty and add empty element to set of recipients.
#2 yunsh*****@gmai***** (Google Code) (Is this you? Claim this profile.)
ReviewBoard 1.6 RC2, encountered same problem.

Is there any workarounds?
chipx86
#3 chipx86
Right now, the workaround is "Don't do that." Give it a fake e-mail address. We'll address this for 1.5.x and 1.6.
  • +Confirmed
  • +Milestone-Release1.5.x
    +Component-EMail
  • +chipx86
chipx86
#4 chipx86
Fixed on release-1.5.x and master.
  • -Confirmed
    +Fixed