source: mailtotracplugin/0.12/plugin/mail2trac/filters.py

Last change on this file was 10872, checked in by Olivier ANDRE, 12 years ago

New implementation of mail2trac, in 0.12 branch

Create and responde to ticket via mail.

Allow :

creation
comment
actions (reassign, resolve, etc ..)
attachment
property changes

File size: 732 bytes
RevLine 
[7089]1"""
2Trac mail filters
3"""
4
5from mail2trac.interface import IEmailHandler
6from trac.core import *
7from utils import strip_quotes
8
9class RemoveQuotes(Component):
10    """removes reply quotes from email (or tries to, anyway)"""
11
12    implements(IEmailHandler)
13
14    def match(self, message):
[10872]15        return False
[7089]16
17    def invoke(self, message, warnings):
18        payload = message.get_payload()
19        if isinstance(payload, basestring):
[7090]20            if message.get('Content-Disposition', 'inline') == 'inline' and message.get_content_maintype() == 'text':
[7089]21                message.set_payload(strip_quotes(payload))
22        else:
23            for _message in payload:
24                self.invoke(_message, warnings)
25        return message
Note: See TracBrowser for help on using the repository browser.