#NEWLINE# def make_msgid( idstring = None ) : #NEWLINE# #INDENT# 'Returns a string suitable for RFC 2822 compliant Message-ID, e.g:\n\n    <20020201195627.33539.96671@nightshade.la.mastaler.com>\n\n    Optional idstring if given is a string used to strengthen the\n    uniqueness of the message id.\n    ' #NEWLINE# timeval = time . time ( ) #NEWLINE# utcdate = time . strftime ( '%Y%m%d%H%M%S' , time . gmtime ( timeval ) ) #NEWLINE# try : #NEWLINE# #INDENT# pid = os . getpid ( ) #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# pid = 1 #NEWLINE# #UNINDENT# randint = random . randrange ( 100000 ) #NEWLINE# if ( idstring is None ) : #NEWLINE# #INDENT# idstring = '' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# idstring = ( '.' + idstring ) #NEWLINE# #UNINDENT# idhost = DNS_NAME #NEWLINE# msgid = ( '<%s.%s.%s%s@%s>' % ( utcdate , pid , randint , idstring , idhost ) ) #NEWLINE# return msgid