diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-11-07 19:58:41 -0300 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-11-07 19:58:41 -0300 |
commit | 2941099084e1defdfc04606242727e7ab4d5a29e (patch) | |
tree | 49ccb11a05005f34b9c897c5195abc05609971a0 | |
parent | 1b30fa78a8b2f89f0f977e15046ddc0c081cab98 (diff) | |
download | askbot-2941099084e1defdfc04606242727e7ab4d5a29e.tar.gz askbot-2941099084e1defdfc04606242727e7ab4d5a29e.tar.bz2 askbot-2941099084e1defdfc04606242727e7ab4d5a29e.zip |
added one more regex for gmail and default stripping of 2 lines in case no regex matches
-rw-r--r-- | askbot/mail/parsing.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/askbot/mail/parsing.py b/askbot/mail/parsing.py index 6d664bcc..f856067c 100644 --- a/askbot/mail/parsing.py +++ b/askbot/mail/parsing.py @@ -14,6 +14,7 @@ import sys #to keep them simpler and make the additions of language variants #easier. GMAIL_QUOTE_RE = r'\nOn [^\n]* wrote:\Z' +GMAIL_QUOTE_RE2 = r'\d{4}/\d{1,2}/d{1,2} [^\n]\Z' YAHOO_QUOTE_RE = r'\n_+\n\s*From: [^\n]+\nTo: [^\n]+\nSent: [^\n]+\nSubject: [^\n]+\Z' KMAIL_QUOTE_RE = r'\AOn [^\n]+ you wrote:\s*\n\n' OUTLOOK_RTF_QUOTE_RE = r'\nSubject: [^\n]+\nFrom: [^\n]+\nTo: [^\n]+\nDate: [^\n]+\Z' @@ -57,7 +58,7 @@ def strip_email_client_quote_separator(text): #did not find a quote separator!!! log it log_message = 'no matching quote separator: %s\n' % text sys.stdout.write(log_message.encode('utf-8')) - return text + return text[:-2]#strip two lines, only guessing here def extract_reply_contents(text, reply_separator=None): """If reply_separator is given, |