code: def make_msgid(idstring=None, domain=None):
      
      timeval = time.time()
      utcdate = time.strftime('%Y%m%d%H%M%S', time.gmtime(timeval))
      pid = os.getpid()
      randint = random.randrange(100000)
      if idstring is None:
          idstring = ''
      else:
          idstring = '.' + idstring
      if domain is None:
          domain = socket.getfqdn()
      msgid = '<%s.%s.%s%s@%s>' % (utcdate, pid, randint, idstring, domain)
      return msgid
docs: 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.  Optional domain if given provides the
      portion of the message id after the '@'.  It defaults to the locally
      defined hostname.