| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
|
| |
Python idioms. The recipients are now returned as a set instead of a list, so
duplicates are quashed.
In MailList.InitTempVars() we need to create the list's data directory when
the list is initialized. If the directory already exists, this does nothing.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
convinced this is totally accurate as a full test run shows almost no coverage
in the Mailman.database.model modules even though I /know/ they're getting
executed.
I'll need to figure this out, but eventually we'll convert fully to setuptools
and then we'll use the nosetests to do testing and coverage.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
address that is not lower cased, the original, case-preserved version is store
on the '_original' attribute. The lower-cased version is always used as the
key and thus always stored on the 'address' attribute. The IAddress interface
is given a new 'original_address' property which returns the case-preserved
version.
Address's __str__() and __repr__() are similarly modified. The former always
includes the case-preserved address; the latter does too, but now also
includes the lower-cased 'key' email address (along with the object's id).
Searching for an address always does so on the lower-cased version.
Test suite is updated as necessary. Also, I'm adding the
REPORT_ONLY_FIRST_FAILURE doctest flag so that it's easier to debug doctest
failures without having pages of problems to scroll through.
|
| | |
|
| |
|
|
|
|
| |
directories to make sure they didn't have certain 'other' permissions, but it
didn't check these directories for the necessary user and group permissions.
This is now fixed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
test everything the old unit tests tested. There are XXX's left in the
doctests as reminders to flesh them out.
Change the NNTP_REWRITE_DUPLICATE_HEADERS to use proper capitalization.
Revert a change I made in the conversion of the Switchboard class:
Switchboard.files is no longer a generator. The Runner implementation is
cleaner if this returns a concrete list, so that's what it does now. Update
the tests to reflect that.
The Runner simplifies now too because it no longer needs _open_files() or the
_listcache WeakValueDictionary. The standard list manager handles all this
now, so just use it directly.
Also change the way the Runner sets the language context in _onefile(). It
still tries to set it to the preferred language of the sender, if the sender
is a member of the list. Otherwise it sets it to the list's preferred
language, not the system's preferred language. Removed a conditional that
can't possibly happen.
|
| |
|
|
|
|
|
|
|
|
| |
due to the change from the method Switchboard.files() to the generator
property Switchboard.files.
Add support in cleaning_teardown() for the doctests for removing all queue
files leftover after a test is complete. This way, failures in one test that
queues files won't break all subsequent such tests.
Update the 2.1.9 section of the NEWS.txt file from the Mailman 2.1 branch.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ISwitchboard interface and modernize the Python code in the Switchboard.py
implementation.
The SAVE_MSGS_AS_PICKLES option is removed. Messages are always saved as
pickles unless the metadata '_plaintext' key is present, though this should
eventually go away too.
In testall.py, put the entire VAR_PREFIX in a temporary directory. This helps
the switchboard tests by not mixing their data with the installation's queue
directories. The Configuration object now also ensures that all the queue and
log directories exist -- one more step on the road to getting rid of the
autoconf mess.
|
| |
|
|
|
| |
Mailman/testing. This introspects the Mailman/docs directory and adds
DocFileSuites for all .txt files found there.
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| | |
a null byte or other garbage in the extension. Cleaned this.
- Improved handling of None payloads.
- Cleaned up a few charset coercions.
OutgoingRunner.py - Made probe bounce processing and queuing of bounces
conditional on having some permanent failure(s).
|
| | |
| |
| |
| |
| | |
have been removed from the .txt files and instead added to the test harness,
which all doctests now use.
|
| |\ \
| |/
|/|
| | |
now so I have to fix these before pushing the branch up.
|
| | |
| |
| |
| |
| |
| |
| | |
actually there /was/ no separate AvoidDuplicates test, but now there
is, even though it may not be full coverage.
Update the AvoidDuplicates handler to use more modern Python idioms.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
into several sub-documents.
Defaults.py.in: Removed OLD_STYLE_PREFIXING. So-called 'new style' prefixing
is the default and only option now.
CookHeaders.py is updated to the new API and some (but not all) of the code
has been updated to more modern Python idioms.
reply_goes_to_list attribute has been changed from a strict integer to a
munepy enum called ReplyToMunging.
RFC 2369 headers List-Subscribe and List-Unsubscribe now use the preferred
-join and -leave addresses instead of the -request address with a subject
value.
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
some XXX's in the doc test because digest recipients aren't tested
(though those may go in a different doctest), and neither are urgent
messages. This latter is for the same reason that the Approved
handler is not yet tested; which password do you use in that header?
The CalcRecips tests would also seem the natural place to test the
receive_list_copy preference, but that actually gets processed in the
AvoidDuplicates handler, so it isn't tested here.
Add delivery_status (of type enum DeliveryStatus) to preferences. I'm
not entirely sure that's the right place for it, but it lets me finish
converting the test for now.
Expose the rest of the preferences through the IMember interface.
|
| | |
| |
| |
| |
| | |
MailingList.last_post_time column to a DateTime (i.e. Python datetime
object).
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
or necessary in the current data model.
Convert the test_handlers.py Python test to an acknowledge.txt doctest, and
make the Acknowledge.py handler work with the new data model. There are a few
XXX comments left in here due to the fact that the web stuff is a total hack
in the current branch currently.
Added IMailingListWeb methods and properties to the MailingList model class:
web_host and script_url().
Work out how IMembers will expose the lookup-order based preferences. By
getting the attribute IMember.preferences you can see exactly the preferences
overridden by this member. To use the lookup order, use
IMember.delivery_mode, IMember.acknowledge_posts, etc. IOW, the IMember
interface now provides the properties directly and access through this
mechanism supports lookup order with definitive preference values.
Also added IMember.unsubscribe() which does the obvious, and
IMember.options_url() which is a total hack for providing a url (but not the
ultimately right one) for the user's option page.
Refactor the model's roster classes. Also added IRoster.get_member() method
with efficient queries to return the right results. Make
AdministratorRoster.members more efficient due to a better query.
Update the membership.txt doctest to eliminate a chance ordering effect, and
also to test finding members with .get_member(). The clean up section uses
the new .unsubscribe() method.
|
| | |
| |
| |
| |
| | |
Fix the last few doctests by ensuring that other newly created Addresses have
a preferences object.
|
| | |\ |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
preferences. IAddresses, IUsers, and IMembers all get preferences by default,
althoughthe attributes of these preferences are None by default.
IMailingLists don't get preferences by default though; because these live in
the user database, we can't cross-polinate them in the mailing lists. We'll
figure something out later for these.
IUser.register(): Add this method which registers and links an address to the
user.
Allow EnumType database columns to accept and return Nones. This is useful
for when the columns are not defined NOT NULL.
Update doctests.
Removed teh hide_address preference. I can't think of a reason not to want to
hide addresses for everyone.
|
| | |\ \
| | |/
| |/| |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
mlist-rosters.txt tests are removed.
Give MailingList entities a Preferences foreign key, so that they now have
preferences.
Member.preferences(): Watch out for unlinked addresses, i.e. which have no
user and thus no user preferences.
Address.controls() takes a text email address, not an IAddress.
UserManager: add create_address(), delete_address(), get_address(), and
'addresses' property.
Updated the address.txt and user.txt doctests as needed.
Added User.register() to register an email address and immediately link it to
a user.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
necessary to deal with the simplified user model. Eradicate more references
to rosters and roster sets.
Give Users a repr. Also give them a belongs_to() link to Preferences, but
change the user manager to not give a user preferences by default (the lookup
schema should properly handle users with no preferences now).
Also, when creating a user, set their real_name to the empty string if no
real_name argument was given to create_user(). Update the IUserManager
interface's create_user() method to match the implementation.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
they were previously known are now gone. Rosters, rather than being a
database entity that collects users, is now just a filter on the member
database. This way, we can use generic rosters to search for regular members,
digest members, owners, or moderators. More advanced rosters can do all kinds
of other membership queries. But rosters no longer need to be a database
entity.
Users have a name, password, optional preferences, and a set of addresses, but
users are not subscribed to mailing lists.
Addresses have the email address, some verification information, and optional
preferences.
Members tie an address to a mailing list, through a role, with optional
preferences.
Other changes here include:
MailList.fqdn_listname() moved to the MailingList model entity.
Added MemberRole enum and SystemDefaultPreferences to Mailman.constants.
Profiles are renamed to Preferences (same with the interface), but the files
are not yet moved. This happens later.
We mostly don't need has_*() relationships on the entity classes, because we
generally don't need the reverse relationship. Use belongs_to() because that
creates the foreign key, even though the wording seems counter intuitive.
IAddress.subscribe() added.
Tell Elixir to use shortnames for all tables.
Remove the OldStyleMembership fields from MailingList.
Remove all the interface elements and database fields that talk about rosters
and rostersets.
Convert Version entity to has_field().
|
| | | |
| | |
| | |
| | |
| | | |
mlist.send_digest_now() and
report them and continue processing the remaining lists.
|
| | |/
|/|
| |
| |
| |
| |
| |
| |
| |
| | |
checkbox
when there are only (un)subscribes and no held messages.
- Added a separator and heading for "Held Messages" like the ones for
"Subscribe Requests" and "Unsubscribe Requests".
- Added additional test to not display "Database Updated ..." when
coming from the login page.
|
| |/
|
| |
before looking for/deleting the Approve(d): line.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
do anything. The doctest needs to have some way of testing the grace period,
but it's still more tests of the module than there every was before.
Update the Replyboty handler to use $-strings internally. Eliminate the use
of %-strings in auto-response textsy. Only $-strings can be used, which
allows us to get rid of another use of SafeDict.
|
| |
|
|
|
|
|
|
|
| |
module. Add in a temporary reference (with XXX comment) to
Mailman.database.model.Language where necessary, although I will need to
remove this eventually.
Added clean up code to the mlist-rosters.txt doctest, otherwise it leaks the
test mailing list.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
classes live in Mailman/databae/model now.
Remove the TestDecorate test class from test_handlers.py and move them into a
doctest called decorate.txt (with harness in test_decorate.py).
Remove the dependence on SafeDict from the Decorate handler because I can now
use string.Template object to safely fill in header and footer templates.
Eventually I want to completely remove SafeDict from Mailman, but it's still
used in a few other places.
This also means that only $-strings will be supported in headers and footers,
and the import script will have to convert %-strings to $-strings. Also,
'_internal_name' is no longer a supported header/footer substitution
variable. Use $real_name or $list_name now. Added $fqdn_listname as a
substitution variable. Update the DEFAULT_MSG_FOOTER accordingly.
|
| |
|
|
| |
password for the user, or if it's "{NONE}".
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
confident the Elixir branch is ready to become mainline. Also, fewer branches
makes for an easier migration to a dvcs.
Don't expect much of the old test suite to work, or even for much of the old
functionality to work. The changes here are disruptive enough to break higher
level parts of Mailman. But that's okay because I am slowly building up a new
and improved test suite, which will lead to a functional system again.
For now, only the doctests in Mailman/docs (and their related test harnesses)
will pass, but they all do pass. Note that Mailman/docs serve as system
documentation first and unit tests second. You should be able to read the
doctest files to understand the underlying data model.
Other changes included in this merge:
- Added the Mailman.ext extension package.
- zope.interfaces uses to describe major components
- SQLAlchemy/Elixir used as the database model
- Top level doinstall target renamed to justinstall
- 3rd-party packages are now installed in pythonlib/lib/python to be more
compliant with distutils standards. This allows us to use just --home
instead of all the --install-* options.
- No longer need to include the email package or pysqlite, as Python 2.5 is
required (and comes with both packages).
- munepy package is included, for Python enums
- IRosterSets are added as a way to manage a collection of IRosters. Roster
sets are named so that we can maintain the indirection between mailing lists
and rosters, where the two are maintained in different storages.
- IMailingListRosters: remove_*_roster() -> delete_*_roster()
- Remove IMember interface.
- Utils.list_names() -> config.list_manager.names
- fqdn_listname() takes an optional hostname argument.
- Added a bunch of new exceptions used throughout the new interfaces.
- Make LockFile a context manager for use with the 'with' statement.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bin/testall.py
- Improvements to setting up the tests with temporary files for the db and
configuration. Don't accept -C/--config because that will just confuse
things.
- Copy our new testing.cfg.in template file to a temp file, populate it
with a few additional run-time calculate values, and use that in both
the parent (bin/testall script) and children (bin/mailmanctl and
friends).
Mailman/initialize.py
- Split up initialize() into two functions as required by the test suite
reorg above. Almost everything else in Mailman will continue to use the
initialize() function though.
Mailman/configuration.py
- Store the filename that was used to load the .cfg file from on the
configuration object.
|
| |
|
|
| |
version of the email package. So, finally! we can get rid of our copy.
|
| |
|
|
| |
Python 2.5 is required.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
instantiated MailList object via the mapper extension's populate_instance()
method. This based on information from the SQLAlchemy folks.
Add more useful output for LockFile debugging.
Add checks in loginit.py's emit() method (and .flush()) so that if the stream
has been closed, log messages will go to stderr. This happens under the test
suite with SQLAlchemy, because SA keeps references to the MailList objects
which it doesn't seem like we can clear before Python exits. So if say the
lock logger is at debug level, when the lock object gets cleared at Python
shutdown, the stream will have been closed by the time LockFile.__del__() gets
called. This change avoids the traceback at the expense of a little extra
stderr output.
MailList.__lock -> MailList._lock
MailList.__timestamp -> MailList._timestamp
|
| |
|
|
| |
more deeply nested than 1 level.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DBContext.api_load(). This is where it really ought to be based on the
internal semantics of .Load()/.Lock().
MailListMapperExtension.populate_instance(): Checking the state of the isnew
flag is not sufficient to know whether the MailList object we're getting is
brand spankin' new or not. It turns out that when we session.expire() the
MailList object, the next time SA loads this from the db, the
populate_instance() will get called with isnew=True, even though the object
really isn't new. Instead, check to make sure InitTempVars() isn't
incorrectly called twice. Note that I might move this test, but I wanted to
check in something that works, and then see if this is what we expect from the
SA guys (this flag appears underdocumented).
LockFile.py: Add some additional debugging.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ConfigParser style ini file which can be used to override various default
settings for just the named loggers.
For example, if you want just the locks logger to print at DEBUG level, add
this:
etc/mailman.cfg:
LOG_CONFIG_FILE = 'etc/mailman.log'
etc/mailman.log:
[locks]
level = DEBUG
|
| |
|
|
|
|
|
|
|
|
|
| |
expire the object. This way, when the MailList attributes are next accessed,
the ORM will reload them from the database, getting any new values possibly
set in other processes.
This works better than trying to use always_refresh=True on the mapper, or
trying to do a reload() because both of those approaches blow away locks. I'm
not sure why this, but I suspect that it's because the identity map is handing
us back a different object, rather than invalidating the object's attributes.
|
| |
|
|
|
| |
Cgi/create.py: password scheme lookup.
|
| | |
|