| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
Rename all handlers to be more PEP 8 friendly, i.e. lowercased.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
to the archiver. Also add a plugin architecture for easily overriding the
archiver, and hook this into the setup.py script.
Updated CookHeaders.py and Scrubber.py handlers to use the plugged archiver.
Updated doctests as appropriate.
Fix a typo in the setup.py file.
|
| |
|
|
|
|
| |
Convert IMailingList.personalize to a enum.
Change all non-obsolete occurances of GetListEmail() to posting_address.
|
| |
|
|
| |
only constant left in Mailman.constants is now actually a constant.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
Subject munging code made unified for both i18n and ascii encodings.
test_handlers.py
Adding test code for i18n and numbering subject munging.
(also tab normalization for the last commit)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
- Remove True/False binding cruft
- Remove __future__ statements for nested scopes
- Remove ascii_letters import hack from Utils.py
- Remove mimetypes.guess_all_extensions import hack from Scrubber.py
- In Pending.py, set _missing to object() (better than using [])
Also, update copyright years where appropriate, and re-order imports more to
my PEP 8 tastes. Whitespace normalize.
|
| |
|
|
|
| |
for multiple charset header for programming convenience and readablity.
(We may better use unicode for header munging eventually.)
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Subject manipulation should be done in unicode string mode.
(temporary change in MAIN because higher version of python should allow
simpler algorithms.)
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
stringify it before calling .splitlines().
|
| |
|
|
| |
text. You can't splitlines None.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
even after adding the prefix. Specifically,
uheader(): Accepts a continuation_ws parameter which is passed
straight through to the Header constructor call.
prefix_subject(): Split the pre-prefixed Subject: header into lines
and get the continuation_ws character from the first continuation line
(it won't matter if there is no continuation line). Pass this to
uheader().
|
| |
|
|
|
| |
header isn't known, we fall back to the charset of the list's
preferred language, with 'replace' of course.
|
| |
|
|
| |
them.
|
| |
|
|
|
|
| |
List-Id header when we add the mailing list's description.
uheader(), prefix_subject(): Refactored.
|
| |
|
|
| |
2, meaning "Full Personalization".
|
| |
|
|
|
|
| |
messages. It was too controversial to do To header rewriting by
default, but we might want to re-enabled this for a future version,
probably controlled by a configuration variable.
|
| |
|
|
| |
in some cases; coerce them to Charset instances.
|
| |
|
|
|
| |
correctly, i.e. through the input_codec of the charset, not using the
charset directly.
|
| |
|
|
|
|
|
|
|
|
| |
personalized messages, be RFC 2822 compliant in that a maximum of one
Cc header is allowed. Fortunately we can use the same algorithm as we
use for munging Reply-To.
Second, make sure the Cc header adding goes in the "if not fasttrack"
section so stuff like password reminders and confirmation messages
don't get a Cc to the list tacked on. :-o
|
| |
|
|
|
|
|
|
| |
is not included in a Reply-To header, copy the posting address into a
Cc header, otherwise there's no (easy) way a recipient could reply
back to the list.
Also, whitespace normalization, and a bit of code cleanup.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
encode_p(): Removed.
_isunicode(): Helper for unicode type testing.
prefix_subject(): Better algorithm for handling unicode subject
prefixes. Now we always set the Subject header to a Header instance
if we're adding the prefix. Always convert the prefix and all
previous Subject header bits to unicode (possibly with character
replacements) so that the Header class does the right thing, i.e. does
the us-ascii, charset hint, utf-8 encoding. Because of this, if the
list's charset is us-ascii, we'll substitute iso-8859-1 for a slightly
wider character coverage.
|
| | |
|
| |
|
|
|
|
| |
prefix_subject(): Only encode the subject prefix if it's necessary
because it contains non-ASCII characters, or the list owner has
requested to do so (via encode_ascii_prefixes).
|
| |
|
|
|
|
|
|
|
| |
munging, separate from the mail list. This actually restores the
original Subject: field which is stashed away in the metadata when
it's munged in CookHeaders. Closes SF patch #573508.
prefix_subject(): Stash the original Subject: header in the metadata
under the 'origsubj' key.
|
| |
|
|
| |
crufty workaround.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before applying this patch, do this to reproduce the bug:
- Set the language to something other than English (French makes a
good choice)
- Make sure the list has a prefix of some ascii text
- Send a message to the list with the following Subject:
=?iso-8859-1?Q?=E9?=
Bingo, double encoding. This fixes the problem by making sure the
prefix + original subject gets properly chunk encoded in a Header
instance. There's a bit of extra goo in here that won't be necessary
when I release email 2.2. See the comments for details.
G'morning Fil! :)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(forward by JC Lawrence):
Nick gave the example,
| > Reply-to: listname@listdomain, posting-user@example.com
JCL commented,
| Having [mutiple addresses in] Reply-To is a Good ... and Damned Useful
[Thing].
It seems to me, though, that the list membership would be better
served with this form:
Reply-To: postauthor@its.domain, listname@listserver.domain
because the MUAs with which I'm familiar make it anywhere from
slightly easier to far easier for the respondent to remove
addresses from the right of the reply's To: than from the left.
Also clean up some Pychecker nits.
|
| |
|
|
|
|
|
|
| |
messages.
prefix_subject(): Since email.Header.Header.encode() already knows how
to split long header lines, use this instead of our own attempts.
This makes long subject lines much cleaner.
|
| | |
|
| |
|
|
|
| |
first, remove any trailing slash, second surround the url in angle
brackets.
|
| |
|
|
| |
deprecated in favor of formataddr().
|
| |
|
|
|
| |
Barry) which correctly checks for the prefix in encoded Subject:
headers.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
2919 and 2369 headers are added.
- List-Id: is always added
- List-Post:, List-Help:, List-Subscribe:, List-Unsubscribe:, and
List-Archive: are only added to posting messages.
- X-List-Administrivia: is only added to message Mailman creates and
sends out of its own accord.
|
| |
|
|
|
| |
reply_to_address since, as the note says it's better to validate it on
entry, and we now have the architectural support for doing that.
|
| |
|
|
| |
longer munge the Sender: or Errors-To: headers in this module.
|