| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
Rename the implicit.txt doctest.
specialized_message_from_string(): Mimic the way the text->message parser will
include the size of the original text as an attribute on the message object.
The maximum message size rule will use this information.
|
| |
|
|
|
|
| |
bunch of doctests. Note that the old Hold Notification tests are temporarily
disabled as these will have to be rewritten when the rule matching logic gets
added.
|
| |
|
|
| |
rule. Add doctest as appropriate.
|
| |
|
|
|
|
| |
rule. Add doctest as appropriate.
DEFAULT_MAIL_COMMANDS_MAX_LINES -> EMAIL_COMMANDS_MAX_LINES
|
| | |
|
| |
|
|
|
| |
is concerned. This still requires a minor patch to Storm to handle timedelta
types in SQLite.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
used where we used to do a try/except to temporarily change the global
translation language. This makes the code shorter and cleaner. E.g.
with i18n.using_language(another_language):
# do something
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
removing the module. Then, fix a few tests that failed as a result of
this work.
Mailman/Handlers/Hold.py: Call hold_message() instead of
mlist.HoldMessage().
The message store also no longer requires a Date: header, so clean up
a few tests that were still expecting that.
Extend cleaning_teardown() in test_documentation.py so that both the
message store and any list-centric requests are cleaned up after each
test.
|
| |
|
|
|
| |
message_store, and pendings 'databases' hang off the IDatabase object attached
to the config object. For IPending, no adaptation is necessary.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
modernization of Hold.py was performed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- In i18n.py, change this method so that everything it returns will be
guaranteed to be a unicode. Mailman 2.2 will be unicode-safe, meaning all
strings internally will be unicodes. The translation service is one
boundary point were strings come from the outside, so ensure that they are
unicodes and convert if necessary. This may break some things, but it's
better to fix those situations than to continue to return 8-bit strings from
_().
- In Mailman/testing/base.py, craft a fake module called Mailman.MTA.stub and
stick no-op functions on stub.create() and stub.remove(). We really don't
need the MTA modules for testing purposes (yet at least), and if you're
using the default configuration, you'll get tons of cruft on stdout when the
Manual MTA tries to add and remove mailing lists.
Set up the test configuration environment to use this stub MTA module.
- In test_handlers.py, remove an extraneous str().
- Convert ToDigest.py, Hold.py and Acknowledge.py to __i18n_templates__. (I'm
pretty darn close to just making everything use $-strings by default.)
- In CookHeaders.py, there's no need to unicode()-ify the subject since that
should already be a unicode when passed from _().
- In MailList.py, we can use the str.capitalize() method.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
compatible back to Python 2.3, this change should not get back ported to
Mailman 2.1.
Port to Python 2.5. The non-test suite changes should get back ported to
Mailman 2.1 (which I will do next), but don't worry about the test suite ones
because MM2.1's test suite is hopeless. Specifically:
- In SecurityManager.py, fix the parsecookie() code to work with Python 2.5
generated cookie text. The latter was changed to be more RFC compliant so
it does not output training semicolons for each line of cookie text. This
broke the splitting rules, so now first split on newlines, then on ';\s*'.
This should work across all Python versions.
- In Python 2.5, exceptions are new-style, and thus are no longer of
ClassType. The instantiation type test in hold_for_approval() was too
naive.
- Raising strings generates deprecation warnings in Python 2.5. Switch the
one weird use of this in Utils.py to use a class exception. Don't call it
"quick exit" though because it's probably not.
- In the tests, use True/False instead of 1/0
- Use failUnless/failIf instead of assertEqual against True/False.
- In the tests, use Message.get_content_type() instead of Message.get_type()
since the latter is gone in email 4.0.1. Same with get_content_maintype()
and get_main_type().
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and fixing the invocation and shutdown of mailmanctl. While the tests in this
module work individually, they do not yet work as a group.
-C added to testall.py, and mailmanctl now passes that flag on to qrunner.
UserNotification sets reduced_list_header in the msgdata, but the behavior of
this flag has changed. It used to suppress List-Help, List-Subscribe, and
List-Unsubscribe as well as List-Post and List-Archive. However, List-Help,
List-Subscribe and List-Unsubscribe should definitely be included in
UserNotifications, and List-Post has a different variable controlling it now.
Therefore, always add List-Help, List-Subscribe, and List-Unsubscribe.
Some style updates to Message.py
|
| |
|
| |
message that Mailman adds to the admin notification.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
message size calculations (and a few others) from the 2.1 maintenance
release.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
more log messages, minus an i18nization of 'n/a'.
|
| | |
|
| |
|
|
|
| |
nice when METADATA_FORMAT = METAFMT_ASCII. This is part of patch
#567288 by Maximillian Dornseif.
|
| |
|
|
|
|
|
|
| |
process(): If news_moderation == 2, then always hold the message for
moderation, unless of course the message was pre-approved, via an
Approved header.
Also, whitespace normalization and some pychecker fixes.
|
| |
|
|
|
|
| |
process(): Before sending the sender a notification message, check the
X-Ack: and Precedence: headers, and also see if this sender has
reached their auto-response limit.
|
| |
|
|
|
|
|
|
|
|
|
| |
dictionary's `sender' key, or the msg.get_sender() if not available.
This lets exceptions pass the sender through the metadata dictionary.
Used by Moderate.py to specify the failing address as retrieved from
get_senders() -- note the plural -- which has a different lookup
scheme than get_sender().
Moderate.process(): Set the tested sender address in the msgdata's
dictionary.
|
| | |
|
| |
|
|
|
|
|
| |
comparison. The online help says:
If a posting has this number, or more, of recipients, it is held
for admin approval. Use 0 for no ceiling.
|
| |
|
|
| |
for the deprecated add_payload().
|
| |
|
|
|
|
|
| |
process(), hold_for_approval(), do_discard(): Make the notification
email appear to come from the -bounces address. When the sender is
for human consumption, make it the -owner address (or in the case of
Cleanse.py for anonymous lists, the list posting address).
|
| |
|
|
|
|
|
| |
admin notification message on holds) by calling set_charset(None).
Because we're not passing anything on the `text' argument to the
UserNotification constructor, no charset will get automatically
added.
|
| |
|
|
|
| |
for the list owner, unset the charset parameter on the multipart/mixed
Content-Type: header.
|
| |
|
|
|
|
|
| |
Content-Type: header, and since we should be setting the charset
anyway, on the message that goes to the admin, set the lang argument
to the UserNotification, and then just set the type (via set_type())
to multipart/mixed.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
to the admin message we send out.
|
| |
|
|
| |
dictionary, translate `reason' through i18n.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
moderated, member_posting_only, and posters. All these are replaced
by the new sender-centric moderation tests in Moderate.py.
hold_for_approval(): When sending the hold notification to the list
admin, structure the message into a 3-part multipart/mixed:
- the text/plain hold notification message as before
- an rfc822/message encapsulation of the original held message
- an rfc822/message confirmation message, containing the hold cookie,
to which the list admin can respond to approve or discard the held
message.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
the class, already i18n-ified.
MessageTooBig.reason_notice(): Add this instead of setting a reason
attribute, so that the proper i18n interpolation can occur.
hold_for_approval(): Don't i18n-ify rejection-notice and don't
str()-ify the reason string. Just send both through Utils.wrap().
|
| |
|
|
| |
respond_to_post_requests
|
| |
|
|
|
|
| |
cookie referencing the held request id. Include this cookie in
the postheld.txt message sent to the user. This allows them to
cancel the posting if done before the moderator disposes it.
|
| |
|
|
| |
API. GetPreferredLanguage() -> getMemberLanguage()
|
| |
|
|
|
|
|
|
|
|
|
|
| |
API instead, e.g.
GetUserOption() -> getMemberOption()
GetPreferredLanguage() -> getMemberLanguage()
IsMember() -> isMember()
GetDigestDeliveryMembers() -> getDigestMemberKeys()
ToDigest.py: clear the one_last_digest() dictionary after sending the
digest.
|
| |
|
|
|
|
|
|
|
|
|
| |
notifying the administrator of the held message), use the list's
preferred_language to get the charset. This fixes the
UnboundLocalError that occurs if dont_respond_to_post_requests and
admin_immed_notify are both true (it shouldn't have been using `lang'
in the first place, since that's the /user's/ preferred language, not
the admin's).
Bug found by Mentor Cana.
|