diff options
| author | bwarsaw | 1999-11-10 18:01:53 +0000 |
|---|---|---|
| committer | bwarsaw | 1999-11-10 18:01:53 +0000 |
| commit | 1463e4d989ac5fedbc246af303e0a60ba4193b9e (patch) | |
| tree | c62ebceab7eca1dad644de7ca44d87c800ae27ec /scripts | |
| parent | 967cdfad522eaf52d342c6dc664ec270eb52cb18 (diff) | |
| download | mailman-1463e4d989ac5fedbc246af303e0a60ba4193b9e.tar.gz mailman-1463e4d989ac5fedbc246af303e0a60ba4193b9e.tar.zst mailman-1463e4d989ac5fedbc246af303e0a60ba4193b9e.zip | |
Diffstat (limited to 'scripts')
| -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. |
