summaryrefslogtreecommitdiff
path: root/Mailman/Bouncer.py
Commit message (Collapse)AuthorAgeFilesLines
* Bite the bullet: rename the Mailman package to mailman.Barry Warsaw2008-02-271-250/+0
|
* Tweak copyright years.Barry Warsaw2008-02-071-1/+1
|
* Reorganize the enums so that they live in the most appropriate interface. TheBarry Warsaw2007-10-091-1/+1
| | | | only constant left in Mailman.constants is now actually a constant.
* Removed a bunch of files that are obsolete. The interfaces are all foldedBarry Warsaw2007-09-271-14/+15
| | | | | | | | | | | | | into the IMailingList interface. OTOH, MemberAdaptor.py is completely useless now (though not entirely eradicated), as is OldStyleMemberships.py. versions.py isn't necessary any longer either because we'll have to do database migrations (and conversions from MM2.1) completely differently. New command line script 'set_members' which is used to take a CSV file and syncing that to a list's membership. Added back the DeliveryStatus.unknown item because we'll need it when we migrate MM 2.1 databases.
* OMGW00T: After over a decade, the MailList mixin class is gone! Well,Barry Warsaw2007-09-211-25/+0
| | | | | | | | | | | | mostly. It's no longer needed by anything in the test suite, and therefore the list manager returns database MailingList objects directly. The wrapper cruft has been removed. To accomplish this, a couple of hacks were added to the Mailman.app package, which will get cleaned up over time. The MailList module itself (and its few remaining mixins) aren't yet removed from the tree because some of the code is still not tested, and I want to leave this code around until I've finished converting it.
* It all started by trying to remove MailList.Create() and use the IListManagerBarry Warsaw2007-08-051-25/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | interface to create and delete lists. Mostly that's working now, but I need unit tests for most of the new work contained in this revision. Implemented a rudimentary 'list styles' subsystem, along with interfaces, but no tests yet. Moved all of MailList.InitVars() into a DefaultStyle, which is always available at priority zero. It's used by default if there are no matching styles for a mailing list. Because of the list styles, we can now get rid of (almost) all InitVars() methods. And because of /that/ we can get rid of the mixin clases whose sole purpose was to provide an InitVars() method. Yay for code removal! Mixin modules/classes removed: Autoresponder, GatewayManager, TopicManager. Removed the Mailman/ext crufty extension mechanism. Extensions will now be done using setuptools plugins. Hopefully this will take us everywhere we need to go, but I'll add Mailman.ext back if necessary later. Mailiman.app.create module added to implement a common, higher-level list creation feature. This is used by bin/newlist now, though some of that functionality (namely, ensuring the owners exist in the database, and notifying the owners) should be moved here. The MTA plugins aren't yet integrated into this, but need to be. Mailman.app.plugins module added to generalize setuptools plugin management. Defaults.DEFAULT_REPLY_GOES_TO_LIST now gets initialized with a proper enum. Also, the duplicate DeliveryMode and DeliveryStatus enums are removed from Defaults because they're in Mailman.constants. Added Errors.DuplicateStyleError. Updated Utils.list_exists() to use the new IListManager.get() interface, which has been changed to return None if the list doesn't exist (for consistency) instead of raising an exception. Utils.list_names() also needed to be fixed to use config.db.list_manager. bin/make_instance, bin/newlist, bin/rmlist changed to use parser.error() istead of printing to sys.stderr and sys.exit(1). bin/newlist and bin/rmlist now works with the IListManager interface, so you can create and delete lists from the command line again. The CLI for newlist has been much simplified; it no longer prompts for missing positional arguments. It now uses a more traditional CLI. newlist also accepts zero to many owners, and it ensures that the owners are all in the database. It no longer asks for a list password, because this doesn't make sense any more. bin/withlist has also been fixed to work with the IListManager interface. There are lots of XXXs and FIXMEs that need to be resolved before this can land. Also, we need to test all this stuff before it can land. Configuration.load() is now taught to search in sys.argv[0] for var/etc/mailman.cfg since this is where it is for egg development layouts. Also, VAR_DIR must be abspath'd. Added an __all__ to Mailman.constants, and added an Action enum. The listmanager implementation has to set the mlist.created_at time. There's also a bit of crufty refactoring going on to instantiate the roster objects whenever the list is created or retrieved from the database. Several MailingList column types are now set to our custom TimeDeltaType, which knows how to store a datetime.timedelta. A SQLAlchemny converter type is added to Mailman.database.types. I also fixed a bug in the EnumType implementation.
* Move the pending database into the SQLAlchemy/Elixir layer. The oldBarry Warsaw2007-08-011-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pending.py module is removed. Added an interface to this functionality such that any IPendable (essentially a key/value mapping) can be associated with a token, and that token can be confirmed and has a lifetime. Any keys and values can be stored, as long as both are unicodes. Added a doctest. Modified initialization of the database layer to support pluggability via setuptools. No longer is this layer initialized from a module, but now it's instantiated from a class that implements IDatabase. The StockDatabase class implements the SQLAchemy/Elixir layer, but this can be overridden in a setup.py. Bye bye MANAGERS_INIT_FUNCTION, we hardly knew ye. Added a package Mailman.app which will contain certain application specific functionality. Right now, the only there there is an IRegistar implementation, which didn't seem to fit anywhere else. Speaking of which, the IRegistrar interface implements all the logic related to registration and verification of email addresses. Think the equivalent of MailList.AddMember() except generalized out of a mailing list context. This latter will eventually go away. The IRegistrar sends the confirmation email. Added an IDomain interface, though the only implementation of this so far lives in the registration.txt doctest. This defines the context necessary for domain-level things, like address confirmation. A bunch of other cleanups in modules that are necessary due to the refactoring of Pending, but don't affect anything that's actually tested yet, so I won't vouch for them (except that they don't throw errors on import!). Clean up Defaults.py; also turn the functions seconds(), minutes(), hours() and days() into their datetime.timedelta equivalents. Consolidated the bogus email address exceptions. In some places where appropriate, use email 4.0 module names instead of the older brand. Switch from Mailman.Utils.unique_message_id() to email.utils.make_msgid() everywhere. This is because we need to allow sending not in the context of a mailing list (i.e. domain-wide address confirmation message). So we can't use a Message-ID generator that requires a mailing list. OTOH, this breaks Message-ID collision detection in the mail->news gateway. I'll fix that eventually. Remove the 'verified' row on the Address table. Now verification is checked by Address.verified_on not being None.
* Convert failing test_message.py to doctests bounces.txt and message.txt, whichBarry Warsaw2007-07-011-3/+3
| | | | | | | | | | | | | of course now succeed. Rename Bouncer.py's BounceMessage() method to bounce_message() and remove the 'msgdata' parameter, which wasn't being used. Change the RejectNotice exception class to expose .notice directly, as there's no reason for this to be an accessor or property. Move the coverage.py installation to the install-packages target instead of the install-other target, so that it only gets installed once the pythonlib directory is created.
* Update copyright years.bwarsaw2007-01-191-1/+1
|
* Merged revisions 8113-8121 via svnmerge from bwarsaw2006-12-291-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://mailman.svn.sourceforge.net/svnroot/mailman/branches/tmp-sqlalchemy-branch ................ r8114 | bwarsaw | 2006-12-06 00:16:54 -0500 (Wed, 06 Dec 2006) | 44 lines Initial take on using SQLAlchemy to store list data in lieu of Python pickles. While all the list data (including OldStyleMemberships attributes) are stored in the database, many attributes are stored as PickleTypes binary data. This isn't idea but it gets things working until a more sophisticated schema can be developed. MailList class is now a new-style class, as is required by SQLAlchemy. This makes several things, er, interesting. Rip out all the low-level pickle reading and writing stuff. Hook SA transaction events into Lock() and Unlock(). Move the hooking of the _memberadaptor into InitTempVars(), which gets called by the SQLAlchemy hooks (MailList.__init__() never is). Add an initialize.py module which centralizes all the initialization bits that command line scripts have to do, including configuration, logging, and atabase initialization. This change also converts bin/withlist to mmshell wrapper. Update to SQLAlchemy 0.3.1. Revamp paths.py.in considerably. There were several problems with the old way. We no longer disable default loading of site-packages so we don't need to add Python's site-packages back to sys.path. Also, because site.addsitedir() causes things like .pth paths to be /appended/ to sys.path, they actually won't override any site-installed packages. E.g. if SQLAlchemy is installed in the system Python, our version will not override. IIUC, setuptools-based packages can be configured to work properly in the face of package versions, however not all packages we currently depend on are setuptools-based. So instead, we steal a bit of stuff from site.py but change things so the prepend .pth stuff to sys.path. Update several modules to use True/False and whitespace normalization. Convert from mm_cfg to config object. Modernize a few coding constructs. Add a couple of exceptions to handle database problems. In the export script, include the widget type in the elements. This helped in my stupid little throw away conversion script, but I think it will be more generally useful. Add an interact.py module which refactors interactive interpreter access. Mostly this is used by withlist -i, but it lets us import Mailman.interact and drop into a prompt just about anywhere (e.g. debugging). ................ r8115 | bwarsaw | 2006-12-07 09:13:56 -0500 (Thu, 07 Dec 2006) | 22 lines Start to flesh out more of the SQLAlchemy mechanisms. Added a MailList.__new__() which hooks instantiation to use a query on dbcontext to get an existing mailing list. A 'no-args' call means we're doing a Create(), though eventually that will change too. For now, disable the CheckVersion() call. Eventually this will be folded into schema migration. list_exists(): Rewrite to use the dbcontext query to determine if the named mailing list exists or not. Requires the fqdn_listname. Eradicate two failed member adaptors: BDBMemberAdaptor and SAMemberships. Change the way the DBContext holds onto tables. It now keeps a dictionary mapping the table's name to the SA Table instance. This makes it easier to look up and use the individual tables. Add 'web_page_url' as an attribute managed by SA, and remove a debugging print. ................ r8116 | bwarsaw | 2006-12-11 07:27:47 -0500 (Mon, 11 Dec 2006) | 29 lines Rework the whole dbcontext and transaction framework. SA already handles nested transactions so we don't have to worry about them. However, we do have the weird situation where some transactions are tied to MailList .Lock()/.Unlock()/.Save() and some are tied to non-mlist actions. So now we use an @txn decorator to put methods in a session transaction, but then we also hook into the above MailList methods as possibly sub-transactions. We use a weakref subclass to manage the MailList interface, with a dictionary mapping MailList fqdn_listnames against transactions. The weakrefs come in by giving us a callback when a MailList gets derefed such that we're guaranteed to rollback any outstanding transaction. Also, we have one global DBContext instance but rather than force the rest of Mailman to deal with context objects, instead we expose API methods on that object into the Mailman.database module, which the rest of the code will use. Such methods must be prepended with 'api_' to get exposed this way. bin/rmlist now works with the SA-backend. I refactored the code here so that other code (namely, the test suite) can more easily and consistently remove a mailing list. This isn't the best place for it ultimately, but it's good enough for now. New convenience functions Utils.split_listname(), .fqdn_listname(). Convert testall to use Mailman.initialize.initialize(). Not all tests work, but I'm down to only 8 failures and 7 errors. Also, do a better job of recovering from failures in setUp(). MailList.__new__() now takes keyword arguments. ................ r8117 | bwarsaw | 2006-12-11 22:58:06 -0500 (Mon, 11 Dec 2006) | 7 lines Unit test repairs; even though the unit tests are still pretty fragile, everything now passes with the SQLAlchemy storage of list data. Added missing 'personalize' column. Converted mailmanctl and qrunner to initialize() interface. Fixed _cookie_path() to not fail if SCRIPT_NAME is not in the environment. ................ r8118 | bwarsaw | 2006-12-27 18:45:41 -0500 (Wed, 27 Dec 2006) | 21 lines Utils.list_names(): Use a database query to get all the list names. dbcontext.py: Added api_get_list_names() to support Utils.list_names(). listdata.py: Added two additional MailList attributes which need to be stored in the database. The first is 'admin_member_chunksize' which isn't modifiable from the web. The second is 'password' which holds the list's password. HTMLFormatObject: item strings can now be unicodes. bin/list_lists.py: Must call initialize() to get the database properly initialized, not just config.load(). This will be a common theme. SecurityManager.py: - Remove md5 and crypt support - Added mailman.debug logger, though it will be only used during debugging. - The 'secret' can be a unicode now. - A few coding style updates; repr() instead of backticks, 'key in dict' instead of 'dict.has_key(key)' ................ r8119 | bwarsaw | 2006-12-27 19:13:09 -0500 (Wed, 27 Dec 2006) | 2 lines genaliases.py: config.load() -> initialize() ................ r8120 | bwarsaw | 2006-12-27 19:17:26 -0500 (Wed, 27 Dec 2006) | 9 lines Blocked revisions 8113 via svnmerge ........ r8113 | bwarsaw | 2006-12-05 23:54:30 -0500 (Tue, 05 Dec 2006) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-8112" from https://mailman.svn.sourceforge.net/svnroot/mailman/branches/tmp-sqlalchemy-branch ........ ................ r8121 | bwarsaw | 2006-12-28 23:34:52 -0500 (Thu, 28 Dec 2006) | 20 lines Remove SIGTERM handling from all the CGI scripts. This messes with HTTPRunner because when you issue "mailmanctl stop" after the signal handler has been installed, the process will get a SIGTERM, the signal handler will run, and the process will exit with a normal zero code. This will cause mailmanctl to try to restart the HTTPRunner. I don't think we need that stuff at all when running under wsgi with a SQLAlchemy backend. If mailmanctl kills the HTTPRunner in the middle of the process, I believe (but have not tested) that the transaction should get properly rolled back at process exit. We need to make sure about this, and also we need to test the signal handling functionality under traditional CGI environment (if we even still want to support that). Also, make sure that we don't try to initialize the loggers twice in qrunner. This was the cause of all the double entries in logs/qrunner. Fix a coding style nit in mailmanctl.py. De-DOS-ify line endings in loginit.py. ................
* Fix some buglets with virtual domain support and repair unit tests broken bybwarsaw2006-07-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | this change. More unit tests should be added. misc/sitelist.cfg is removed -- this is an ex-site list. MailList.GetNoReplyEmail() -> MailList.no_reply_address (property) UserNotification._enqueue(), OwnerNotification._enqueue(): when queing the message to the virgin queue, be sure to use the fully qualified (i.e. posting) address for the list. In the MTA modules, be sure to set up the target of the mail commands as the fqdn listname because otherwise we can't find the correct list. This needs some tweaking/testing for Postfix's virtual domain support. MailList.Load() has to grow an optional argument specifying the fqdn listname. The problem is that in some situations, we can't calculate that because we don't know _internal_name, so it has to be passed in. This is mostly the case in the MailList ctor where a Load hasn't happened yet. For backward compatibility though, if it's not passed in, just use mlist.fqdn_listname.
* First crack at real virtual domain support, i.e. mailing lists with the samebwarsaw2006-07-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | name in more than one domain. - Totally eradicate MAILMAN_SITE_LIST, and in fact the entire need for a site list. The functions that the site list previously performed are either removed or supported in other ways. For example, instead of forwarding owner bounces to the site list, we now have a SITE_OWNER_ADDRESS which should point to a human, and such bounces are sent there instead. There's also a "no reply" email address that should be set up to go to devnull. For any message that never expects a reply, the sender is set to this address. - Remove the Site.py module. It was an experimental approach to trying to support virtual domains, and we're going to do it so much better now that this module is no longer necessary. Site._makedirs() -> Utils.makedir(). - VIRTUAL_HOST_OVERVIEW is completely removed, since now virtual hosts are always enabled. Virtual domains should be added to mailman.cfg by using the new add_domain() function. add_virtualhost() is gone. If no virtual domains are added explicitly, we add the default one that configure guessed (but we never add that if domains are added explicitly). - Utils.get_domain() -> Utils.get_request_domain() - withlist code cleanup and make sure that we load etc/mailman.cfg - A new base exception called MailmanException is added, from which all exceptions defined in Errors.py ultimately derive. MailmanError is retained and derives from MailmanException. - BadDomainSpecificationError is added. - Remove the -V/--virtual-host-overview option from list_lists and add instead -d/--domain and -f/--full. - bin/update probably works but needs more testing. - bin/newlist and bin/rmlist take fqdn list names, but default to the default domain if @whatever isn't given. newlist's -u/--urlhost and -e/--emailhost options are removed. The domain that the list is being added to must already exist. - Minor code cleanup in Message.py - Bump version to 2.2.0a1 - The Configuration object grows a .domain dictionary which maps email hosts to url hosts. The reverse mapping is supported, but not directly; use Configuration.get_email_host() instead. - Mailman/Cgi/create is converted from mm_cfg to config, and some minor code cleanup is performed. Also, convert to __i18n_templates__ = True. - New MailList APIs: + property .fqdn_listname + GetNoReplyEmail() + Create() API changes and refactoring.
* Remove most uses of the types module, in favor of isinstance checks againstbwarsaw2006-04-171-2/+1
| | | | | | the builtin types. Two still remain: a check against ClassType and a check against MethodType. Also, fix some hinky type comparisons to use isinstance() consistently.
* - Convert all logging to Python's standard logging module. Get rid of allbwarsaw2006-04-171-35/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | traces of our crufty old Syslog. Most of this work was purely mechanical, except for: 1) Initializing the loggers. For this, there's a new module Mailman/loginit.py (yes all modules from now on will use PEP 8 names). We can't call this 'logging.py' because that will interfere with importing the stdlib module of the same name (can you say Python 2.5 and absolute imports?). If you want to write log messages both to the log file and to stderr, pass True to loginit.initialize(). This will turn on propagation of log messages to the parent 'mailman' logger, which is set up to print to stderr. This is how bin/qrunner works when not running as a subprocess of mailmanctl. 2) The driver script. I had to untwist the StampedLogger stuff and implement differently printing exceptions and such to log/error because standard logging objects don't have a write() method. So we write to a cStringIO and then pass that to the logger. 3) SMTPDirect.py because of the configurability of the log messages. This required changing SafeDict into a dict subclass (which is better than using UserDicts anyway -- yay Python 2.3!). It's probably still possible to flummox things up if you change the name of the loggers in the SMTP_LOG_* variables in mm_cfg.py. However, the worst you can do is cause output to go to stderr and not go to a log file. Note too that all entry points into the Mailman system must call Mailman.loginit.initialize() or the log output will go to stderr (which may occasionally be what you want). Currently all CGIs and qrunners should be working properly. I wish I could have tested all code paths that touch the logger, but that's infeasible. I have tested this, but it's possible that there were some mistakes in the translation. - Mailman.Bouncers.BounceAPI.Stop is a singleton, but not a class instance any more. - True/False code cleanup, PEP 8 import restructuring, whitespace normalization, and copyright year updates, as appropriate.
* Whitespace normalization.bwarsaw2005-12-061-4/+4
|
* Update copyright date for prior change.msapiro2005-12-061-1/+1
|
* Make bounce log message format more consistent.msapiro2005-12-061-1/+1
|
* back porting from 2.1.6tkikuchi2005-08-281-13/+28
|
* FSF office has moved. chdcking in for MAIN branch.tkikuchi2005-08-271-1/+1
|
* registerBounce(): Add optional argument `day' which can be used by thebwarsaw2003-08-171-11/+13
| | | | | queuing bounce processor, which records bounce events (including dates). Use "today" if None (the default).
* Whitespace normalization.bwarsaw2002-10-191-4/+4
|
* Fix typo in last checkin. Thanks Ousmane!bwarsaw2002-08-161-1/+1
|
* __sendAdminBounceNotice(): Applied Simone Piunno's patch to fix thebwarsaw2002-08-161-1/+2
| | | | | bounce notification's charset to match the list's preferred language charset. Closes SF bug #596055.
* registerBounce(): The last patch wasn't quite right, so backing outbwarsaw2002-08-151-6/+4
| | | | | | most of it. The real fix is simply to provide bounce_you_are_disabled_warnings to the noticesleft in the .reset() call.
* Fix a nasty bug that could cause disabled members to be deleted frombwarsaw2002-08-151-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | the list too early! This scenario: - a member starts bouncing and gets an initial bounce score, but isn't yet disabled - their mail starts working again for a while - we start getting bounces for them again, but now their old info is stale, so we reset it The bug was that when we reset the info, we actually didn't reset their bounce score, we reset their "notifications-left" value! That means that if they accumulated more bounce scores and got disabled, they'd immediate get removed from the list because they'd have no bounce notifications left! Ouch. The fix is to enshrine the reset semantics in default arguments for _BounceInfo.reset(): default for score is 0, default for date is None (meaning use Day 1), default for notices left is None, is basically a placeholder. registerBounce(): If we're going to reset stale bounce info, use the defaults, except for noticesleft, which gets its value from bounce_you_are_disabled_warnings. Thanks to Danny Terweij for being the guinea pig. ;)
* sendNextNotification(): Include in bounce reasons, the date of thebwarsaw2002-08-021-5/+11
| | | | last received bounce.
* sendNextNotification(): Fixed typo discovered by Jon Parise and Danbwarsaw2002-06-301-1/+1
| | | | Mick.
* Some hacks to support notification of disabled delivery for reasonsbwarsaw2002-05-281-6/+31
| | | | | | | | | | | | | | | | | | | other than due to excessive bounces. Specifically, REASONS: sentence fragments for disable reasons (hopefully these can be translated). registerBounce(): The calculation of now and lastbounce was broken because the dst flag should have been set to -1 to let the library pick the right daylight savings time flag value. Use a new helper routine Utils.midnight() to calculate this. sendNextNotification(): Generalize a bit to handle notifications for other reasons. The ApprovedDeleteMember() message is now 'disabled address', and the syslog() message is generalized a bit too. Also, stick the reason sentence fragment into the modified disabled.txt template. TRANSLATORS TAKE NOTE!
* registerBounce(): Reset the bounce info if it isn't an instance of abwarsaw2002-05-071-1/+1
| | | | _BounceInfo class.
* Dan Mick's patch (with mods ;) for disabling list owner notificationbwarsaw2002-03-121-3/+10
| | | | | | | | | | | | | on disabled-due-to-bounces and removal-due-to-bounces. Specifically, InitVars(): Add bounce_notify_owner_on_disable, and bounce_notify_owner_on_removal. disableBouncingMember(): Only send the admin a bounce notification if bounce_notify_owner_on_disable is true. sendNextNotification(): In the ApprovedDeleteMember() call, set the admin_notif argument to the value of bounce_notify_owner_on_removal.
* InitVars(): Add bounce_unrecognized_goes_to_list_owner to handlebwarsaw2002-03-071-0/+2
| | | | | whether the list owner gets unrecognized bounces addressed to -bounces and -admin.
* BounceMessage(): Set up the outer bounce message the same way we setbwarsaw2002-03-011-4/+5
| | | | | up the admin message in __sendAdminBounceNotice(); specifically, we use set_type() to set the Content-Type:
* __sendAdminBounceNotice(): Because the UserNotification constructorbwarsaw2002-02-281-4/+8
| | | | | | | | | | | already sets the Content-Type: and MIME-Version: headers, don't do it explicitly (it'll add multiple headers). Instead just call set_type() to set the type to multipart/mixed. (Must do that before attempting to attach.) sendNextNotification(): Because we do not want the Subject: to be encoded, don't pass the subject into the UserNotification constructor. See MailList.ChangeMemberAddress() for details.
* __sendAdminBounceNotice(), sendNextNotification(): Bothbwarsaw2002-02-281-2/+3
| | | | | | | | | | | UserNotification constructor calls were passing in the language as a positional argument, in the position where the text should have been. But because both instances has no text, the proper fix is to use the `lang' keyword argument. This fixes one i18n related crash, and the last one I'm going to commit tonight. I've audited all the other UserNotification call sites and there are more fixes coming down the pike.
* __sendAdminBounceNotice(), sendNextNotification(), BounceMessage():bwarsaw2002-02-111-5/+7
| | | | | | | | When creating the UserNotification message object, pass in the language that the message should be in. This allows us to get the character set and header encodings right. Patch by Ben Gertzfield.
* sendNextNotification(): Remove the call to setBounceInfo() sincebwarsaw2002-02-051-1/+0
| | | | | | removeMember() -- which is eventually called by ApprovedDeleteMember() should to any necessary cleanup of the bounce info. Found by Dan Mick.
* reset(): Dan Mick discovered a cut-n-paste error! info. -> self.bwarsaw2002-01-291-4/+4
|
* Several fixes to improve the bounce score testing when thebwarsaw2002-01-291-22/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | administrator has adjusted the threshold (inspired by Dan Mick). Specifically, ZEROHOUR_PLUSONEDAY: New constant that is supposed to represent the day containing the first midnight after the epoch. We'll add (0,)*6 to this tuple to get a value appropriate for time.mktime(). _BounceInfo.reset(): New method to encapsulate resetting stale bounce scores. Also used in the constructor. registerBounce(): Implement refined rules for setting and checking the bounce score. As described in a message to mailman-developers: 1) are we a member? No, return 2) do we have previous bounces? No, register it, skip to step 7 3) is the member disabled? yes, return 4) is the bounce info from today? yes, don't increment, skip to step 7 5) is the info stale? yes, reset it and skip to step 7 6) increment score for today's bounce 7) is score > threshold? yes, disable 'em. disableBouncingMember(): Refactor since cron/disabled can call this method too now. __sendAdminBounceNotice(): msg argument can now be a Message instance or a string. Wrap in a MIME* instance as appropriate.
* copyright yearsbwarsaw2002-01-151-1/+1
|
* registerBounce(): Fix for bug when resetting bounce info due to stalebwarsaw2002-01-151-1/+6
| | | | | | information. We don't need to create a new _BounceInfo instance, just update some of the existing one's attribute values. Noticed by Dan Mick.
* The long-awaited rewrite of the bounce processing system. We'vebwarsaw2001-12-271-223/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (hopefully) managed to make this both more understandable and much simpler. Simpler even than recent mailman-developer threads (and yet, I still believe this will work :). The algorithm is explained in the Mailman/Gui/Bounce.py, i.e. admin/bounce category, help string. Specifically here, _BounceInfo: New class which encapsulates information about a member's bounce status -- not delivery status. This holds information about their bounce score, the date (YYYY, MM, DD) of their last detected bounce, the number of "you-have-been-disabled" notices remaining to be sent, the date of the last sent notice, and the confirmation cookie for thru-the-web/email-cmd re-enabling. InitVars(): Throw away old attributes minimum_removal_date, minimum_post_count_before_bounce_action, automatic_bounce_action, max_posts_between_bounces, and add new attributes bounce_score_threshold, bounce_info_stale_after, bounce_you_are_disabled_warnings, and bounce_you_are_disabled_warnings_interval. See schema migration code in versions.py. ClearBounce(), RegisterBounce(), HandleBouncingAddress(), DisableBouncingAddress(), RemoveBouncingAddress(): Gone. registerBounce(): New method which other bounce detection code can call to register a bounce on a member. The other code can supply a weight (hard bounces = 1.0, soft bounces = 0.5), defaulting to 1.0. This method handles all the bounce scoring policy, including registering only one bounce per member per day, and throwing away residual bounce information for members who are already disabled. __sendAdminBounceNotice(): Send a disabled-due-to-bounce notice to the list administrator. Used when a member is actually disabled. This uses the existing bounce.txt template, but in unusual ways, avoiding requiring the translators to provide new templates. sendNextNotification(): If a disabled member is still due some notification, then send another to the user, decrementing the noticesleft count. If noticesleft is <= to 0, then they haven't re-enabled their account in time and they get deleted.
* First step on the bounce processer sanity road. These changes fixbwarsaw2001-12-191-2/+5
| | | | | | | | | | | | | | | | | | | | Mailman to keep track of why (and when) delivery is disabled. New list attribute delivery_status and new MemberAdaptor interface methods are added. Delivery status has the following states: ENABLED, BYUSER (disabled by user selection), BYADMIN (disabled by admin selection), BYBOUNCE (disabled by excessive bouncing), UNKNOWN (legacy disable). We no longer use the DisableDelivery user option. Also, for status changes from <anything> -> <anything-but-ENABLED>, we record the time.time(). This information gets thrown away when the delivery is re-enabled. Specific changes here: InitVars(): Add delivery_status attribute for new lists. DisableBouncingAddress(): Test getDeliveryStatus() against ENABLED to see if the address is already disabled or not. Also, when disabling, use the BYBOUNCE status.
* Some code cleaning, and adjustment to new API.bwarsaw2001-11-201-7/+2
| | | | | | | RegisterBounce(): The dirty flag wasn't used anywhere. HandleBouncingAddress(): Utils.get_site_email()'s second argument should no longer include the leading dash.
* BounceMessage(): Argument `e' is now either None or an instance with abwarsaw2001-10-151-2/+5
| | | | notice() method, which returns the notice as a string.
* ClearBounceInfo(), RegisterBounce(): Rename argument `email' to `member'.bwarsaw2001-10-091-59/+39
| | | | | | | | | | | | | | | | | | RegisterBounce(): Use mm_cfg.days() to calculate days. Also, started adding notes to help myself understand how this method works. :( HandleBouncingAddress(): Get rid of the crufty mimetools based bounce notification stuff in favor of using an email package based scheme (i.e. using MIMEMessage() to encapsulate the triggering message). This also lets us change bounce.txt to not include any MIME crud. BounceMessage(): Make `e' optional, and change the semantics so that if it was given, it /is/ the bounce details; it is no longer an object with a .details() method. Also, handle the situation where msg has no Subject: header.
* DisableBouncingAddress(): Fixed a syslog() call, using its newbwarsaw2001-10-041-1/+1
| | | | signature.
* Convert from mimelib to email.bwarsaw2001-10-011-5/+5
|
* HandleBouncingAddress(): Instead of using MAILMAN_OWNER, usebwarsaw2001-08-041-2/+3
| | | | Utils.get_site_email(). The former config variable is going away.
* All:bwarsaw2001-07-181-35/+5
| | | | | | | | | | | | | | | | | | | | | | | | GetConfigInfo(): Removed. All admin ui gui elements are moved into components in the Mailman/Gui subdirectory. All membership related attribute access should use the MemberAdaptor API instead, e.g. IsMember() -> isMember() GetUserOption() -> getMemberOption() SetUserOption() -> setMemberOption() Also use ApprovedDeleteMember() instead of DeleteMember(). Deliverer.py: Remove last vestiges of os.environ['LANG'] Digester.py: SetUserDigest(): Removed. This is replaced by OldStyleMemberships's setMemberOption() method when flag == mm_cfg.Digests
* BounceMessage(): New method that will `bounce' a message back to thebwarsaw2001-07-101-0/+19
| | | | | | | message sender (calculated with msg.get_sender()). It actually wraps the original message up in a message/rfc822 MIME document and stuffs that into a multipart/mixed with the first part being the bounce message.