summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/post17
1 files changed, 8 insertions, 9 deletions
diff --git a/scripts/post b/scripts/post
index 964c71a75..4b73c84a6 100755
--- a/scripts/post
+++ b/scripts/post
@@ -1,4 +1,5 @@
-#! /usr/local/bin/python
+#! /usr/bin/env python
+#
# Copyright (C) 1998 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
@@ -22,15 +23,12 @@ This script is invoked via the mail wrapper.
Stdin is the mail message, and argv[1] is the name of the target mailing
list."""
-__version__ = "$Revision: 547 $"
# Todo: check size of To: list < 100
# Send back why the post was rejected.
import sys
-
-sys.path.append('/home/mailman/mailman/modules')
-
+import paths
import maillist, mm_message, mm_err, mm_cfg, mm_utils
try:
@@ -48,7 +46,7 @@ try:
prog = current_list.filter_prog
if prog:
import os, __main__
- file = os.path.join('/home/mailman/mailman/filters', prog)
+ file = os.path.join(paths.prefix, 'filters', prog)
try:
execfile(file)
text = __main__.mailman_text
@@ -74,7 +72,7 @@ try:
subj = msg.getheader('subject')
if not subj:
subj = '[no subject]'
- body = '''
+ body = """
Your mail to '%s' with the subject:
%s
@@ -87,12 +85,13 @@ The reason it is being held:
Either the message will get posted to the list, or you will receive
notification of the moderator's decison.
-''' % (current_list.real_name, subj, err_msg)
+""" % (current_list.real_name, subj, err_msg)
current_list.SendTextToUser( subject = 'Mail sent to %s' %
current_list.real_name,
recipient = the_sender,
- text = body)
+ text = body,
+ raw = 1)
# Let another process run.
finally:
current_list.Unlock()