Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#206 closed defect (fixed)

email2trac bombs when attachment contains umlaut characters

Reported by: karsten.rohrbach@… Owned by: bas
Priority: major Milestone:
Component: email2trac Version: 1.4.5
Keywords: unicode Cc: karsten.rohrbach@…

Description

From bounce message produced by postfix MTA:

TD: saving email to /tmp/tmpKadtCi.email2trac 
TD:   writing body to /tmp/tmpsgE73w.email2trac 
TD: part1: Content-Type:   application/octet-stream Traceback (most recent call last):
   File   "/usr/bin/email2trac", line 2151, in <module>   tktparser.save_email_for_debug(m, True)
   File "/usr/bin/email2trac", line   575, in save_email_for_debug
     self.debug_attachments(message_parts)
   File "/usr/bin/email2trac", line 519, in debug_attachments
     print 'TD:   part%d: filename: %s' % (n, filename) 
UnicodeEncodeError: 'ascii' codec   can't encode character u'\xc4' in position 33: ordinal not in range(128)

The filename causing this behaviour is AUFTRAGSBESTÄTIGUNGS-FORMULAR_115886.PDF, containing a German umlaut.

Deployed Version of email2trac is 1.4.3

Attachments (0)

Change History (10)

comment:1 Changed 11 years ago by bas

Thanks for reporting. Is the debug option enabled in /etc/email2trac.conf? If yes then disabled it and everything should be oke

comment:2 Changed 11 years ago by bas

  • Status changed from new to assigned

comment:3 Changed 11 years ago by karsten.rohrbach@…

/etc/email2trac.conf?

[DEFAULT]
project: /srv/trac/test
debug: 0
...

comment:4 Changed 11 years ago by bas

Is there nothing in the syslog. This function is only called when debug is set or bug in email2trac is triggered. It wil try to save the message and attachments.

comment:5 Changed 11 years ago by bas

(In [376]) Fixed some UnicodeEncodeErrors? when in debug mode, see #206.

comment:6 Changed 11 years ago by karsten.rohrbach@…

Thanks for implementing the quick workaraound.

Now it bombs at a different stage:

TD: saving email to /tmp/tmpne8lNJ.email2trac
 TD:   writing body to /tmp/tmpelQcJd.email2trac
 TD: part1: Content-Type:   application/octet-stream Filename can not be
printed due to non-ascii   characters Filename can not be printed due to
non-ascii characters
   Traceback (most recent call last):
   File "/usr/bin/email2trac", line 2159,
   in <module>
     tktparser.save_email_for_debug(m, True)
   File   "/usr/bin/email2trac", line 583, in save_email_for_debug
   self.debug_attachments(message_parts)
   File "/usr/bin/email2trac", line   542, in debug_attachments
     fx = open(part_file, 'wb')   UnicodeEncodeError: 'ascii' codec can't
encode character u'\xc4' in   position 17: ordinal not in range(128)

Perhaps handling unicode in filenames for the temporary storage of
attachments is the problem?

comment:7 Changed 11 years ago by bas

(In [377]) Fixed some issues with Unicode suport for attachments, see #206

comment:8 Changed 11 years ago by anonymous

  • Version changed from 1.4.3 to trunk

Can you test this for me. I have done some testing and i think that it solves the problem.

comment:9 Changed 11 years ago by bas

  • Resolution set to fixed
  • Status changed from assigned to closed
  • Version changed from trunk to 1.4.5

It is fixed in release 1.4.5

comment:10 Changed 11 years ago by bas

(In [383]) email2trac.py.in:

  • A better fix for attachments with special characters, see #206

Add Comment

Modify Ticket

Change Properties
Action
as closed The owner will remain bas.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.