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.

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