docs: def ext_process(listname, hostname, url, filepath, msg):
      """Here's where you put your code to deal with the just archived message.
  
      Arguments here are the list name, the host name, the URL to the just
      archived message, the file system path to the just archived message and
      the message object.
  
      These can be replaced or augmented as needed.
      """
      from pyes import ES
      from pyes.exceptions import ClusterBlockException, NoServerAvailable
      import datetime
  
      #CHANGE this settings to reflect your configuration
      _ES_SERVERS = ['127.0.0.1:9500'] # I prefer thrift
      _indexname = "mailman"
      _doctype = "mail"
      date = datetime.datetime.today()
  
      try:
          iconn = ES(_ES_SERVERS)
          status = None
          try:
              status = iconn.status(_indexname)
              logger.debug("Indexer status:%s" % status)
          except:
              iconn.create_index(_indexname)
              time.sleep(1)
              status = iconn.status(_indexname)
              mappings = { u'text': {'boost': 1.0,
                                       'index': 'analyzed',
                                       'store': 'yes',
                                       'type': u'string',
                                       "term_vector" : "with_positions_offsets"},
                               u'url': {'boost': 1.0,
                                          'index': 'not_analyzed',
                                          'store': 'yes',
                                          'type': u'string',
                                          "term_vector" : "no"},
                               u'title': {'boost': 1.0,
                                          'index': 'analyzed',
                                          'store': 'yes',
                                          'type': u'string',
                                          "term_vector" : "with_positions_offsets"},
                               u'date': {'store': 'yes',
                                          'type': u'date'}}
              time.sleep(1)
              status = iconn.put_mapping(_doctype, mappings, _indexname)
  
  
          data = dict(url=url,
                      title=msg.get('subject'),
                      date=date,
                      text=str(msg)
                      )
          iconn.index(data, _indexname, _doctype)
  
          syslog('debug', 'listname: %s, hostname: %s, url: %s, path: %s, msg: %s',
                 listname, hostname, url, filepath, msg)
      except ClusterBlockException:
          syslog('error', 'Cluster in revocery state: listname: %s, hostname: %s, url: %s, path: %s, msg: %s',
                 listname, hostname, url, filepath, msg)
      except NoServerAvailable:
          syslog('error', 'No server available: listname: %s, hostname: %s, url: %s, path: %s, msg: %s',
                 listname, hostname, url, filepath, msg)
      except:
          import traceback
          syslog('error', 'Unknown: listname: %s, hostname: %s, url: %s, path: %s, msg: %s\nstacktrace: %s',
                 listname, hostname, url, filepath, msg, repr(traceback.format_exc()))
  
      return