Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Missing Date and Message-ID Headers to Ensure Email Delivery (Fix #4066) #4067

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ThomaciousD
Copy link
Contributor

Summary

This PR fixes the issue where emails sent through send_email() were not being delivered due to missing required headers. Adding the Date and Message-ID headers ensures proper email metadata, preventing certain email providers (e.g., Gmail) from rejecting or discarding emails.

Fix Implemented

Imported formatdate and make_msgid from email.utils
Added:

msg["Date"] = formatdate(localtime=True)
msg["Message-ID"] = make_msgid()

to ensure emails have the required headers.

Related Issue

Closes #4066

Testing

✅ Verified emails are now delivered correctly.
✅ Checked SMTP debug logs (set_debuglevel(1)) and confirmed correct email metadata.
✅ Ensured emails arrive in both inbox and spam folder across different email providers.

Copy link

vercel bot commented Feb 20, 2025

@ThomaciousD is attempting to deploy a commit to the Danswer Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Emails Not Delivered Due to Missing Date and Message-ID Headers
1 participant