Modify

Opened 11 years ago

Last modified 11 years ago

#328 assigned defect

Better handling of invalid inline properties

Reported by: anonymous Owned by: bas
Priority: major Milestone:
Component: email2trac Version: 2.7.0
Keywords: Cc:

Description

We have a few cases where the text in the body of the message matches an inline property request and email2trac exits with a non-zero exit status and the MTA bounces the email with the most unhelpful message:

<trac@trac>: Command died with status 1:
"/usr/bin/run_email2trac". Command output: saving email to
/tmp/tmpa6SfOO.email2trac writing body to /tmp/tmpbJnIAS.email2trac

If you look in the logs, you can see the python traceback from the unhandled exception:

Emailtrac: ProgrammingError:
column "dev02" of relation "ticket" does not exist
LINE 1: UPDATE ticket SET dev02='~$' WHERE id=2161

This was generated by the line:

@dev02:~$ time curl -s -

which was meant to explain the shell command being run but inadvertently attempts to set the (non-existent) dev property to '~$'.

I can think of a few ways to handle this:

1) restrict where the properties setting syntax is valid. E.G.

a few ticketing systems allow the property setting only in first set of lines of the email. As soon as a blank line is encountered, scanning for property setting is turned off. The inline_properties setting could take the values: "on", "off", "top" .... Where top means only the first blank space separated paragraph would have property parsing enabled.

2) return a better error message from the interface. IIRC

anything emitted by the delivery program to stdout will be returned in the bounce message. So catching the error and generating output like:

      line #13 of your message:

         @dev:~$ ....
      attempted to set the property dev and failed. If you
      didn't mean to set a property indent the
      line or use a character other than @ to start the line.

from email2trac (assuming an indented line can not set a property) would be most helpful.

Attachments (0)

Change History (2)

comment:1 Changed 11 years ago by rouilj-trac@…

Oops forgot to add myself as the author.

comment:2 Changed 11 years ago by bas

  • Status changed from new to assigned
  • Type changed from enhancement to defect

Add Comment

Modify Ticket

Change Properties
Action
as assigned The owner will remain bas.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from bas to the specified user. Next status will be 'new'.
Author


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

 
Note: See TracTickets for help on using tickets.