| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
conversion to optparse style option parsing. Remove mailpasswds as password
reminders will go away for MM2.2.
|
| |
|
|
|
|
|
|
|
|
|
| |
I didn't update cron/mailpasswds because that is going away. cron/disabled
and cron/gate_news are only minimally tested.
- Instead of using the RotatingFileHandler for our logs, use our own
ReopenableFileHandler, which only minimally derives from FileHandler and
implements a reopen() method. I think it's generally better to leave file
rotation to external tools such as logrotate.
- Remove some Python 2.1 compatibility stuff.
- Ignore .mo files in messages/vi/LC_MESSAGES
|
| | |
|
| | |
|
| |
|
|
|
|
| |
and cron scripts. When code/status == 0, there's no error (it's
likely --help output) so send that to stdout. Otherwise, it's an
error and the output goes to stderr.
|
| |
|
|
| |
since the default is fine.
|
| |
|
|
|
|
| |
raised in the NNTP() constructor. Just catch it, log it, and move on.
Also, whitespace normalization.
|
| |
|
|
| |
existing X-Originally-To header before we place our own there.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
nntp_host. Also, clean up some exception handling. Specifically,
open_newsgroup(): Cache the connection object.
clearcache(): New function to clean things up at script exit.
poll_newsgroup(): Catch all NNTPErrors, not just (obsolete)
error_temp.
process_lists(): Catch all socket and nntplib errors when opening the
newsgroup.
main(): Be sure to clear the nntp connection cache when done.
|
| |
|
|
| |
appropriate addresses.
|
| |
|
|
|
| |
modules. Specifically, import the email package /after/ we've
imported paths.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
into the script's #! line -- based on --with-python settings, without
losing CVS revision history.
#! /usr/bin/env python
becomes
#! @PYTHON@
which gets substituted for in configure.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
after paths. Because these scripts are run from cron with "python -S"
they must import mm_cfg before attempting to import mimelib; mm_cfg
hacks sys.path to include site-packages which -S inhibits.
For those scripts that already import mm_cfg, add a comment describing
the import order dependencies. For those that didn't, add a comment
about why it's being imported.
Also, gate_news: Removed the _ContinueLoop docstring so translators
have one less non-translatable docstring to worry about.
Closes Thomas's SF patch #443803.
|
| |
|
|
| |
clauses.
|
| |
|
|
| |
broken MIME boundaries are ignored.
|
| |
|
|
|
|
| |
been hacked (thanks Ron Jarrell). I hadn't been trying this as a cron
job, and the Python on my path has mimelib installed (and I wasn't
using -S).
|
| |
|
|
|
|
|
|
| |
References to HandlerAPI module removed.
Use the new mimelib and switchboard interfaces.
Add some i18n markup.
|
| |
|
|
|
| |
catch any socket errors coming back from the nntp connection
attempts.
|
| | |
|
| |
|
|
| |
locked until absolutely necessary.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
happens in the parent process.
poll_newsgroup(): Take a `lock' argument to keep the gate_news lock
fresh while gating the newsgroup. Some changes to the log messages.
gate_news(): Removed -- folded into process_lists().
process_lists(): Take a `lock' argument to pass to poll_newsgroup().
Perform all work in the parent process. Better logging.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
errors go to the logs/gate_news file, while any exceptions that
percolate to the top would go to logs/error.
poll_newsgroup(): Always update the watermark, even if the message has
been seen before (i.e. we found an X-BeenThere: header) or if an
nntp.error_temp occurred (which can happen if the message has
expired). Any other exceptions will not be caught and thus will not
update the watermark.
process_lists(): Be extra paranoid about the forks and child
processes. First of all, the fork could fail and if so, we stop
cruising through the mailing lists and return to the parent the
dictionary of child pids gathered so far. Second, make absolutely
sure that the child process exits without returning control to the
caller. If we complete successfully or if a TimeOutError occurred, we
exit with status 0, otherwise we print a traceback and exit with
status 1.
main(): First off, we added a keepalive function to geep the gate_news
lock fresh while we're waiting for our child processes to exit.
Second, we added a failsafe around process_list() -- which does a fork
-- so that in the unlikely situation where the child process could
have gotten returned here, we exit immediately.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
all logging activities except stderr output from child tracebacks.
Get rid of unused imports.
poll_newsgroup(): Reorganized so as not to use the crufty
QuickEscape. Also, be sure to update mlist.usenet_watermark even if
we see a message that's already been through the list. When
delivering the message to the list, enqueue it immediately (by adding
the _enqueue_immediate flag to msgdata) instead of trying to deliver
it. This lets qrunner deliver the message as appropriate.
reap(): Move to Utils.py
process_lists(): Don't try to be fancy about catching exceptions in
the child. Just let them percolate up and Python will do the right
thing by logging it and exiting with a non-zero status.
main(): Use standard LockFile module for acquiring the gate_news lock.
|
| |
|
|
| |
site-wide NNTP authentication values.
|
| |
|
|
| |
anymore. Use HandlerAPI.DeliverToList().
|
| |
|
|
| |
the unixfrom line.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Tittsler. In summary, each list maintains its own watermark as a
config.db attribute, and the separate gate_watermarks is no longer
used. This greatly simplifies the logic in this script.
Some specifics,
main(): The command line options have changed, and no longer supports
invocation as "gate_news listname first last". Added --stderrs/-s,
--quiet/-q, and --help/-h flags.
Removed unnecessary imports.
WATERMARK_FILE, LIST_LOCK_FILE both are gone. There's a global block
file and each list locks itself when actually doing the gating of
articles.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
version of this module.
main(): simplified connection creation, set readermode in constructor.
|
| |
|
|
|
| |
is moved to X-Originally-To:. In all cases, To: is set to the list's
email address. This resolves PR#172.
|
| |
|
|
|
|
|
|
| |
NNTP connection. If the Mailman gateway is on the same machine as the
news server, you probably need to set the news server to reader mode
first.
Patch given by Thomas Wouters inspired by a patch from Jim Tittsler.
|
| | |
|
| |
|
|
| |
cron mailing me the output sent to stdout on every run.
|
| | |
|
| | |
|
| |
|
|
| |
added by StampedLogger.
|
| |
|
|
|
| |
in scripts/driver. Maybe this will fix the problem with the weird
Archiver import errors??
|
| |
|
|
|
| |
Also, catch socket.error's that can occur during the nntplib.NNTP()
call.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
command line interface. This latter allows you to manually poll a
specific list's newsgroup for a range of message numbers, sending them
to the list. Using this interface does /not/ update the watermark
file.
We also don't update the watermark entry for a specific list until
that list's child process (which does the actually gating of the
messages from Usenet to mailing list) exits with a zero status. If it
exits with non-zero, it is taken as a complete failure of the gating
process and the watermark isn't updated. This could cause
duplicates, so a really anal approach would be to create a pipe
between child and parent and write the new watermark after each
message is successfully gated.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
hung_timeout => lifetime
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
messing up their SIGCHLD handling. This would manifest as an IOError
getting raised in the cmdproc.close() call of DeliverToList() in
Deliverer.py. Thanks go Harald Meland for describing the real problem
and giving the real fix. Thanks go to Greg Stein for testing this
patch and verifying that it works.
Deliverer.DeliverToList(): Undo previously checked in patch, which
simply wrapped a try/except around the cmdproc.close() call and
ignored errno=10 IOErrors. This was treating the symptoms, not the
cause.
All files in cron/: Added Harald's work around of the Linux bug by
including these lines in every file:
# Work around known problems with some RedHat cron daemons
import signal
signal.signal(signal.SIGCHLD, signal.SIG_DFL)
It helps RedHat and doesn't appear to hurt on e.g. Solaris.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- reorganized into functions with a small amount of __main__ code
- re-ordered the way the work gets done between the parent and the
child. it was possible the gate_watermarks file would be
continuously trashed because it was written by every child process,
which run asynchronously. now only the parent writes this file, but
it does so after each list's gating child process starts.
This also means that the parent is what makes the initial NNTP
connection, and gets the stats of the list (e.g. first and last).
These it passes to the child process, along with the current
watermark. The child just does the actual gating.
- Added a per-list locking file so that only one gate_news process
will be gating a list at any one time. What happens is: the parent
acquires the per-list lock. If that fails, it just moves on to the
next list; gate_news runs again in 5 minutes anyway, and the
hung_timeout on the lock is set to 4 minutes.
If the parent gets the per-list lock, it forks a child to handle
gating that list. The child then steals the lock from the parent
(this should be safe), gates all the new messages, and then releases
the per-list lock.
This new code should be forking-safe, should not have run away
processes, and lets you run gate_news from the command line without
interfering with any cron spawned gate_news process.
|
| |
|
|
|
|
|
| |
times.
XXX - this should probably be made to fork only for lists that
actually need to gate news.
scott
|
| |
|
|
| |
from Mailman import mm_cfg
|