add delrcpt
This commit is contained in:
@@ -192,6 +192,15 @@ class ModifyMilter(Milter.Base):
|
|||||||
def replacebody(self):
|
def replacebody(self):
|
||||||
self._replacebody = True
|
self._replacebody = True
|
||||||
|
|
||||||
|
def delrcpt(self, rcpts):
|
||||||
|
"Remove recipient. May be called from eom callback only."
|
||||||
|
if not isinstance(rcpts, list):
|
||||||
|
rcpts = [rcpts]
|
||||||
|
for rcpt in rcpts:
|
||||||
|
self.logger.debug(f"delrcpt: {rcpt}")
|
||||||
|
self.msginfo["rcpts"].remove(rcpt)
|
||||||
|
super().delrcpt(rcpt)
|
||||||
|
|
||||||
def connect(self, IPname, family, hostaddr):
|
def connect(self, IPname, family, hostaddr):
|
||||||
try:
|
try:
|
||||||
if hostaddr is None:
|
if hostaddr is None:
|
||||||
|
|||||||
@@ -301,7 +301,8 @@ class Quarantine:
|
|||||||
custom_logger = CustomLogger(
|
custom_logger = CustomLogger(
|
||||||
self.notification_logger, {"name": self.notification_name})
|
self.notification_logger, {"name": self.notification_name})
|
||||||
self.notification.execute(milter, pretend, custom_logger)
|
self.notification.execute(milter, pretend, custom_logger)
|
||||||
milter.msginfo["rcpts"] = []
|
|
||||||
|
milter.delrcpt(milter.msginfo["rcpts"].copy())
|
||||||
|
|
||||||
if self.milter_action is not None:
|
if self.milter_action is not None:
|
||||||
return (self.milter_action, self.reject_reason)
|
return (self.milter_action, self.reject_reason)
|
||||||
|
|||||||
Reference in New Issue
Block a user