当前位置: 首页>>代码示例>>Python>>正文


Python Milter.dictfromlist方法代码示例

本文整理汇总了Python中Milter.dictfromlist方法的典型用法代码示例。如果您正苦于以下问题:Python Milter.dictfromlist方法的具体用法?Python Milter.dictfromlist怎么用?Python Milter.dictfromlist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Milter的用法示例。


在下文中一共展示了Milter.dictfromlist方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: envrcpt

# 需要导入模块: import Milter [as 别名]
# 或者: from Milter import dictfromlist [as 别名]
  def envrcpt(self, to, *str):
    rcptinfo = to,Milter.dictfromlist(str)
    self.R.append(rcptinfo)
    self.log("to: ", parse_addr(to)[0])

    a = 23
    b = 42
    addr = parse_addr(to)[0]
    euser = addr[0:2]
    ecsum = addr[2:4]
    eitext = addr[4:]
    edomain = parse_addr(to)[1]
    genitext = ''.join((euser, eitext, edomain))
    gencsum = hashlib.sha512(genitext.encode('utf-8')).hexdigest()
    posa = int(a)-1
    posb = int(b)-1
    csuma = gencsum[posa:(posa+1)]
    csumb = gencsum[posb:(posb+1)]

    self.log(addr, euser, ecsum, eitext, edomain, genitext, gencsum, posa, posb, csuma, csumb)

    if(ecsum != "".join((csuma,csumb))):
      self.log("Computer sagt nein.")
      return Milter.REJECT

    self.log("Computer sagt ja.")
    return Milter.CONTINUE
开发者ID:hax404,项目名称:rabf,代码行数:29,代码来源:rabf.py

示例2: envfrom

# 需要导入模块: import Milter [as 别名]
# 或者: from Milter import dictfromlist [as 别名]
 def envfrom(self, mailfrom, *str):
     self.log("mail from: %s  -  %s" % (mailfrom, str))
     self.fromparms = Milter.dictfromlist(str)
     # NOTE: self.fp is only an *internal* copy of message data.  You
     # must use addheader, chgheader, replacebody to change the message
     # on the MTA.
     self.fp = StringIO.StringIO()
     self.canon_from = "@".join(parse_addr(mailfrom))
     self.fp.write("From %s %s\n" % (self.canon_from, time.ctime()))
     return Milter.CONTINUE
开发者ID:DhritiShikhar,项目名称:pagure,代码行数:12,代码来源:comment_email_milter.py

示例3: envfrom

# 需要导入模块: import Milter [as 别名]
# 或者: from Milter import dictfromlist [as 别名]
	def envfrom( self, mailfrom, *ESMTP_params ):
		self.Message.SMTP.MAIL_FROM = mailfrom.strip( '<>' );
		self.Message.SMTP.MAIL_FROM_PARAMS = Milter.dictfromlist( ESMTP_params );    # ESMTP params
		self.Message.SMTP.AUTH_USER = self.getsymval( '{auth_authen}' );    # Authenticated User
# 		self.canon_from = '@'.join( parse_addr( mailfrom ) )
# 		self.Message.Raw.write( 'From %s %s\n' % ( self.canon_from, time.ctime() ) )

		self.log.smtp( "mail from:", self.Message.SMTP.MAIL_FROM, *ESMTP_params )

		return self.ProcessRuleSet();
开发者ID:cpriest,项目名称:BanBot,代码行数:12,代码来源:BanBotMilter.py

示例4: envfrom

# 需要导入模块: import Milter [as 别名]
# 或者: from Milter import dictfromlist [as 别名]
    def envfrom(self, mailfrom, *str):
        self.F = mailfrom
        self.R = []  
        self.fromparms = Milter.dictfromlist(str)  
        self.user = self.getsymval('{auth_authen}')  
       

        self.fp = StringIO.StringIO()
        self.canon_from = '@'.join(parse_addr(mailfrom))
        self.fp.write('From %s %s\n' % (self.canon_from, time.ctime()))
        return Milter.CONTINUE
开发者ID:naruto0323,项目名称:Milters,代码行数:13,代码来源:openpgpkey.py

示例5: envfrom

# 需要导入模块: import Milter [as 别名]
# 或者: from Milter import dictfromlist [as 别名]
 def envfrom(self, mailfrom, *str):
   self.F = mailfrom
   self.R = []  # list of recipients
   self.fromparms = Milter.dictfromlist(str)	# ESMTP parms
   self.user = self.getsymval('{auth_authen}')	# authenticated user
   self.log("mail from:", mailfrom, *str)
   # NOTE: self.fp is only an *internal* copy of message data.  You
   # must use addheader, chgheader, replacebody to change the message
   # on the MTA.
   self.fp = StringIO()
   self.canon_from = '@'.join(parse_addr(mailfrom))
   self.fp.write('From %s %s\n' % (self.canon_from,time.ctime()))
   return Milter.CONTINUE
开发者ID:sdgathman,项目名称:pymilter,代码行数:15,代码来源:milter-template.py

示例6: envrcpt

# 需要导入模块: import Milter [as 别名]
# 或者: from Milter import dictfromlist [as 别名]
    def envrcpt(self, to, *str):
        rcptinfo = to, Milter.dictfromlist(str)
        print rcptinfo

        return Milter.CONTINUE
开发者ID:DhritiShikhar,项目名称:pagure,代码行数:7,代码来源:comment_email_milter.py

示例7: envrcpt

# 需要导入模块: import Milter [as 别名]
# 或者: from Milter import dictfromlist [as 别名]
 def envrcpt(self, to, *str):
   rcptinfo = to,Milter.dictfromlist(str)
   self.R.append(rcptinfo)
   
   return Milter.CONTINUE
开发者ID:sdgathman,项目名称:pymilter,代码行数:7,代码来源:milter-template.py


注:本文中的Milter.dictfromlist方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。