Can't send emails

after resolving my issue with the migration from 9.1.2 to 20.10. (After upgrade from 9.1.2 to 10.0/20.9/latest no events details) I’am facing another issue where I am stuck. Currently I am not able to send any email.
Log from the sentry-worker pod after sending an email invite:

Traceback (most recent call last):                                                                                                                                                        File "/usr/local/lib/python3.6/site-packages/celery/app/", line 412, in trace_task                                                                                              
R = retval = fun(*args, **kwargs)                                                                                                                                                     File "/usr/local/lib/python3.6/site-packages/celery/app/", line 704, in __protected_call__                                                                                      │
return*args, **kwargs)                                                                                                                                                      File "/usr/local/lib/python3.6/site-packages/sentry_sdk/integrations/", line 186, in _inner
File "/usr/local/lib/python3.6/site-packages/sentry_sdk/", line 55, in reraise                                                                                                raise value                                                                                                                                                                           File "/usr/local/lib/python3.6/site-packages/sentry_sdk/integrations/", line 181, in _inner
return f(*args, **kwargs)                                                                                                                                    
File "/usr/local/lib/python3.6/site-packages/sentry/tasks/", line 48, in _wrapped
result = func(*args, **kwargs)                                                                                                                                                       
File "/usr/local/lib/python3.6/site-packages/sentry/tasks/", line 76, in send_email                                                                                             
File "/usr/local/lib/python3.6/site-packages/sentry/utils/", line 408, in send_messages
sent = connection.send_messages(messages)                                                                                                                                             File "/usr/local/lib/python3.6/site-packages/django/core/mail/backends/", line 111, in send_messages
sent = self._send(message)                                                                                                                                                            File "/usr/local/lib/python3.6/site-packages/django/core/mail/backends/", line 123, in _send                                                                                     │
from_email = sanitize_address(email_message.from_email, encoding)                                                                                                                   
File "/usr/local/lib/python3.6/site-packages/django/core/mail/", line 161, in sanitize_address                                                                               
address = Address(nm, addr_spec=addr)                                                                                                                                                 
File "/usr/local/lib/python3.6/email/", line 42, in __init__                                                                                                           a_s, rest = parser.get_addr_spec(addr_spec)                                                                                                                                           File "/usr/local/lib/python3.6/email/", line 1585, in get_addr_spec                                                                                              
token, value = get_local_part(value)                                                                                                                                                  
File "/usr/local/lib/python3.6/email/", line 1395, in get_local_part                                                                                             
if value[0] in CFWS_LEADER: IndexError: string index out of range

Any idea on this one?

Thanks in advance!

1 Like

Looks like you have an invalid (possibly empty?) email set for mail.from in your config:

Thanks for your help, just found it out a few minutes before you were posting this reply by coincidence
I forgot to set the “mail.from” property… :man_facepalming:

1 Like