Opened 9 years ago
Closed 8 years ago
#296 closed task (fixed)
A small patch that adds a configurable strip_signature_regex
Reported by: | steverweber@… | Owned by: | bas |
---|---|---|---|
Priority: | major | Milestone: | strip signature/quotes |
Component: | email2trac | Version: | 2.5.0 |
Keywords: | Cc: |
Description
Find attached... A small patch that adds a configurable strip_signature_regex
We have been using email2trac for some time and been maintaining a private copy with a small change.. I feel it would be best if it was merged into your version of the.. email2trac.py.in
The attached file is in .py format and differs a little because I just need the simple script..
Anyways it allows email2trac.ini to have a.. strip_signature_regex = -----Original Message-----$|-- $|--$
it adds
def setup_parameters(self): if self.parameters.umask: os.umask(self.parameters.umask) ---------- if not self.parameters.strip_signature_regex: self.parameters.strip_signature_regex = '^-----Original Message-----$|^-- $|^--$' ----------
and
def strip_signature(self, text): """ Strip signature from message, inspired by Mailman software """ self.logger.debug('function strip_signature') body = [] for line in text.splitlines(): ---------- if re.match(self.parameters.strip_signature_regex, line): ---------- break body.append(line)
please merge something along those lines into the trunk/master.. I probably should have compiled the regex instead of using it like i did wasting cpu... but you should get the idea..
Thanks
Attachments (1)
Change History (6)
Changed 9 years ago by steverweber@…
comment:1 Changed 9 years ago by steverweber@…
- Milestone set to strip signature/quotes
- Type changed from defect to task
comment:3 Changed 8 years ago by anonymous
How can I use the patch?
comment:4 Changed 8 years ago by anonymous
First get the maintainer of this project to merge the change. Then in your email2trac.conf add a strip_signature_regex like.
[DEFAULT] ## strip_signature_regex - requires custom email2trac strip_signature_regex: ^-----Original Message-----$|^-- $|^--$|^--~$|^.*, Library Systems Support wrote:$ project: /trac/projects/libdev ........
comment:5 Changed 8 years ago by bas
- Resolution set to fixed
- Status changed from assigned to closed
custom email2trac that adds regex for strip_signature