Hi,
today I updated Indico to v3.3.5 and I noticed that emails doesn’t seem to work anymore.
Looking at indico logs I can see some messagges like this one:
Could not send email "[Indico] Reset your password" (attempt 7/10); retry in 3600s [Invalid address; only INDICO @ INAF could be parsed from "INDICO @ INAF <noreply@ict.inaf.it>"]
I use a local postfix as relay to another SMTP server, but I tried to send a test email message from command line and it works fine.
OK, easy fix. If you want to patch the code, this solves it:
diff --git a/indico/core/emails.py b/indico/core/emails.py
index 94b6b1590b..c6d5c48556 100644
--- a/indico/core/emails.py
+++ b/indico/core/emails.py
@@ -70,7 +70,7 @@ def send_email_task(task, email, log_entry=None):
def get_actual_sender_address(sender_address: str, reply_address: set[str]) -> tuple[str, set]:
site_title = core_settings.get('site_title')
if not sender_address:
- return f'{site_title} <{config.NO_REPLY_EMAIL}>', reply_address
+ return formataddr((site_title, config.NO_REPLY_EMAIL)), reply_address
if not config.SMTP_ALLOWED_SENDERS:
# this may result in spoofing
return sender_address, reply_address
Edit: Don’t apply this yet. Some tests fail with this, so better to stick with the workaround for now.
Edit 2: Nevermind, that was just a bug in the tests.
This is the error at the register a new user: Could not send email “[Indico] Verifique su correo” (attempt 1/10); retry in 30s [[Errno -2] Name or service not known]
check your indico.log if there’s a more verbose error. also, does a dns lookup from that machine work? host smtp.google.com or nslookup smtp.google.com depending on what’s available
Yes, host smtp.google.com is ready and the indico.log only show
2025-02-05 13:30:09,876 INFO 70ec28d0e2e84d05 - indico.auth Password reset requested for user <User(1, sandra@unnoba.edu.ar): "Sandra Serafino">
2025-02-05 13:30:09,939 WARNING 0000000000000000 - indico.emails Could not send email "[Indico] Reestablecer la contraseña" (attempt 1/10); retry in 30s [[Errno -2] Name or service not know>
2025-02-05 13:30:09,966 INFO 442f8812e7864ac8 - indico.rh GET /reset-password/ [IP=172.26.2.51] [PID=1457]
2025-02-05 13:30:39,948 WARNING 0000000000000000 - indico.emails Could not send email "[Indico] Reestablecer la contraseña" (attempt 2/10); retry in 60s [[Errno -2] Name or service not know>
2025-02-05 13:31:39,990 WARNING 0000000000000000 - indico.emails Could not send email "[Indico] Reestablecer la contraseña" (attempt 3/10); retry in 120s [[Errno -2] Name or service not kno>
2025-02-05 13:33:40,037 WARNING 0000000000000000 - indico.emails Could not send email "[Indico] Reestablecer la contraseña" (attempt 4/10); retry in 300s [[Errno -2] Name or service not kno>
2025-02-05 13:38:34,493 WARNING 0000000000000000 - indico.emails Could not send email "[Indico] Reestablecer la contraseña" (attempt 6/10); retry in 1800s [[Errno -2] Name or service not kn>
2025-02-05 13:38:40,044 WARNING 0000000000000000 - indico.emails Could not send email "[Indico] Reestablecer la contraseña" (attempt 5/10); retry in 600s [[Errno -2] Name or service not kno>
2025-02-05 13:48:40,093 WARNING 0000000000000000 - indico.emails Could not send email "[Indico] Reestablecer la contraseña" (attempt 6/10); retry in 1800s [[Errno -2] Name or service not kn>
Try restarting indico-celery.service - maybe some glibc or whatever update broke DNS. In any case, the original problem from this thread is not related.
No, but can you please share your full email-related config from indico.conf? Just censor your username and password since we of course do not need that.