diff options
| author | Barry Warsaw | 2011-05-15 12:19:25 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2011-05-15 12:19:25 -0400 |
| commit | b8e977bfe7b144c690c30a4bc0b94d74a35faeac (patch) | |
| tree | 069e91e7b1a436336eb23683bbb0fd474924fab4 /src/mailman/queue/outgoing.py | |
| parent | 091917126e7c58657310524882743e8391166fc3 (diff) | |
| parent | 9d30e3d7f584093fd30d2cbdd1124b4d49adb132 (diff) | |
| download | mailman-b8e977bfe7b144c690c30a4bc0b94d74a35faeac.tar.gz mailman-b8e977bfe7b144c690c30a4bc0b94d74a35faeac.tar.zst mailman-b8e977bfe7b144c690c30a4bc0b94d74a35faeac.zip | |
Diffstat (limited to 'src/mailman/queue/outgoing.py')
| -rw-r--r-- | src/mailman/queue/outgoing.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mailman/queue/outgoing.py b/src/mailman/queue/outgoing.py index 7ff194219..dfa60a02d 100644 --- a/src/mailman/queue/outgoing.py +++ b/src/mailman/queue/outgoing.py @@ -28,6 +28,7 @@ from mailman.interfaces.mailinglist import Personalization from mailman.interfaces.mta import SomeRecipientsFailed from mailman.queue import Runner from mailman.queue.bounce import BounceMixin +from mailman.utilities.datetime import now from mailman.utilities.modules import find_name @@ -56,7 +57,7 @@ class OutgoingRunner(Runner, BounceMixin): def _dispose(self, mlist, msg, msgdata): # See if we should retry delivery of this message again. deliver_after = msgdata.get('deliver_after', datetime.fromtimestamp(0)) - if datetime.now() < deliver_after: + if now() < deliver_after: return True # Calculate whether we should VERP this message or not. The results of # this set the 'verp' key in the message metadata. @@ -69,7 +70,7 @@ class OutgoingRunner(Runner, BounceMixin): # Also, if personalization is /not/ enabled, but # verp_delivery_interval is set (and we've hit this interval), then # again, this message should be VERP'd. Otherwise, no. - elif mlist.personalize <> Personalization.none: + elif mlist.personalize != Personalization.none: if as_boolean(config.mta.verp_personalized_deliveries): msgdata['verp'] = True elif interval == 0: @@ -118,15 +119,15 @@ class OutgoingRunner(Runner, BounceMixin): # occasionally move them back here for another shot at # delivery. if error.temporary_failures: - now = datetime.now() + current_time = now() recips = error.temporary_failures last_recip_count = msgdata.get('last_recip_count', 0) - deliver_until = msgdata.get('deliver_until', now) + deliver_until = msgdata.get('deliver_until', current_time) if len(recips) == last_recip_count: # We didn't make any progress, so don't attempt # delivery any longer. BAW: is this the best # disposition? - if now > deliver_until: + if current_time > deliver_until: return False else: # Keep trying to delivery this message for a while |
