Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(12)  |  Call(12)  |  Derive(0)  |  Import(0)

src/m/i/milter-0.8.18/bms.py   milter(Download)
  def _headerChange(self,msg,name,value):
    if value:   # add header
      self.addheader(name,value)
    else:       # delete all headers with name
      h = msg.getheaders(name)
      self.addrcpt(rcpt)
      if not blind_wiretap:
        self.addheader('Cc',rcpt)
 
  # 
                canonicalize=('relaxed','simple'))
        name,val = h.split(':',1)
        self.addheader(name,val.strip().replace('\r\n','\n'),0)
      except dkim.DKIMException as x:
        self.log('DKIM: %s'%x)
      try:
        try:
          self.addheader(name,val,idx)
        except TypeError:
          val = val.replace('\x00',r'\x00')
          self.addheader(name,val,idx)

src/m/i/milter-0.8.18/dkim-milter.py   milter(Download)
      self.log(h)
      name,val = str(h).split(': ',1)
      self.addheader(name,val,0)
    return Milter.CONTINUE
 
                canonicalize=('relaxed','simple'))
        name,val = h.split(': ',1)
        self.addheader(name,val.strip().replace('\r\n','\n'),0)
      except dkim.DKIMException as x:
        self.log('DKIM: %s'%x)

src/m/i/milter-0.8.18/spfmilter.py   milter(Download)
  def eom(self):
    for name,val,idx in self.new_headers:
      try:
        self.addheader(name,val,idx)
      except:
        self.addheader(name,val)	# older sendmail can't insheader

src/d/s/dspam-milter-0.3.3/dspam/milter.py   dspam-milter(Download)
                logger.debug(
                    '<{}> Adding header {}: {}'.format(self.id, hname, hvalue))
                self.addheader(hname, hvalue)
            elif header == 'Processed':
                # X-DSPAM-Processed: Wed Dec 12 02:19:23 2012
                hvalue = datetime.datetime.now().strftime(
                    '%a %b %d %H:%M:%S %Y')
                logger.debug(
                    '<{}> Adding header {}: {}'.format(self.id, hname, hvalue))
                self.addheader(hname, hvalue)