~sambuddhabasu1/mailman/fix_mailman_run_error

« back to all changes in this revision

Viewing changes to src/mailman/runners/lmtp.py

  • Committer: Barry Warsaw
  • Date: 2012-03-26 12:04:00 UTC
  • Revision ID: barry@list.org-20120326120400-jfezy6cg60ygod7k
Architecture
------------
 * Internally, all datetimes are kept in the UTC timezone, however because of
   LP: #280708, they are stored in the database in naive format.
 * `received_time` is now added to the message metadata by the LMTP runner
   instead of by `Switchboard.enqueue()`.  This latter no longer depends on
   `received_time` in the metadata.
 * The `ArchiveRunner` no longer acquires a lock before it calls the
   individual archiver implementations, since not all of them need a lock.  If
   they do, the implementations must acquire said lock themselves.

Configuration
-------------
 * New configuration variables `clobber_date` and `clobber_skew` supported in
   every `[archiver.<name>]` section.  These are used to determine under what
   circumstances a message destined for a specific archiver should have its
   `Date:` header clobbered.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
from mailman.database.transaction import txn
45
45
from mailman.email.message import Message
46
46
from mailman.interfaces.listmanager import IListManager
 
47
from mailman.utilities.datetime import now
47
48
from mailman.utilities.email import add_message_hash
48
49
 
 
50
 
49
51
elog = logging.getLogger('mailman.error')
50
52
qlog = logging.getLogger('mailman.runner')
51
53
slog = logging.getLogger('mailman.smtp')
181
183
        # see if it's destined for a valid mailing list.  If so, then queue
182
184
        # the message to the appropriate place and record a 250 status for
183
185
        # that recipient.  If not, record a failure status for that recipient.
 
186
        received_time = now()
184
187
        for to in rcpttos:
185
188
            try:
186
189
                to = parseaddr(to)[1].lower()
196
199
                # queue.
197
200
                queue = None
198
201
                msgdata = dict(listname=listname,
199
 
                               original_size=msg.original_size)
 
202
                               original_size=msg.original_size,
 
203
                               received_time=received_time)
200
204
                canonical_subaddress = SUBADDRESS_NAMES.get(subaddress)
201
205
                queue = SUBADDRESS_QUEUES.get(canonical_subaddress)
202
206
                if subaddress is None: