[Mailman-developers] More polishing...
Janne Sinkkonen
janne@avocado.pc.helsinki.fi
16 Apr 1998 22:57:10 +0300
Below is a set of patches to take care of a few bugs. My earlier patch
to get rid of extra Re:'s is included in a modified form.
Changes:
1. No double Reply-To:'s to list mail. Reply-To:'s in some admin mail
still remain.
2. Get rid of extra Re:'s on the subject line. However, leave
"Re: PREFIX" instead of "PREFIX Re:" - the latter does not work
with some mail readers which use Re: for threading (and there was
some strange problems with answering the mail as well).
3. Some people wanted to have Reply-To: in every attachment
of a MIME digest (for lists with reply_to_list true).
4. A bug in digest topic section (wrong argument order to ""%(...))
corrected. Some polishing of the header (to make it more
useful to the most helpless non-WWW-subscribers).
5. crontab: the right name of the script is senddigests.
*** modules/mm_deliver.dist.py Wed Apr 15 20:43:04 1998
--- modules/mm_deliver.py Thu Apr 16 22:16:38 1998
***************
*** 123,128 ****
--- 123,131 ----
else:
tempfile.template = tmpfile_prefix + 'mailman.'
if self.reply_goes_to_list:
+ # Get rid of old Reply-To:
+ for item in msg.headers:
+ if item[0:9] == 'Reply-To:': msg.headers.remove(item)
msg.headers.append('Reply-To: %s\n' % self.GetListEmail())
msg.headers.append('Errors-To: %s\n' % self.GetAdminEmail())
*** modules/maillist.dist.py Sun Apr 12 07:34:01 1998
--- modules/maillist.py Thu Apr 16 21:07:18 1998
***************
*** 747,755 ****
prefix = self.subject_prefix
if not subj:
msg.SetHeader('Subject', '%s(no subject)' % prefix)
! elif not re.match("(re:? *)?" + re.escape(self.subject_prefix),
! subj, re.I):
! msg.SetHeader('Subject', '%s%s' % (prefix, subj))
if self.digestable:
self.SaveForDigest(msg)
--- 747,763 ----
prefix = self.subject_prefix
if not subj:
msg.SetHeader('Subject', '%s(no subject)' % prefix)
! else:
! if re.match("(re:? *)*" + re.escape(prefix), subj, re.I):
! # The subject prefix is there already, possibly with some Re:'s.
! # Take the extra Re:'s away, put one behind prefix.
! prefix_mess_rx=re.compile('^(re:? *)*' +
! re.escape(prefix) + '(re:? *)*', re.I)
! subj=re.sub(prefix_mess_rx, 'Re: ' + prefix, subj)
! else:
! # No prefix yet.
! subj=prefix+subj
! msg.SetHeader('Subject', subj)
if self.digestable:
self.SaveForDigest(msg)
*** modules/mm_digest.dist.py Thu Apr 16 20:57:13 1998
--- modules/mm_digest.py Thu Apr 16 22:03:10 1998
***************
*** 97,106 ****
body = self.QuoteMime(post.body)
topics_file.write(" %d. %s (%s)\n" % (self.next_post_number,
subject, sender))
digest_file.write("--%s\n\nMessage: %d"
! "\nFrom: %s\nDate: %s\nSubject: %s\n\n%s" %
(self._mime_separator, self.next_post_number,
! fromline, date, subject,
body))
self.next_post_number = self.next_post_number + 1
topics_file.close()
--- 97,116 ----
body = self.QuoteMime(post.body)
topics_file.write(" %d. %s (%s)\n" % (self.next_post_number,
subject, sender))
+ try:
+ if self.reply_goes_to_list:
+ maybe_replyto='Reply-To: %s\n' % (
+ self.QuoteMime(self.GetListEmail()),)
+ else:
+ maybe_replyto=''
+ except:
+ self.LogMsg("error",
+ "mm_digest: tried to include reply-to - not quite")
+
digest_file.write("--%s\n\nMessage: %d"
! "\nFrom: %s\nDate: %s\nSubject: %s\n%s\n%s" %
(self._mime_separator, self.next_post_number,
! fromline, date, subject, maybe_replyto,
body))
self.next_post_number = self.next_post_number + 1
topics_file.close()
***************
*** 185,198 ****
Subject: Contents of %s digest, Volume %d #%d
Date: %s
! When replying, please edit your Subject line so it is more specific than
"Re: Contents of %s digest..."
Send %s maillist submissions to
%s
To subscribe or unsubscribe via the web, visit
%s
! or send email to %s
Topics for this digest:
%s
--- 195,210 ----
Subject: Contents of %s digest, Volume %d #%d
Date: %s
! When replying, please edit your Subject line to be more specific than just
"Re: Contents of %s digest..."
Send %s maillist submissions to
%s
To subscribe or unsubscribe via the web, visit
%s
! or send email to
! %s
! A message saying just 'help' (without the quotes) will give you a guide.
Topics for this digest:
%s
***************
*** 200,207 ****
msg.GetSender(),
self.real_name, self.volume, self.next_digest_number,
time.ctime(time.time()),
! self.real_name, self.GetListEmail(),
! self.real_name,
self.GetScriptURL('listinfo'),
self.GetRequestEmail(),
topics_text)
--- 212,219 ----
msg.GetSender(),
self.real_name, self.volume, self.next_digest_number,
time.ctime(time.time()),
! self.real_name, self.real_name,
! self.GetListEmail(),
self.GetScriptURL('listinfo'),
self.GetRequestEmail(),
topics_text)
*** cron/crontab.in~ Fri Apr 3 03:16:29 1998
--- cron/crontab.in Thu Apr 16 20:52:38 1998
***************
*** 2,8 ****
0 17 * * * /usr/local/bin/python /home/mailman/mailman/cron/checkdbs
#
# Noon, mail digests for lists that do periodic as well as threshhold delivery.
! 0 12 * * * /usr/local/bin/python /home/mailman/mailman/cron/checkdigests
#
# 5 AM on the first of each month, mail out password reminders.
0 5 1 * * /usr/local/bin/python /home/mailman/mailman/cron/mailpasswds
--- 2,8 ----
0 17 * * * /usr/local/bin/python /home/mailman/mailman/cron/checkdbs
#
# Noon, mail digests for lists that do periodic as well as threshhold delivery.
! 0 12 * * * /usr/local/bin/python /home/mailman/mailman/cron/senddigests
#
# 5 AM on the first of each month, mail out password reminders.
0 5 1 * * /usr/local/bin/python /home/mailman/mailman/cron/mailpasswds