Changeset 136 for emailtotracscript
- Timestamp:
- 11/27/06 16:29:32 (17 years ago)
- Location:
- emailtotracscript/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
emailtotracscript/trunk/ChangeLog
r135 r136 3 3 4 4 - Added verbatim_format option default is: 1 5 - Added strip_signature option default is: 0 5 6 6 7 2006-10-27 -
emailtotracscript/trunk/email2trac.conf
r134 r136 14 14 drop_spam : 0 15 15 verbatim_format: 1 16 strip_signatures: 1 16 17 17 18 -
emailtotracscript/trunk/email2trac.py.in
r134 r136 81 81 import time 82 82 import email 83 import email.Iterators 84 import email.Header 83 85 import re 84 86 import urllib 85 87 import unicodedata 86 88 import ConfigParser 87 from email import Header88 89 from stat import * 89 90 import mimetypes … … 176 177 self.VERBATIM_FORMAT = 1 177 178 179 if parameters.has_key('strip_signature'): 180 self.STRIP_SIGNATURE = int(parameters['strip_signature']) 181 else: 182 self.STRIP_SIGNATURE = 0 183 178 184 179 185 # X-Spam-Score: *** (3.255) BAYES_50,DNS_FROM_AHBL_RHSBL,HTML_ … … 198 204 understands it. 199 205 """ 200 results = Header.decode_header(str)206 results = email.Header.decode_header(str) 201 207 str = None 202 208 for text,format in results: … … 506 512 self.new_ticket(m) 507 513 514 def strip_signature(self, text): 515 """ 516 Strip signature from message, inspired by Mailman software 517 """ 518 body = [] 519 for line in text.splitlines(): 520 if line == '-- ': 521 break 522 body.append(line) 523 524 return ('\n'.join(body)) 525 508 526 def get_body_text(self, msg): 509 527 """ … … 527 545 if not body_text: 528 546 body_text = part.get_payload(decode=0) 547 548 if self.STRIP_SIGNATURE: 549 body_text = self.strip_signature(body_text) 529 550 530 551 # Get contents charset (iso-8859-15 if not defined in mail headers)
Note: See TracChangeset
for help on using the changeset viewer.