Cannot send emails from instructor dashboard
Originally reported in #15 (moved)
When you go to a course on learn.totem-project.org, select the "Instructor" dashboard and try to use the "Email" function, it will fail to send.
In the lms-worker
log I see an error when I try to send an email this way:
Task bulk_email.tasks.send_course_email[beb6b0f5-cd1e-4659-a689-988b3ec54b38] raised unexpected: SMTPSenderRefused(550, b'Verification failed for <TP_ES_001-info@totem-project.org>\nCalled: 2a00:c6c0:0:111::25\nSent: RCPT TO:<TP_ES_001-info@totem-project.org>\nResponse: 550 user unknown at this system\nUnknown sender', '"Endpoint Security: Protect yourself from phishing,\n malware and social engineering Course Staff" <TP_ES_001-info@totem-project.org>')
lms-worker_1 | Traceback (most recent call last):
lms-worker_1 | File "/openedx/venv/lib/python3.5/site-packages/celery/app/trace.py", line 240, in trace_task
lms-worker_1 | R = retval = fun(*args, **kwargs)
lms-worker_1 | File "/openedx/venv/lib/python3.5/site-packages/celery/app/trace.py", line 438, in __protected_call__
lms-worker_1 | return self.run(*args, **kwargs)
lms-worker_1 | File "/openedx/edx-platform/lms/djangoapps/bulk_email/tasks.py", line 337, in send_course_email
lms-worker_1 | raise send_exception # pylint: disable=raising-bad-type
lms-worker_1 | File "/openedx/edx-platform/lms/djangoapps/bulk_email/tasks.py", line 580, in _send_course_email
lms-worker_1 | connection.send_messages([email_msg])
lms-worker_1 | File "/openedx/venv/lib/python3.5/site-packages/django/core/mail/backends/smtp.py", line 110, in send_messages
lms-worker_1 | sent = self._send(message)
lms-worker_1 | File "/openedx/venv/lib/python3.5/site-packages/django/core/mail/backends/smtp.py", line 126, in _send
lms-worker_1 | self.connection.sendmail(from_email, recipients, message.as_bytes(linesep='\r\n'))
lms-worker_1 | File "/opt/pyenv/versions/3.5.9/lib/python3.5/smtplib.py", line 863, in sendmail
lms-worker_1 | raise SMTPSenderRefused(code, resp, from_addr)
lms-worker_1 | smtplib.SMTPSenderRefused: (550, b'Verification failed for <TP_ES_001-info@totem-project.org>\nCalled: 2a00:c6c0:0:111::25\nSent: RCPT TO:<TP_ES_001-info@totem-project.org>\nResponse: 550 user unknown at this system\nUnknown sender', '"Endpoint Security: Protect yourself from phishing,\n malware and social engineering Course Staff" <TP_ES_001-info@totem-project.org>')
It seems like open edX tries to send the email from this from:
address: TP_ES_001-info@totem-project.org
Which does not exist. Our SMTP server does not allow sending emails from addresses that do not exist