------------------------------------------------------------
revno: 1142
committer: Mark Sapiro <[EMAIL PROTECTED]>
branch nick: 2.1
timestamp: Tue 2008-12-02 14:37:29 -0800
message:
If we somehow retrieve a message from the newsgroup with no headers,
skip trying to post it to the list.
Make sure we always update the watermark even if the message is empty
or unparseable.
modified:
cron/gate_news
=== modified file 'cron/gate_news'
--- a/cron/gate_news 2008-09-21 19:12:52 +0000
+++ b/cron/gate_news 2008-12-02 22:37:29 +0000
@@ -131,6 +131,9 @@
glock.refresh()
try:
headers = conn.head(`num`)[3]
+ # I don't know how this happens, but skip an empty message.
+ if not headers:
+ raise _ContinueLoop
found_to = 0
beenthere = 0
for header in headers:
@@ -184,9 +187,12 @@
syslog('fromusenet', str(e))
except _ContinueLoop:
continue
- # Even if we don't post the message because it was seen on the
- # list already, update the watermark
- mlist.usenet_watermark = num
+ # Even if we don't post the message because it was seen on the
+ # list already, or if we skipped it as unparseable or empty,
+ # update the watermark. Note this used to be in the 'for' block
+ # but if the last message(s) raised _ContinueLoop, they wouldn't
+ # update the watermark.
+ mlist.usenet_watermark = num
--
Stable, maintained release series
https://code.launchpad.net/~mailman-coders/mailman/2.1
You are receiving this branch notification because you are subscribed to it.
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org