Opened 9 years ago

Closed 8 years ago

#3713 closed (fixed)

use Python's make_msgid() for generating Message-ID email header

Reported by: Gary Wilson <gary.wilson@…> Owned by: adrian
Component: Core (Mail) Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Message-ID was asked for in #2991, commited in [4051], and had some tweaks in [4058], [4065], and [4536].

Python's email.Utils (or email.utils in python2.5) provides a function, make_msgid(), that accomplishes the same thing. Note, however that make_msgid() does not cache the hostname like our current code does.

Attachments (1)

mail.diff (1.5 KB) - added by Jannis Leidel <jl@…> 9 years ago.
Uses Python's make_msgid()

Download all attachments as: .zip

Change History (8)

comment:1 Changed 9 years ago by Gary Wilson <gary.wilson@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 9 years ago by adrian

  • Triage Stage changed from Design decision needed to Accepted

If this lets us simplify our code, I'm all for it.

comment:3 Changed 9 years ago by SmileyChris

So we are dropping the functionality of caching the hostname? :(

comment:4 Changed 9 years ago by adrian

Is there a way to use make_msgid() while keeping our hostname caching?

comment:5 Changed 9 years ago by SmileyChris

Not that I see - Python's email.Utils.make_msgid() calls socket.getfqdn() directly.

Changed 9 years ago by Jannis Leidel <jl@…>

Uses Python's make_msgid()

comment:6 Changed 8 years ago by Will McCutchen <mccutchen@…>

  • Has patch set

Just noting that a patch has been attached.

comment:7 Changed 8 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

In [5141] I included a copy of the source from Python's stdlib and changed it to use the cached hostname, which is a real performance improvement. The stdlib version was slightly more featureful than ours, so I felt it was worth including.

Note: See TracTickets for help on using tickets.
Back to Top