Hello,
I am doing something wrong with the email2trac package. When i convert
an email to ticket all fields are converted properly, but when i update
the converted ticket via the web interface it always says that the
description is changed.
This is very annoying if notification is enabled. There is always an
email that says the description has been changed. But there is no change
at all.
Is there a proper way to convert the email ascci text message to the
ticket['description'] field?
This is short what i am doing now:
==================================================================
if part.get_content_type() == 'text/plain':
# Try to decode, if fails then do not decode
#
body_text = part.get_payload(decode=1)
if not body_text:
body_text = part.get_payload(decode=0)
# Get contents charset (iso-8859-15 if not defined in mail headers)
# UTF-8 encode body_text
#
charset = part.get_content_charset('iso-8859-15')
try:
temp = unicode(body_text, charset)
except (UnicodeError,LookupError):
temp = unicode(body_text, 'iso-8859-15')
ubody_text = temp.encode('utf-8')
tkt['description'] = '\n{{{\n%s\n}}}\n' %(ubody_txt)
--
--
********************************************************************
* *
* Bas van der Vlies e-mail: [EMAIL PROTECTED] *
* SARA - Academic Computing Services phone: +31 20 592 8012 *
* Kruislaan 415 fax: +31 20 6683167 *
* 1098 SJ Amsterdam *
* *
********************************************************************
_______________________________________________
Trac mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac