This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author avbidder@fortytwo.ch
Recipients avbidder@fortytwo.ch
Date 2010-06-13.15:15:34
SpamBayes Score 0.014899573
Marked as misclassified No
Message-id <1276442137.97.0.787561293748.issue8989@psf.upfronthosting.co.za>
In-reply-to
Content
Using the hostname for the domain part of a Message-Id is probably the right thing usually but users may want to override this.

Please consider this rather trivial patch:

=====
--- utils.py.orig       2010-06-13 16:59:30.533861099 +0200
+++ utils.py    2010-06-13 17:02:18.650697979 +0200
@@ -173,13 +173,15 @@
 
 
 

-def make_msgid(idstring=None):
+def make_msgid(idstring=None, domain=None):
     """Returns a string suitable for RFC 2822 compliant Message-ID, e.g:
 
     <20020201195627.33539.96671@nightshade.la.mastaler.com>
 
     Optional idstring if given is a string used to strengthen the
-    uniqueness of the message id.
+    uniqueness of the message id.  The domain part of the Message-ID
+    defaults to the locally defined hostname, but can be specified
+    explicitly.
     """
     timeval = time.time()
     utcdate = time.strftime('%Y%m%d%H%M%S', time.gmtime(timeval))
@@ -189,8 +191,9 @@
         idstring = ''
     else:
         idstring = '.' + idstring
-    idhost = socket.getfqdn()
-    msgid = '<%s.%s.%s%s@%s>' % (utcdate, pid, randint, idstring, idhost)
+    if domain is None:
+        domain = socket.getfqdn()
+    msgid = '<%s.%s.%s%s@%s>' % (utcdate, pid, randint, idstring, domain)
     return msgid
 
 
=====

thanks & greetings
-- vbi
History
Date User Action Args
2010-06-13 15:15:38avbidder@fortytwo.chsetrecipients: + avbidder@fortytwo.ch
2010-06-13 15:15:37avbidder@fortytwo.chsetmessageid: <1276442137.97.0.787561293748.issue8989@psf.upfronthosting.co.za>
2010-06-13 15:15:36avbidder@fortytwo.chlinkissue8989 messages
2010-06-13 15:15:35avbidder@fortytwo.chcreate