|
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
|
| Line | |
|---|
| 1 | """ |
|---|
| 2 | Trac mail filters |
|---|
| 3 | """ |
|---|
| 4 | |
|---|
| 5 | from mail2trac.interface import IEmailHandler |
|---|
| 6 | from trac.core import * |
|---|
| 7 | from utils import strip_quotes |
|---|
| 8 | |
|---|
| 9 | class RemoveQuotes(Component): |
|---|
| 10 | """removes reply quotes from email (or tries to, anyway)""" |
|---|
| 11 | |
|---|
| 12 | implements(IEmailHandler) |
|---|
| 13 | |
|---|
| 14 | def match(self, message): |
|---|
| 15 | return False |
|---|
| 16 | |
|---|
| 17 | def invoke(self, message, warnings): |
|---|
| 18 | payload = message.get_payload() |
|---|
| 19 | if isinstance(payload, basestring): |
|---|
| 20 | if message.get('Content-Disposition', 'inline') == 'inline' and message.get_content_maintype() == 'text': |
|---|
| 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.