Here's my incorporations of some of janne's patches.
On 16 Apr 1998, Janne Sinkkonen wrote:
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:
- No double Reply-To:'s to list mail. Reply-To:'s in some admin mail still remain.
I used "del msg['reply-to']" instead of iterating over the headers. (I had neglected to change some examples just above the added line that do the iteration, so it makes sense that's what you'd do. They're also changed in my version of the patch.)
- 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).
I'm not doing anything with this one. I don't think mailman should trim extra "Re:"s that someone else added, mailman just should avoid adding extra ones, itself.
- Some people wanted to have Reply-To: in every attachment of a MIME digest (for lists with reply_to_list true).
I have implemented just about what you did, *but* i avoided using an unqualified "except" clause. Unqualified except clauses are often evil
- they tend to hide bugs, like taking a pain killer to battle heart disease, it's almost always better to see the symptoms.
- 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).
I already put out a patch for the problem (which you had pointed out) on the ftp site - but had different or no polishings. I'll incorporate them soon.
- crontab: the right name of the script is senddigests.
Whoops! Thanks.
Ken
** I hope i got the order of the patch files right! Please double check before applying... **
Index: mm_deliver.py
RCS file: /hosts/parrot/local/cvsroot/mailman/modules/mm_deliver.py,v retrieving revision 1.20 diff -c -r1.20 mm_deliver.py *** mm_deliver.py 1998/04/15 02:53:01 1.20 --- mm_deliver.py 1998/04/23 23:40:24
*** 113,128 **** if remove_to: # Writing to a file is better than waiting for sendmail to exit tempfile.template = tmpfile_prefix +'mailman-digest.' ! for item in msg.headers: ! if (item[0:3] == 'To:' or ! item[0:5] == 'X-To:'): ! msg.headers.remove(item) msg.headers.append('To: %s\n' % self.GetListEmail()) else: tempfile.template = tmpfile_prefix + 'mailman.' if self.reply_goes_to_list: msg.headers.append('Reply-To: %s\n' % self.GetListEmail()) msg.headers.append('Errors-To: %s\n' % self.GetAdminEmail())
tmp_file_name = tempfile.mktemp()
tmp_file = open(tmp_file_name, 'w+')
--- 113,128 ---- if remove_to: # Writing to a file is better than waiting for sendmail to exit tempfile.template = tmpfile_prefix +'mailman-digest.' ! del msg['to'] ! del msg['x-to'] msg.headers.append('To: %s\n' % self.GetListEmail()) else: tempfile.template = tmpfile_prefix + 'mailman.' if self.reply_goes_to_list:
del msg['reply-to'] msg.headers.append('Reply-To: %s\n' % self.GetListEmail())
msg.headers.append('Errors-To: %s\n' % self.GetAdminEmail())
msg.headers.append('X-BeenThere: %s\n' % self.GetListEmail())
tmp_file_name = tempfile.mktemp()
tmp_file = open(tmp_file_name, 'w+') Index: mm_digest.py
RCS file: /hosts/parrot/local/cvsroot/mailman/modules/mm_digest.py,v retrieving revision 1.18 diff -c -r1.18 mm_digest.py *** mm_digest.py 1998/04/22 16:33:39 1.18 --- mm_digest.py 1998/04/23 22:27:00
*** 97,107 ****
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()
digest_file.close()
--- 97,112 ----
body = self.QuoteMime(post.body)
topics_file.write(" %d. %s (%s)\n" % (self.next_post_number,
subject, sender))
! if self.reply_goes_to_list:
! maybe_replyto=('Reply-To: %s\n'
! % self.QuoteMime(self.GetListEmail()))
! else:
! maybe_replyto=''
! 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()
digest_file.close()