| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
configuration file. While the full conversion is not yet complete, everything
that seems to be required to run mailmanctl, qrunner, rmlist, and newlist have
been updated.
Basically, modules should no longer import mm_cfg, but instead they should
import Mailman.configuration.config. The latter is an object that's
guaranteed to exist, but not guaranteed to be initialized until some top-level
script calls config.load(). The latter should be called with the argument to
-C/--config which is a new convention the above scripts have been given.
In most cases, where mm_cfg.<variable> is used config.<variable> can be used,
but the exceptions are where the default value must be available before
config.load() is called. Sometimes you can import Mailman.Default and get the
variable from there, but other times the code has to be changed to work around
this limitation. Take each on a case-by-case basis.
Note that the various directories calculated from VAR_PREFIX, EXEC_PREFIX, and
PREFIX are now calculated in config.py, not in Defaults.py. This way a
configuration file can override the base directories and everything should
work correctly.
Other changes here include:
- mailmanctl, qrunner, and update are switched to optparse and $-strings, and
changed to the mmshell architecture
- An etc directory has been added to /usr/local/mailman and a
mailman.cfg.sample file is installed there. Sites should now edit an
etc/mailman.cfg file to do their configurations, although the mm_cfg file is
still honored. The formats of the two files are identical.
- list_lists is given the -C/--config option
- Some coding style fixes in bin/update, but not extensive
- Get rid of nested scope hacks in qrunner.py
- A start on getting EmailBase tests working (specifically test_message),
although not yet complete.
|
| |
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
|
| |
Results.__init__(): Also do RFC 2047 decoding on Subject headers
before processing.
|
| | |
|
| |
|
|
|
| |
will assume it's 8-bit encoded to the passed-in character set, convert
unicode objects to that encoding.
|
| |
|
|
|
|
| |
possibly 'ignored' lines, if a lot of 'em were blank) on a command-handler
address, inform the user that the mail was empty, and how to get help. Based
on SF patch #522080, Respond sensibly to blank -request email, by Seb Wills.
|
| |
|
|
| |
has dots in it, so treat this the same as an ImportError.
|
| |
|
|
| |
autorespond_requests == 1, which means answer and discard.
|
| |
|
|
|
|
|
|
|
| |
send_response() to enable or suppress confirmation responses. For
example, when confirming a subscription, if a welcome message is going
to be sent out, we don't need to also send a results of the
confirmation message.
send_response(): Suppress the response if the `respond' flag is false.
|
| |
|
|
|
|
|
| |
pulling the Subject out of the command message. That's so later
(e.g. in cmd_confirm.py) we won't try to .lower() a None.
Closes SF bug report # 620032 by Ron Jarrell.
|
| |
|
|
| |
UserNotification!
|
| |
|
|
|
|
| |
send_response(): Check whether the sender has reached their
autoresponse limit before sending the results of the command. This
may not be the right time to do that check.
|
| |
|
|
| |
emails will be autoresponded. Closes bug #558909.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
list. Chuq gives us the relevant info from the sendmail docs:
When the name is found in a "Precedence:" field, the
message class is set to num. Higher numbers mean
higher precedence. Numbers less than zero have the
special property that if an error occurs during pro-
cessing the body of the message will not be returned;
this is expected to be used for "bulk" mail such as
through mailing lists. The default precedence is
zero. For example, our list of precedences is:
Pfirst-class=0
Pspecial-delivery=100
Plist=-30
Pbulk=-60
Pjunk=-100
People writing mailing list exploders are encouraged
to use "Precedence: list". Older versions of sendmail
(which discarded all error returns for negative prece-
dences) didn't recognize this name, giving it a
default precedence of zero. This allows list main-
tainers to see error returns on both old and new ver-
sions of sendmail.
|
| |
|
|
| |
"bulk", we now include "junk" and "list" as well.
|
| |
|
|
| |
have "X-Ack: yes".
|
| |
|
|
|
| |
unprocessed lines, check for line == None (can happen if the message
is sent to e.g. mylist-join with no body).
|
| |
|
|
| |
text/plain parts in the message.
|
| |
|
|
|
|
| |
failed, it might be because of a Re: prefix (or localized version
thereof). Pop off the first component of the args, use that as the
command and try again... once.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
MailCommandHandler.py. Specific changes include:
class Results: Basically a bag to hold state during the processing of
a particular email message loaded with commands. This makes it easy
to pass data around (like the mailing list object and the message).
It also contains the results of the command processing and gloms up
the response email.
_dispose(): This method actually gets simplified because it just needs
to pass things to the Results instance and let it do the job of
processing the email commands.
|
| |
|
|
|
| |
ParseMailCommands() calls in this runner need to be wrapped around a
catch of TimeOutError.
|
| |
|
|
|
| |
acquisition of the shared pending.db database lock fails, we want to
requeue the message for another try later.
|
| |
|
|
| |
confirm mail script.
|
| |
|
|
|
|
|
| |
specializing the queue directory, make QDIR a class attribute and have
Runner's ctor use that instead of an __init__() argument. This lets
us get rid of most of the __init__()'s in the derived classes.
(OutgoingRunner still needs one though.)
|
| |
|
|
|
|
|
|
|
|
|
| |
no longer handles any -admin or -owner messages, or any bounce
processing.
_dispose(): Don't look at the `authoritah' metadata key. Also, vastly
simplify the main switch because it only needs to look at torequest,
tojoin, and toleave.
_toadmins(): Removed as unnecessary.
|
| |
|
|
|
|
| |
just short-circuit returns. We need to do this after moving the
Save() into the try clause (which may turn out to not be the right
thing to do...)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
_toadmins(): Run the message through SpamDetect to filter out known
spam patterns in messages to the list owners/moderators. Log such
detected spam to logs/spam and discard the message.
Also, for every message to a list's -owner or -admin address, we
always send it on to the list owners and moderators, even though
the moderators can't access the admin pages (only the admindb
pages).
Note 1: this makes the `tomoderators' key in the message metadata
obsolete.
Note 2: this may not be the Right Thing To Do.
|
| | |
|
| | |
|
| |
|
|
|
| |
contains the "tomoderators" key, sent the message to both the list
owners and the list moderators.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
mail scripts simply add metadata `tojoin' or `toleave' respectively,
which tell CommandRunner which operation to perform.
This is a bit crufty since MailCommandHandler.ParseMailCommands()
still handles the actual job of adding or deleting the member.
CommandRunner hacks the Subject: line of the message to add just the
specific desired command, and it empties the message's payload
(effectively ignoring any additional commands or useless text in the
email message).
|
| | |
|
| |
|
|
|
| |
determine whether this message was destined for the -owner or -admin
address and update the metadata.
|
| | |
|
|
|
bounces, confirm notices, and -request email commands.
|