本文整理汇总了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
示例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
示例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();
示例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
示例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
示例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
示例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