Ejemplo n.º 1
0
 def accept_msgdata(self, sender, message):
     if not hasattr(self, 'nr_connections'):
         self.nr_connections = 0
     self.nr_connections = (self.nr_connections + 1) % 2
     decision = PolicyDecision(True)
     drop_this_connection = (self.nr_connections == 1)
     decision._close_connection_after_response = drop_this_connection
     return decision
Ejemplo n.º 2
0
 def accept_helo(self, helo_string, message):
     decision = PolicyDecision(True)
     decision._close_connection_before_response = True
     decision._close_connection_after_response = True
     return decision
Ejemplo n.º 3
0
 def accept_msgdata(self, sender, message):
     decision = PolicyDecision(True)
     decision._close_connection_after_response = True
     return decision
Ejemplo n.º 4
0
 def accept_helo(self, helo_string, message):
     decision = PolicyDecision(False, (552, 'Stupid Spammer'))
     decision._close_connection_after_response = True
     return decision
Ejemplo n.º 5
0
 def accept_helo(self, helo_string, message):
     return PolicyDecision(False, (553, 'I am tired'))
Ejemplo n.º 6
0
 def accept_helo(self, helo_string, message):
     is_localhost = (helo_string == 'localhost')
     return PolicyDecision(decision=is_localhost)