Unable to send emails after upgrade from v3.3.4 to v3.3.5

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.

Please, could you give me a hint on this?

Thank you very much,
Cristiano.

Workaround: Remove the @ from your “Site title” (main admin settings page). That will fix this problem.

I’ll see if we can somehow avoid it so things do not break when the site title contains an @.

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.

1 Like

Ok, thank you.
I substituted ‘@’ with ‘-’ and restarted the service.
Let’see if it works now.

Thank you very much,
Cristiano.

Restored the old site title with ‘@’ and tried the patch.
It seems to work fine.

Thank you!
Cristiano.

2 Likes

Hello. I’m new in Indico.
I can’t log in to the system because sending emails doesn’t work. Can I change the “Site title” without logging in?

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]

That’s a different error, it sounds more like your mail server hostname is wrong (and cannot be looked up via DNS).

Yes, but the smtp server is smtp.google.com and it is correct.

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.

Ok. Thanks.
I restarted indico-celery but it doesn’t work. I will keep checking

sorry, when I reconfigure I now get the error: SMTP connection failed: SMTP AUTH extension not supported by server.

Could it be a version problem?

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.

And check google docs if their smtp-server is open enough ( which I doubt) for such a usage. I sounds like an authentication failure.
(see e.g. E-Mails über einen Drucker, Scanner oder eine App senden - Google Workspace-Admin-Hilfe which indicates that this is limited to google workspace accounts, not e.g. google personal accounts and
Route outgoing SMTP relay messages through Google - Google Workspace Admin Help for how to use google as an email relay.