| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
Rename all handlers to be more PEP 8 friendly, i.e. lowercased.
|
| |
|
|
| |
only constant left in Mailman.constants is now actually a constant.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
from Mailman.Queue to Mailman.queue (note the case change to be more PEP 8
compliant).
The Switchboard and Runner classes have been moved into the package
__init__.py and the previous class modules have been removed.
The switchboard cache is removed; I don't think it was ultimately buying us
much. Now, just import the Switchboard class and instantiate it directly.
Added an IRunner interface.
Renamed the ArchRunner to ArchiveRunner.
bin/qrunner and bin/mailmanctl are updated accordingly. For the former, it no
long accepts -r=All to run all qrunners. You can still use the short name
(e.g. --runner=incoming) to run the built-in queue runners, but this design
will eventually allow for plugin qrunners by allowing them to be run
specifying the full package path to the class. It also now accepts a leading
dot to indicate a qrunner class relative to the Mailman.queue package.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
module update to make the thing pass. Much more coverage is still necessary,
but this at least recreates the existing tests.
Changes to the test infrastructure to make REPORT_ONLY_FIRST_FAILURE
conditional on lower (default) verbosity. Increase the verbosity via
'bin/testall -v' and you get all the failure output.
|
| |
|
|
|
|
|
|
| |
nor StringIO have 'encoding'. What we need was unicode string StringIO and
python StringIO has it already. Also, use utf-8 for the table of contents
in MIME digest if the subject has a different charset.
Adding a test code for the multi-language digest.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mailman/Queue/Switchboard.py:
listname is returned in unicode.
( '\x80' + 'a' is OK, '\x80' + u'a' is NG)
Mailman/Utils.py:
Utils.oneline() is extended for returning unicode string.
Mailman/Digester.py:
next_post_number is not used anywhere.
Mailman/database/listdata.py:
Attributes added (esp. for non web u/i)
Mailman/bin/senddigests.py:
Initialization
Mailman/Handlers/ToDigest.py:
Internal string calculation is done in unicode. So, several fixes.
StringIO is used because cStringIO doesn't have encoding attribute.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
during early initialization so that we're guaranteed to get the right value
regardless of the shell umask used to invoke the command line script. While
we're at it, we can remove almost all individual umask settings previously in
the code, and make file permissions consistently -rw-rw---- (IOW, files are no
longer other readable).
The only subsystem that wasn't changed was the archiver, because it uses its
own umask settings to ensure that private archives have the proper
permissions. Eventually we'll mess with this, but if it ain't broken...
Note that check_perms complains about directory permissions, but I think
check_perms can be fixed (or perhaps, even removed?!). If we decide to use
LMTPRunner and HTTPRunner exclusively then no outside process will be touching
our files potentially with the incorrect permissions, umask, owner, or group.
If we control all of our own touch points then I think we can lock out
'other'.
Another open question is whether Utils.set_global_password() can have its
umask setting removed. It locks permissions down so even the group can't
write to the site password file, but the default umask of 007 might be good
enough even for this file.
Utils.makedirs() now takes an optional mode argument, which defaults to 02775
for backward compatibility. First, the default mode can probably be changed
to 02770 (see above). Second, all code that was tweaking the umask in order
to do a platform compatible os.mkdir() has now been refactored to use
Utils.makedirs().
Another tricky thing was getting SQLite via SQLAlchemy to create its
data/mailman.db file with the proper permissions. From the comment in
dbcontext.py:
# XXX By design of SQLite, database file creation does not honor
# umask. See their ticket #1193:
# http://www.sqlite.org/cvstrac/tktview?tn=1193,31
More details in that file, but the work around is to essentially 'touch' the
database file if 'sqlite' is the scheme of the SQLAlchemy URL. This little
pre-touch sets the right umask honoring permission and won't hurt if the file
already exists. SQLite will happily keep the existing permissions, and in
fact that ticket referenced above recommends doing things this way.
In the Mailman.database.initialize(), create a global lock that prevents more
than one process from entering this init function at the same time. It's
probably not strictly necessary given that I believe all the operations in
dbcontext.connect() are multi-processing safe, but it also doesn't seem to
hurt and prevents race conditions regardless of the database's own
safeguards (or lack thereof).
Make sure nightly_gzip.py calls initialize().
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
because it is overwrapped in Mailman.Message.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
digest.mbox file. This is the same technique that the archiver uses,
and should fix Chuq's problem with missing trailing newline separators
in digest messages.
|
| |
|
|
| |
scrubbing of attachments in MIME digest messages.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
digests. Specifically,
lheader() -> oneline(): Also, get rid of **kws since we're not going
to use these. Catch any LookupError or UnicodeError that may occur,
but do the .encode() with 'replace' for a better chance to succeed.
send_i18n_digests(): Use Utils.wrap() to wrap the subject headers, and
also in the kept headers in plain text digests. Eliminate the blank
line between subjects in the ToC.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I've modified it though, so any brokenness is my fault. Specifically,
KEEP: Removed in favor of Default.py.in's MIME_DIGEST_KEEP_HEADERS.
process(): Use Generator.flatten() instead of the deprecated __call__
syntax.
send_i18n_digest(): Make sure things like the Subject headers in the
toc are coerced to the language the digest is being sent in (i.e. the
list's preferred language). Make sure the masthead, header and footer
attachments also get the right matching charset attribute. Make sure
that the username extracted from the From header is also in the right
character set. Use the Header object for proper wrapping of the
Subject lines in the toc, not Utils.wrap() which was broken and not
i18n aware.
Add a blank line between entries in the toc (might be controversial).
Send messages in the plain text digest through the scrubber so
attachments (and their MIME goo) don't mess up the plain text digests.
lheader(): New convenience function.
|
| |
|
|
|
| |
caused a daily ratchet of the volume number. Also, one minor
refactoring in the bump digest number conditional.
|
| |
|
|
|
| |
had their Reply-To header pointing at the posting address, and that
there was no good reason not to continue this tradition <wink>.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
that the digest may contain unparseable messages, e.g. with missing
start boundaries. Instead of crashing, such messages should simply be
ignored. If lax parsing can't grok it, it has a high likelihood of
being spam.
Specific changes here:
send_i18n_digests(): The end case is now that "msg is None", not
false, and if msg is the empty string, it was unparseable and we
should skip it.
|
| |
|
|
|
|
|
|
|
| |
wrapping each message inside the multipart/digest in a MIMEMessage
instance. We also no longer need to initialize the mimedigest
instance's payload to the empty list.
Also, when sending the digests, be sure to include isdigest=1 in the
metadata, otherwise SMTPDirect will try to tack on another footer.
|
| |
|
|
|
|
| |
deprecated in email 2.0. For calls on the mimemsg, change them into
attach() calls. For calls on the rfc1153msg, change them into
set_payload() calls.
|
| |
|
|
|
|
| |
header. It seems like only broken configurations (or bugs?) could
cause this since the RFC requires From: to exist, but this is better
than throwing an exception.
|
| | |
|
| |
|
|
|
|
| |
uses a factory that produces our own Message objects.
send_i18n_digests(): Use our Mailbox instead of mailbox.UnixMailbox.
|
| |
|
|
| |
was being ignored for digest delivery!
|
| |
|
|
|
| |
supply an empty list as the failobj so we can still iterate over the
return value.
|
| |
|
|
|
|
|
|
|
| |
always get the correct file size if the Generator didn't leave the
file pointer at the EOF. Let's use os.path.getsize() -- after a
flush -- instead. Closes this bug report.
send_i18n_digests(): Update to email package API; use msg.get_all()
intead of msg.getall().
|
| |
|
|
|
| |
Also, use cStringIO directly instead of our own hack-around StringIO
module.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
API instead, e.g.
GetUserOption() -> getMemberOption()
GetPreferredLanguage() -> getMemberLanguage()
IsMember() -> isMember()
GetDigestDeliveryMembers() -> getDigestMemberKeys()
ToDigest.py: clear the one_last_digest() dictionary after sending the
digest.
|
| |
|
|
|
|
|
|
|
| |
default, we can't use a StringableMIME class here, otherwise it won't
have a get_sender() method when unpickled. So instead, use a
Message.Message class and just set Content-Type: and MIME-Version:
headers manually.
StringableMIME: Removed.
|
| |
|
|
|
| |
language, also pass in the MailList object; maketext() digs the
preferred language out of the list object.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the 0.3 release. This means you must download and install the 0.3
version of mimelib to work with the current CVS snapshot!
ReprMIME => StringableMIME
send_digests(): Added support for auto-bumping of digest volume
numbers based on the digest_volume_frequency configuration attribute.
send_i18n_digests(): After creating the mimedigest container, set its
payload to the empty list. This ensures that subsequent
add_payload()s will succeed. mimelib 0.3 will raise an exception
otherwise when appending to a scalar payload.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
send_digests() -> send_i18n_digests(): this does the bulk of the
digest crafting, but it's wrapped in send_digests() which first sets
up the language context for the digest (the list's preferred
language).
send_i18n_digests(): Also make sure that for text/plain parts, the
charset is set correctly to the list's preferred language character
set.
Mark more strings as translatable.
|
| |
|
|
|
|
|
|
| |
De-string-module-ify
Other Python 2.0 constructs used where appropriate.
Get rid of HandlerAPI references -- this module is obsolete.
|
| |
|
|
|
|
| |
process(): set $LANG to list's preferred language and use wherever
necessary. Mark more strings as translatable. Don't hardcode
Content-Type: charset to "us-ascii".
|