Bug 57512 - Self-service emails rejected by Gmail
Summary: Self-service emails rejected by Gmail
Status: CLOSED FIXED
Alias: None
Product: UCS
Classification: Unclassified
Component: Self Service
Version: UCS 5.2
Hardware: Other Mac OS X 10.1
: P5 normal
Target Milestone: UCS 5.2-0-errata
Assignee: Christian Castens
QA Contact: Ole Schwiegert
URL: https://git.knut.univention.de/univen...
Keywords:
Depends on:
Blocks: 57953
  Show dependency treegraph
 
Reported: 2024-08-13 14:52 CEST by Thomas Kintscher
Modified: 2025-02-12 12:37 CET (History)
5 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.257
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Customer ID:
Max CVSS v3 score:


Attachments
self-service patch (5.0-9) (1.61 KB, patch)
2025-02-07 08:13 CET, Christian Castens
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Kintscher univentionstaff 2024-08-13 14:52:34 CEST
The emails generated by the self-service (maybe elsewhere, too) are rejected by Gmail's SMTP servers for lack of a proper `Message-Id` in their header:

> Aug 13 12:14:03 postfix postfix/smtp[1252]: 4AB65C466981: to=<xxxx-value-removed-xxxx@gmail.com>, relay=gmail-smtp-in.l.google.com[142.250.147.27]:25, delay=1.5, delays=0.35/0.34/0.29/0.52, dsn=5.7.1, status=bounced (host gmail-smtp-in.l.google.com[142.250.147.27] said: 550-5.7.1 [194.76.91.97] Messages missing a valid Message-ID header are not 550-5.7.1 accepted. For more information, go to 550-5.7.1  https://support.google.com/mail/?p=RfcMessageNonCompliant and review 550 5.7.1 RFC 5322 specifications. a640c23a62f3a-a80f3fa7d31si92176566b.238 - gsmtp (in reply to end of DATA command))

It might be necessary to generate a message-id for outgoing messages, e.g. using a helper function from Python: https://docs.python.org/3/library/email.utils.html#email.utils.make_msgid


This bug was reported by Johannes Bornhold on behalf of a customer.
Comment 1 Ingo Steuwer univentionstaff 2025-01-27 17:27:46 CET
"upvote" - I have a second user reporting the issue. I assume this affects every customer using the password reset.
Comment 2 Kurt Garloff 2025-01-28 11:47:24 CET
Password recovery and initial invitation of users via mail are impossible if those users use a mail service hosted by google (this goes beyond @gmail.com addresses, some companies use google as well for mail with their own domain). This currently prevents me from using a UCS system for collaboration in a project, as I can not get everyone onboarded.

In case you have a preliminary fix or workaround available, I'd be happy to test. (Hint: Not a UCS expert, though plenty of Linux experience ...)
Comment 4 Kurt Garloff 2025-02-05 09:44:46 CET
Do you want to post the patch here?
Again, happy to test.
(I don't know how long it will take to trickle down your build system, your QA and then pushed out as maintenance update. If that's only a few hours, then feel free to ignore my request.)
Comment 5 Christian Castens univentionstaff 2025-02-07 07:56:37 CET
The Message-ID header is now added to emails sent via Self Service
to prevent rejection by certain email providers.


UCS 5.0
univention-self-service (5.0.11-3)
19e95a97cfa4 | Bug #57512: add Message-ID header to emails sent via Self Service

UCS 5.2
univention-self-service (7.0.6)
b655934644f3 | Bug #57512: add Message-ID header to emails sent via Self Service
Comment 6 Ole Schwiegert univentionstaff 2025-02-07 08:09:39 CET
QA:
- Code Review: OK
- Package builds locally: OK
- Package installs: OK
- Before new package, no message ID is generated for the pw reset mail: OK
- After patch, message ID is generated
Comment 7 Christian Castens univentionstaff 2025-02-07 08:13:28 CET
Created attachment 11282 [details]
self-service patch (5.0-9)

I've also uploaded a patch in this bug's attachments so you can try out the changes.
Comment 8 Kurt Garloff 2025-02-07 09:08:33 CET
Thanks, Christian!
As the maintenance update did not yet trickle down into my UCS instance, I live-patched the python code (using patch -p5 in /usr/lib/python3/dist-packages/univention/management/console/modules/) with univention-self-service-passwordreset-umc 5.0.11-2 as baseline.
Looking at the code, I have no doubt that it works, but you never know.
I'll let you know how it goes.
Comment 9 Kurt Garloff 2025-02-07 09:51:56 CET
I can confirm that the patch is effective.