Ticket #2397 (closed enhancement: wontfix)
Better Crontib'd Bi-Directional E-Mail Integration
| Reported by: | Demitrious S. Kelly <dkelly@…> | Owned by: | jonas |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | ticket system | Version: | 0.9 |
| Severity: | normal | Keywords: | e-mail email gateway smtp ticket |
| Cc: | dkelly@… |
Description
It would be great if trac had better e-mail integration. For example simply being able to take a reply to an e-mail notification and add it as a comment to an existing ticket would allow for much easier general use, as well as allow a private installation of trac to function as a support gateway. I'll attach my v1.0 code for this.
Attachments
Change History
Changed 5 years ago by Demitrious S. Kelly <dkelly@…>
- attachment Trac-Egw.py added
comment:2 Changed 4 years ago by colin@…
- Type changed from enhancement to defect
This really needs a configuration usecase documented, otherwise it's of little use to others. As an example, getting this to function correctly in the standard chrooted environment of Postfix is quite academic, and impossible to debug as mail logs do not allow for a large traceback and the problems cannot be reproduced outside of this environment (it works for everything *other* than a piped email integration).
Apr 8 03:24:31 jupiter postfix/local[6418]: 2E54E450E: to=<tracit@jupiter.netlink.za.net>, relay=local, delay=0, status=bounced (Command died with status 1: "/usr/local/bin/Trac-Egw.py". Command output: Traceback (most recent call last): File "/usr/local/bin/Trac-Egw.py", line 69, in ? tktparser.parse(msg) File "/usr/local/bin/Trac-Egw.py", line 21, in parse tkt = Ticket(self.env) File "/usr/lib/python2.3/site-packages/trac/ticket/model.py", line 35, in __init__ self.fields = TicketSystem(self.env).get_ticket_fields() File "/usr/lib/python2.3/site-packages/trac/ticket/api.py", line 49, in get_ticket_fields db = self.env.get_db_cnx() File "/usr/lib/python2.3/site-packages/trac/env.py", line 144, in get_db_cnx return DatabaseManager(self).get_connection() File "/usr/lib/python2.3/site-packages/trac/db/api.py", line 59, in get_connection return self._cnx_pool.get_cnx() File "/usr/lib/python2.3/site-packages/trac/db/pool.py", line 75, in get_cnx
comment:4 Changed 4 years ago by colin@…
My bad this does work, and well too. The only problem is that the trac instance must be world readable, and the database world writable, as Postfix delivers as the user of the local address - which is a touch worrying.
comment:5 Changed 4 years ago by ff-trac@…
Nobody should use this script, there is an sql injection problem wrt the use of the From value in a simple format.
You need to be using placeholders in stead, see this page for some examples of how track does it: http://www.initd.org/tracker/psycopg/browser/psycopg2/trunk/doc/extensions.rst?rev=729



Improved functionality: piped input email-to-ticket gateway