diff options
Diffstat (limited to 'scripts/post')
| -rwxr-xr-x | scripts/post | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/scripts/post b/scripts/post index 4939731a7..ac7c6a4f0 100755 --- a/scripts/post +++ b/scripts/post @@ -31,6 +31,12 @@ thus should not be re-posted to news if the list gates to a newsgroup. import sys import paths + +try: + from cStringIO import StringIO +except ImportError: + from StringIO import StringIO + from Mailman import MailList from Mailman import Message from Mailman import Errors @@ -50,17 +56,17 @@ else: fromusenet = 0 try: prog = mlist.filter_prog + msg = None if prog: import os, __main__ file = os.path.join(paths.prefix, 'filters', prog) try: execfile(file) - text = __main__.mailman_text + msg = Message.Message(StringIO(__main__.mailman_text)) except: - text = sys.stdin.read() - else: - text = sys.stdin.read() - msg = Message.IncomingMessage(text) + pass + if msg is None: + msg = Message.Message(sys.stdin) # this attribute is a flag to both the GatewayManager and the approval # mechanism. When a message originates from Usenet, we do not want to # post it back there again. Also, such messages are never held for @@ -70,7 +76,8 @@ try: # more of a PITA for the list owner. msg.fromusenet = fromusenet try: - mlist.Post(msg, approved=fromusenet) + mlist.Post(msg) + # TBD: change this to use LoopError except Errors.MMLoopingPost: # let the list admin know this happened, but don't otherwise hold the # message for approval. |
