def make_msgid(idstring=None):
 timeval = time.time()
 utcdate = time.strftime('%Y%m%d%H%M%S', time.gmtime(timeval))
 try:
  pid = os.getpid()
 except AttributeError:
  pid = 1
 randint = random.randrange(100000)
 if (idstring is None):
  idstring = ''
 else:
  idstring = ('.' + idstring)
 idhost = DNS_NAME
 msgid = ('<%s.%s.%s%s@%s>' % (utcdate, pid, randint, idstring, idhost))
 return msgid

def make_msgid ( idstring = None ) : timeval = time . time ( ) utcdate = time . strftime ( '%Y%m%d%H%M%S' , time . gmtime ( timeval ) ) try : pid = os . getpid ( ) except AttributeError : pid = 1 randint = random . randrange ( 100000 ) if ( idstring is None ) : idstring = '' else : idstring = ( '.' + idstring ) idhost = DNS_NAME msgid = ( '<%s.%s.%s%s@%s>' % ( utcdate , pid , randint , idstring , idhost ) ) return msgid
returns a string suitable for rfc 2822 compliant message-id .