| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
| |
function to call with no arguments, every time through the while
loop. This lets callers, e.g. keep a lock fresh while waiting for all
the children to finish.
|
| |
|
|
| |
so other scripts can use it.
|
| |
|
|
|
|
| |
locking were just too messed up to use. And good 'ol built-in map()
is fine anyway. It's only used in one place currently --
handle_opts.py -- and that is soon to be changed.
|
| |
|
|
|
| |
config.db.last file exists (see new fallback mechanism in
MailList.Load()).
|
| |
|
|
| |
map_maillists(): Slight more "standard" use of import.
|
| |
|
|
|
|
| |
list_names(): Use list_exists().
GetNestingLevel(): Use string.count() for counting.
Changed to explicit "from Mailman import" where appropriate.
|
| |
|
|
|
|
| |
Utils.reraise() hack.
reraise(): removed.
|
| | |
|
| | |
|
| |
|
|
|
| |
because for some reason IE5 seems to corrupt the former under at least
some situations.
|
| |
|
|
|
| |
SnarfMessage(): Removed all these functions, since they are no longer
used.
|
| | |
|
| |
|
|
| |
needs to be integrated with the message pipeline architecture.
|
| |
|
|
|
|
|
|
|
|
| |
DeliverToUser(): keep a global list of child processes we create so
that they can be reaped later.
Reap(): wait on the subchildren an remove from the _children global
all that are finished. This should eliminate zombie processes.
some debugging turds are still left in here, commented out
|
| |
|
|
| |
1.5.2-ism. Here's a more portable implementation.
|
| |
|
|
|
|
|
| |
maketext(): Use SafeDict class to make sure that key interpolation in
the template can't raise an exception, even if someone's edited the
template and included missing keys. Patch inspired by Sean
Reifschneider <jafo@tummy.com>
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Utils.DeliverToUser(): Don't add a Date: header even if one is missing
in the message. The MTA will always insert an RFC822 compliant header
(and we weren't compliant anyway).
|
| |
|
|
|
|
| |
needed. For now, however (trying to move towards 1.0), I've merely
reduced the amount of work done in the child, and wrapped it in a
try: clause for catching fork() failures.
|
| |
|
|
| |
smtplib.sendmail() can raise.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MailList.py:
Changed MailList.SetUserOption() to take a `save_list' keyword
argument (defaulting to true). When false, SetUserOption won't do
self.Save() after changing the option.
New function MailList.ApprovedAddMembers() (note plural) that takes
a list of prospective new list members (and possibly a list of
corresponding passwords), and does _all_ the necessary list changes
before saving the list configuration. Empty passwords are
substituted with randomly generated ones. Returns a dict with
{address: exception_tuple} entries -- exception_tuple is either None
or a two-element tuple containing the first exception type and value
raised when trying to add address. The exception traceback object
isn't included in the returned dict, because a) I don't think it is
very useful for the relevant exceptions, and b) using it wrongly
could cause some fuzz with Python's garbage collector -- i.e. we
would leak memory.
Changed MailList.ApprovedAddMember() to be a mere wrapper, calling
the new ApprovedAddMembers() function and reraising any exception in
the returned dict.
Also made the logic of the code doing subject prefixing a bit
clearer, and changed MailList.aside_new() so that list's config.db
files are saved with umask 007 (as they contain all list members'
passwords in clear text).
Utils.py:
New function MakeRandomPassword(length=4), used by
MailList.ApprovedAddMembers() whenever empty passwords are found.
The default random password length should possibly be made site
configurable.
Also, fixed an error in the _badchars regular expression -- the
final "," was probably meant to be inside the character set.
Cgi/admin.py:
Changed ChangeOptions() to use the new MailList.ApprovedAddMembers()
function.
|
| |
|
|
|
| |
Mailman.pythonlib so we're sure we're getting the latest and greatest
version of this module.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
letters.
|
| |
|
|
|
|
|
|
|
|
| |
calling CGI script was invoked with.
Uses (non-standard, but convenient) environment variable REQUEST_URI
when available, otherwise SCRIPT_NAME and PATH_INFO (which are part
of the CGI/1.1 spec) if available, or simply returns optional
argument `fallback' (which defaults to None).
Cgi/admin.py, Cgi/admindb.py: Use it when generating admin
authentication page.
|
| |
|
|
|
| |
failure: the value is only printed if it's not false (e.g. None), and
the deferred status is printed as well.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Cleaned up its interface so that it always raises an exception if an
address problem is uncovered (it used to both raise exceptions and
return 0 or 1). It now has no useful return value.
Added a re to barf on other unacceptable characters in an email
address, currently: [ ] ( ) < > | ;
Should there be others? The test that were there are retained, but the
domain_parts test was cleaned up (there was a redundant test in
there).
Note that now unqualified addresses (e.g. those that don't contain an
`@' are now DISALLOWED). This goes partially toward Greg Stein's
suggestion.
|
| |
|
|
|
|
| |
default arg value because then this module can't be imported in older
versions of Mailman. Use None in the arglist, and set to the proper
value when None is detected.
|
| |
|
|
|
|
| |
when exc is not None.
open_ex(): Use reraise().
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
got a false positive for a message that had the last line of a
paragraph (hence, short enough to look like administrivia) begin with
'set'.
- Require all 3 arguments (for some reason it was requiring 2 or 3,
while MailCommandHandler seems to clearly require 3 - perhaps we
want to catch malformed administrivia, i'm just assuming not)
- Require second arg of set command matches to be 'on' or 'off'.
I guess administrivia is a delicate balance between weeding out
non-administrivia and catching mis-directed admin messages, even ones
that were badly formed. I'm inclined to opt for greater stingency, at
the risk of not catching malformed and misdirected admin messages.
Tough luck, the misguided poster will have to change their password.
(I bet i get stung by this one day, myself...)
|
| |
|
|
|
|
|
|
|
|
| |
addresses from lines such as
User J. Person <person@allusers.com>
person@allusers.com (User J. Person)
It also handles bare email addresses. While this is rather simplistic
regexp matching, I think it will catch most situations.
|
| |
|
|
| |
1.5.1's bare raise statement
|
| |
|
|
| |
and put the child code in the block of the `if'.
|
| |
|
|
|
|
|
|
|
|
| |
referenced; these should be Errors.
This was in response to an attempt to subscribe a list to itself by
sending an subscribe email command and faking the From: field. Now we
don't get a crash, but I'm not sure the current behavior is correct.
The address (properly) doesn't get subscribed, but a message stating
this *is* sent to the list!
|
| |
|
|
|
| |
then check to see if the remote SMTP supports DSN. If so, we'll add
the NOTIFY=failure to the receipt options.
|
| |
|
|
|
|
|
| |
we're getting a modern smtplib.py, either from Python, or from
Mailman.pythonlib package.
Also, use the current standard interface to smtplib.
|
| |
|
|
| |
bizarrely raggedy).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
work like unix mail: username portions of addresses are
case-preserved for delivery only. All other address comparisons are
lowercase.
up'd data version in Defaults to 13
** MailList.py: added an __AddMember method that takes an address and
whether or not it is a digest address as args and populates the member
dictionary like this:
if string.lower(addr) == LCDomain(addr):
member_dict[addr] = 0
else:
member_dictp[string.lower(addr)] == LCDomain(addr)
added .GetDeliveryMembers() and .GetDigestDeliveryMembers() methods
for use by posting and digest delivery mechanisms.
changed a nested def portion in Post to use an explicit loop.
**Digester.py: uses .GetDigestDeliveryMembers instead of
.GetDigestMembers().
**Utils.py: address comparisons are lc.
**versions.py: populate the member dicts according to the above
formula.
**Cgi/admin.py: fixed a bug introduced from the first change to using
member dictionaries: all members were showing up as digest members
on the admin membership page. changed a dict.get to dict.has_key to
fix this.
NOTE: this code is tested only insofar as I posted and poked around on
the cgi's a bit, and let lists do the versions code. These changes
should be tested more, but I *have* to go now and wanted to check them
in before someone made it difficult to do so by changing stuff
tomarrow, cause i'm gone all day tomarrow.
scott
|
| |
|
|
|
|
| |
address lacks a domain. (I'm currently returning the list with just
the bare account name, scott please consider whether or not this is
sensible, i'm going on partial knowledge of your changes.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
didn't translate Utils.FindMatchingAddresses properly!
in MailList.Post(), FindMatchingAddresses was applied to list.posters
and list.forbidden_posters which are lists and not dicts, so I added a
function in Utils called List2Dict that takes a list and retuns a dict
keyed by the items in the list (it doesn't check for whether the items
are hashable). All values are 1.
This function is now used in MailList.Post(): where the
FindMatchingAddresses was applied to an address list, it is now
applied to Utils.List2Dict(address list).
scott
|
| |
|
|
|
| |
that it's signature is now FindMatchingAddresses(name, dict, *dicts).
scott
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
dicts instead of lists, which optimizes Utils.FindMatchingAddresses
and general membership management, especially for large lists.
MailList.py now supplies .GetMembers() and .GetDigestMembers() to
supply the data in list form to anything that needs it that way.
An new install showed this worked fine with some cursory testing of
the cgi's and interactive poking around.
A detailed listing of the changes follows:
Mailman/Defaults.py.in: change data version to 11
Mailman/Digester.py: initvars now instantiates digest_members as {}
instead of []
lines 113-114 and 121-122 now use del
This change implements storing list members and digest members as
dicts instead of lists, which optimizes Utils.FindMatchingAddresses
and general membership management, especially for large lists.
MailList.py now supplies .GetMembers() and .GetDigestMembers() to
supply the data in list form to anything that needs it that way.
Though INSTALL shows up on the changed files section, a diff a few
seconds ago didn't show any differences in that file, so I hope nobody
changed it in the interim.
An new install showed this worked fine with some cursory testing of
the cgi's and interactive poking around.
A detailed listing of the changes follows:
Mailman/Defaults.py.in: change data version to 11
Mailman/Digester.py: initvars now instantiates digest_members as {}
instead of []
lines 113-114 and 121-122 now use del
list.[digest_]member instead of
list.[digest_]members.remove
when figuring who to actually send digests to,
use list.GetDigestMembers() instead of
list.digest_members.
Mailman/HTMLFormatter: now uses list.Get[Digest]Members to get
subscribers, and length of digested subscribers
and regular members
MailCommandHandler, SecurityManager,Cgi/handle_opts, Cgi/options: all
simple replacements of list.[digest_]members with
list.Get[Digest]Members().
Mailman/Cgi/admin.py: mostly simple replacements of
list.[digest_]members with the Get..() methods, however, the
membership management section now works much quicker and changes
digest->nodigest subscriptions via dictionary manipulations.
Mailman/versions.py: updates lists to use dicts and changed
list.[digest_]members to use the list.Get[Digest]Members() methods.
Mailman/Utils.py: added a function "GetPossibleMatchingAddresses"
which when fed an address, returns the list of addresses that "smart"
address matching would match.
changed FindMatchingAddresses(name, list) to use a new signature:
FindMatchingAddresses(name, *dicts), where dicts is a list of
dictionaries keyed by addresses. Just realized that this would better
be FindMatchingAddresses(name, dict, *dicts) so that it enforces
atleast 2 args... I'll make that change in a sec.
All uses of FindMatchingAddresses have been changed to fit the new
arguments.
scott
----:**-F1 cvs30458aaa 1:12PM 0.98 Mail (Text Fill)--L59--32%-------------------------------------------
?
|
| |
|
|
|
|
|
|
| |
Madarasz Gergely. IsAdministrivia now strips sigs and counts lines
correctly from the body of the message instead of the whole message.
In addition, I up'd the constant 10 for the maximum number of lines
with text in them to 30.
scott
|
| |
|
|
|
|
|
|
|
| |
the Archiving code -- the only place this function is used currently.
open_ex(): Extended open. Like built-in open, but with an extra
argument that includes the permissions the file should be created
with. Avoids the need for chmod'ing the file. Also assures that
umask(0).
|
| |
|
|
|
|
|
|
| |
re-raising portable between Python 1.5.2 and earlier versions (which
don't allow bare `raise').
mkdir(): Wrap os.mkdir() in a umask saving try/finally. See docstring
for differences.
|