def envfrom(self, mailfrom, *str): self.fromparms = Milter.param2dict(str) # ESMTP parms self.user = self.getsymval('{auth_authen}') # authenticated user self.canon_from = '@'.join(parse_addr(mailfrom)) self.R = [] self.fp = BytesIO() self.fp.write(b"From %s %s\n" % (codecs.encode(self.canon_from, 'utf-8'), codecs.encode(time.ctime(), 'utf-8'))) return Milter.CONTINUE
def envrcpt(self, to, *str): toparms = Milter.param2dict(str) self.R.append(to) if self.getsymval('{rcpt_host}') not in self.nexthop and self.getsymval('{rcpt_host}') is not None: self.nexthop.append(self.getsymval('{rcpt_host}')) return Milter.CONTINUE