summaryrefslogtreecommitdiff
path: root/Mailman/Deliverer.py
diff options
context:
space:
mode:
authorbwarsaw1998-05-26 19:15:02 +0000
committerbwarsaw1998-05-26 19:15:02 +0000
commit2cf1a4a14d086b7e8e072b6699c99207b5fba50a (patch)
treea0b925aca2b8b58507dbc53e92c34be34e09a2ec /Mailman/Deliverer.py
parent292460938ede2616eae61ba13d2e933305cf4fb4 (diff)
downloadmailman-2cf1a4a14d086b7e8e072b6699c99207b5fba50a.tar.gz
mailman-2cf1a4a14d086b7e8e072b6699c99207b5fba50a.tar.zst
mailman-2cf1a4a14d086b7e8e072b6699c99207b5fba50a.zip
Diffstat (limited to 'Mailman/Deliverer.py')
-rw-r--r--Mailman/Deliverer.py93
1 files changed, 47 insertions, 46 deletions
diff --git a/Mailman/Deliverer.py b/Mailman/Deliverer.py
index 2b189d689..88e96134c 100644
--- a/Mailman/Deliverer.py
+++ b/Mailman/Deliverer.py
@@ -17,8 +17,6 @@
"""Mixin class with message delivery routines."""
-__version__ = "$Revision: 547 $"
-
import string, os, sys, tempfile
import mm_cfg, mm_message, mm_err, mm_utils
@@ -30,47 +28,49 @@ Your message entitled:
%s
-was successfully received by the %s maillist.
+was successfully received by the %s mailing list.
-(List info page: %s )
+List info page: %s
'''
-SUBSCRIBEACKTEXT = '''Welcome %s to the %s@%s mailing list!
-%s%s
-General information about the maillist is at:
+SUBSCRIBEACKTEXT = """Welcome to the %(real_name)s@%(host_name)s mailing list!
+%(welcome)s
+To post to this list, send your email to:
- %s
+ %(emailaddr)s
-If you ever want to unsubscribe or change your options (eg, switch to
-or from digest mode, change your password, etc.), visit your subscription
+General information about the mailing list is at:
+
+ %(generalurl)s
+
+If you ever want to unsubscribe or change your options (eg, switch to or
+from digest mode, change your password, etc.), visit your subscription
page at:
- %s
+ %(optionsurl)s
-You can also make such adjustments via email - send a message to:
+You can also make such adjustments via email by sending a message to:
- %s-request@%s
+ %(real_name)s-request@%(host_name)s
-with the text "help" in the subject or body, and you will get back a
+with the word `help' in the subject or body, and you will get back a
message with instructions.
-You must know your password to change your options (including changing the
-password, itself) or to unsubscribe. It is:
+You must know your password to change your options (including changing
+the password, itself) or to unsubscribe. It is:
- %s
+ %(password)s
-If you forget your password, don't worry, you will receive a monthly
-reminder telling you what all your %s maillist passwords are,
-and how to unsubscribe or change your options. There is also a button on
-your options page that will email your current password to you.
+If you forget your password, don't worry, you will receive a monthly
+reminder telling you what all your %(host_name)s mailing list passwords
+are, and how to unsubscribe or change your options. There is also a
+button on your options page that will email your current password to
+you.
-You may also have your password mailed to you automatically off of
-the web page noted above.
+You may also have your password mailed to you automatically off of the
+web page noted above.
-To post to this list, send your email to:
-
- %s
-'''
+"""
USERPASSWORDTEXT = '''
This is a reminder of how to unsubscribe or change your configuration
@@ -98,12 +98,12 @@ Questions or comments? Please send them to %s.
class Deliverer:
# This method assumes the sender is list-admin if you don't give one.
def SendTextToUser(self, subject, text, recipient, sender=None,
- add_headers=[]):
+ add_headers=[], raw=0):
# repr(recipient) necessary for addresses containing "'" quotes!
if not sender:
sender = self.GetAdminEmail()
mm_utils.SendTextToUser(subject, text, recipient, sender,
- add_headers=add_headers)
+ add_headers=add_headers, raw=raw)
def DeliverToUser(self, msg, recipient):
# This method assumes the sender is the one given by the message.
@@ -152,12 +152,16 @@ class Deliverer:
if footer:
tmp_file.write(footer)
tmp_file.close()
- file = os.popen("%s %s %s %s %s" %
- (os.path.join(mm_cfg.MAILMAN_DIR, "mail/deliver"),
- tmp_file_name, self.GetAdminEmail(),
- self.num_spawns, to_list))
-
- file.close()
+ cmd = "%s %s %s %s %s %s" % (
+ mm_cfg.PYTHON,
+ os.path.join(mm_cfg.SCRIPTS_DIR, "deliver"),
+ tmp_file_name, self.GetAdminEmail(),
+ self.num_spawns, to_list)
+ file = os.popen(cmd)
+ status = file.close()
+ if status:
+ sys.stderr.write('Non-zero exit status: %d'
+ '\nCmd: %s' % ((status >> 8), cmd))
def SendPostAck(self, msg, sender):
subject = msg.getheader('subject')
@@ -176,21 +180,18 @@ class Deliverer:
def CreateSubscribeAck(self, name, password):
if self.welcome_msg:
- header = '\nHere is the list-specific welcome message:\n\n'
welcome = self.welcome_msg + '\n'
else:
- header = ''
welcome = ''
- body = (SUBSCRIBEACKTEXT % (name,
- self.real_name, self.host_name,
- header, welcome,
- self.GetScriptURL('listinfo'),
- self.GetOptionsURL(name),
- self.real_name, self.host_name,
- password,
- self.host_name,
- self.GetListEmail()))
+ body = SUBSCRIBEACKTEXT % {'real_name' : self.real_name,
+ 'host_name' : self.host_name,
+ 'welcome' : welcome,
+ 'emailaddr' : self.GetListEmail(),
+ 'generalurl': self.GetScriptURL('listinfo'),
+ 'optionsurl': self.GetOptionsURL(name),
+ 'password' : password,
+ }
return body
def SendSubscribeAck(self, name, password, digest):