comparison roundup/mailer.py @ 3975:48457385bf61

Send a Precedence header in email so autoresponders don't
author Richard Jones <richard@users.sourceforge.net>
date Mon, 21 Jul 2008 01:44:58 +0000
parents 7c886f83c2ab
children 4b0ddce43d08
comparison
equal deleted inserted replaced
3974:ff089ebe95d1 3975:48457385bf61
1 """Sending Roundup-specific mail over SMTP. 1 """Sending Roundup-specific mail over SMTP.
2 """ 2 """
3 __docformat__ = 'restructuredtext' 3 __docformat__ = 'restructuredtext'
4 # $Id: mailer.py,v 1.21 2007-11-14 05:53:20 jpend Exp $ 4 # $Id: mailer.py,v 1.22 2008-07-21 01:44:58 richard Exp $
5 5
6 import time, quopri, os, socket, smtplib, re, sys, traceback 6 import time, quopri, os, socket, smtplib, re, sys, traceback
7 7
8 from cStringIO import StringIO 8 from cStringIO import StringIO
9 from MimeWriter import MimeWriter 9 from MimeWriter import MimeWriter
70 writer = MimeWriter(message) 70 writer = MimeWriter(message)
71 writer.addheader('Subject', encode_header(subject, charset)) 71 writer.addheader('Subject', encode_header(subject, charset))
72 writer.addheader('To', ', '.join(to)) 72 writer.addheader('To', ', '.join(to))
73 writer.addheader('From', author) 73 writer.addheader('From', author)
74 writer.addheader('Date', formatdate(localtime=True)) 74 writer.addheader('Date', formatdate(localtime=True))
75
76 # add a Precedence header so autoresponders ignore us
77 writer.addheader('Precedence', 'bulk')
75 78
76 # Add a unique Roundup header to help filtering 79 # Add a unique Roundup header to help filtering
77 writer.addheader('X-Roundup-Name', encode_header(tracker_name, 80 writer.addheader('X-Roundup-Name', encode_header(tracker_name,
78 charset)) 81 charset))
79 # and another one to avoid loops 82 # and another one to avoid loops

Roundup Issue Tracker: http://roundup-tracker.org/