-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
Hi Steve,
another question related to this topic: How can I change the email backend? django-sendmail-backend [0] should does this job. But adding EMAIL_BACKEND = 'django_sendmail_backend.backends.EmailBackend' to /usr/lib/python3/dist-packages/lava_scheduler_app/settings.py has no effect. Lava still try to send an email via smtp.
[0] django-sendmail-backend
Regards, Matthias
- -----Ursprüngliche Nachricht----- Von: Frank, Matthias Gesendet: Montag, 20. Mai 2019 11:48 An: 'Steve McIntyre' steve.mcintyre@linaro.org Cc: 'lava-users@lists.lavasoftware.org' lava-users@lists.lavasoftware.org Betreff: AW: [Lava-users] Problems with email notifications
Hi Steve,
- -----Ursprüngliche Nachricht----- Von: Steve McIntyre [mailto:steve.mcintyre@linaro.org] Gesendet: Freitag, 10. Mai 2019 18:56 An: Frank, Matthias Matthias.Frank@tq-group.com Cc: lava-users@lists.lavasoftware.org Betreff: Re: [Lava-users] Problems with email notifications
Hi Frank,
On Fri, May 10, 2019 at 07:34:20AM +0000, Frank, Matthias wrote:
my Debian machine running lava-server (2019.04) sends mails via msmtp/ msmtp-mta. Mails from cron or apt work fine. But I got no mails from lava. Even when I submit a test job with a notify statement.
notify: criteria: status: finished recipients:
- to: method: email user: default
verbosity: verbose
The user default uses my real mail address not a system mail address.
This is the Django log:
INFO 2019-05-10 07:18:15,546 notifications [1343] sending email notification to XXXXXXX@YYYYYY.com ERROR 2019-05-10 07:18:15,557 notifications [Errno 99] Cannot assign requested address
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/lava_scheduler_app/notifications.py", line 303, in send_notifications title, body, settings.SERVER_EMAIL, [recipient.email_address] File "/usr/lib/python3/dist-packages/django/core/mail/__init__.py", line 62, in send_mail return mail.send() File "/usr/lib/python3/dist-packages/django/core/mail/message.py", line 348, in send return self.get_connection(fail_silently).send_messages([self]) File "/usr/lib/python3/dist-packages/django/core/mail/backends/smtp.py", line 104, in send_messages new_conn_created = self.open()
File "/usr/lib/python3/dist-packages/django/core/mail/backends/smtp.py", line 64, in open
self.connection = self.connection_class(self.host, self.port, **connection_params)
File "/usr/lib/python3.5/smtplib.py", line 251, in __init__
(code, msg) = self.connect(host, port)
File "/usr/lib/python3.5/smtplib.py", line 335, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "/usr/lib/python3.5/smtplib.py", line 306, in _get_socket
self.source_address)
File "/usr/lib/python3.5/socket.py", line 712, in create_connection
raise err
File "/usr/lib/python3.5/socket.py", line 703, in create_connection
sock.connect(sa)
OSError: [Errno 99] Cannot assign requested address
WARNING 2019-05-10 07:18:15,558 notifications [1343] failed to send email notification to XXXXXXX@YYYYYY.com
Lava has a problem with smtp. Is it necessary to have a complete smtp server on the local machine? Or is there a special smtp configuration?
LAVA expects to use a local MTA of some sort. If you have msmtp installed, then that should do the job as far as I know. Does it have any logs to show what's going on?
My *first* guess would be that you might need to specifically configure things to allow the "lavaserver" user to send mail. For example,
https://wiki.archlinux.org/index.php/Msmtp
talks about per-user config.
- -- Steve McIntyre steve.mcintyre@linaro.org http://www.linaro.org/ Linaro.org | Open source software for ARM SoCs
The log files mail.(err|info|log) are empty. Msmtp.log has no message for this mail. This is comprehensible because the Django log says it was not possible to connect to a smtp process. But I have no running smtp server. I only have msmtp as local mta client.
On command line sending an email via msmtp or sendmail works, also for the user lavaserver
Regards, Matthias