Changes between Version 20 and Version 21 of MailToTracPlugin
- Timestamp:
- Apr 21, 2015, 10:25:47 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
MailToTracPlugin
v20 v21 1 = Pluggable email handler for Trac = 2 3 [[PageOutline]] 4 5 == Description ==1 [[PageOutline(2-5,Contents,pullout)]] 2 3 = Pluggable email handler for Trac 4 5 == Description 6 6 7 7 Mail2trac provides : 8 * a trac-admin command, a bash script (mail2tracAdmin) calling trac-admin 9 * an extension point that allows email messages to be handled by Trac plugins (other than mail2trac). 10 11 12 The bash script, `mail2tracAdmin` may be called by an [http://en.wikipedia.org/wiki/Mail_transfer_agent MTA] (e.g. [http://www.postfix.org/ postfix]). 8 * a Trac-admin command, a bash script (mail2tracAdmin) calling trac-admin 9 * an extension point that allows email messages to be handled by Trac plugins other than mail2trac. 10 11 The bash script, `mail2tracAdmin` may be called by an [http://en.wikipedia.org/wiki/Mail_transfer_agent MTA], for example [http://www.postfix.org/ postfix]. 13 12 14 13 It will open a Trac environment and run through each enabled [source:mailtotracplugin/0.12/plugin/mail2trac/interface.py IEmailHandler] and executes its `invoke()` method if its `match()` method returns `True`. 15 If invoke returns an [http://docs.python.org/library/email email] message, then subsequent `IEmailHandler`s will also process the message. 16 17 To enable the plugin for `postfix`, add an appropriate line to the aliases file (usually `/etc/aliases` or `/etc/postfix/aliases` and then refreshing the aliases database (see [http://www.postfix.org/aliases.5.html man aliases]). The `mail2tracAdmin` script takes as argument the path to the project environment. The incoming email address should equal18 19 {{{ 14 If invoke returns an [http://docs.python.org/library/email email] message, then subsequent `IEmailHandler`s will also process the message. If `None` is returned, then the message is consumed and execution stops. 15 16 To enable the plugin for `postfix`, add an appropriate line to the aliases file (usually `/etc/aliases` or `/etc/postfix/aliases` and then refreshing the aliases database (see [http://www.postfix.org/aliases.5.html man aliases]). The `mail2tracAdmin` script takes as argument the path to the project environment. The incoming email address should be specified in the `trac.ini` file: 17 18 {{{#!ini 20 19 [notification] 21 20 smtp_replyto = 22 21 }}} 23 22 24 in the [http://trac.edgewall.org/wiki/TracIni trac.ini] file. 25 26 As an example, if `smtp_replyto` is set to `foo@example.com` and the project is in `/var/trac/bar`, the `aliases` file on `example.com` should have a line like 23 As an example, if `smtp_replyto` is set to `foo@example.com` and the project is in `/var/trac/bar`, the `aliases` file on `example.com` should have a line as follows: 27 24 28 25 {{{ … … 30 27 }}} 31 28 32 == Use == 33 34 === Permission === 35 mail2trac declare 4 permissions : 29 See also: EmailtoTracScript 30 31 == Usage 32 33 === Permission 34 35 mail2trac declares 4 permissions: 36 36 * MAIL2TICKET_COMMENT : user authorized to comment, 37 37 * MAIL2TICKET_PROPERTIES : user authorized to change properties (like 'owner', 'cc', etc ...), … … 39 39 * MAIL2TICKET_ADMIN : all the above 40 40 41 42 41 In order to post ticket : 43 * the trac address must be correctly configured (Mr Obvious)42 * the Trac address must be correctly configured (Mr Obvious) 44 43 * you must have declared your mail address in your user preferences. 45 44 * have the correct permission according what you intend to do. 46 45 * the unix user launching the mail2tracAdmin should have permission on the trac files (even file creation for attachment) 47 46 48 === mail parsing ===49 50 An email is parsed by mail2trac as follow ing:47 === mail parsing 48 49 An email is parsed by mail2trac as follows: 51 50 52 51 * Header … … 57 56 58 57 * Body : 59 * any line begining with '''#field''' with field one of these : ''type'', ''priority'', ''milestone'', ''component'', ''version'', ''resolution'', ''keywords'', ''cc'', will be treated as request to change the 'field' property (work only with the MAIL2TICKET_PROPERTIES permission)60 * mail2trac understand classic actions : resolve, reassign, accept and reopen (as in the classical web UI):58 * any line begining with '''#field''' with field one of these: ''type'', ''priority'', ''milestone'', ''component'', ''version'', ''resolution'', ''keywords'', ''cc'', will be treated as request to change the 'field' property; works only with the `MAIL2TICKET_PROPERTIES` permission. 59 * mail2trac understand classic actions : resolve, reassign, accept and reopen, as in the classical web UI: 61 60 * '''#reassign : user''' , reassign to user 62 61 * '''#resolve : resolution''', The resolution will be set to resolution. Next status will be 'closed' … … 68 67 * '''#wontfix''' is interpreted as '''#resolve:wontfix''', 69 68 * '''#invalid''' is interpreted as '''#resolve:invalid''', 70 * parsing will stop at the '''#end''' tag (meaning everything after #end will be ignore by mail2trac) 71 * any '''#field''' or '''#end''' will be ignore, and what's left is the ticket's description if you create, or the comment if you comment. 72 73 74 '''Rq''' : at the creation, you can assign a ticket by setting its owner with '''#owner : jdoe ''' (in a response you have to use the action '''#reassign'' ) 75 76 === Attachments === 77 78 Any mail's attachments will be include as attachement in the ticket. 79 80 === An example === 81 82 83 84 Creation : 69 * parsing will stop at the '''#end''' tag, meaning everything after #end will be ignored by mail2trac 70 * any '''#field''' or '''#end''' will be ignored, and what's left is the ticket's description if you create, or the comment if you comment. 71 72 '''Rq''' : at the creation, you can assign a ticket by setting its owner with '''#owner : jdoe '''. In a response you have to use the action '''#reassign'''. 73 74 === Attachments 75 76 Any mail attachments will be included as attachment in the ticket. 77 78 === Example 79 80 Creation: 85 81 86 82 {{{ … … 109 105 }}} 110 106 111 Trac answer 107 Trac answer: 112 108 113 109 {{{ … … 134 130 }}} 135 131 136 we send:132 We send: 137 133 138 134 {{{ … … 176 172 }}} 177 173 178 179 answer : 174 Answer: 180 175 181 176 {{{ … … 204 199 }}} 205 200 206 207 we accept the ticket : 201 We accept the ticket: 208 202 209 203 {{{ … … 216 210 217 211 }}} 218 (note that end is not mandatory) 219 220 answer : 212 213 Note that the end end part is not mandatory. 214 215 Answer: 221 216 222 217 {{{ … … 241 236 }}} 242 237 243 we close it:238 We close it: 244 239 245 240 {{{ … … 262 257 }}} 263 258 264 trac say : 259 Trac says: 265 260 266 261 {{{ … … 283 278 }}} 284 279 285 286 we reopen : 280 We reopen: 281 287 282 {{{ 288 283 From: Sender <sender@bearstech.com> … … 295 290 }}} 296 291 297 we get : 292 We get: 298 293 299 294 {{{ … … 317 312 }}} 318 313 319 320 321 322 we close it again 314 We close it again: 323 315 324 316 {{{ … … 331 323 }}} 332 324 333 and finally this very usefull ticket is closed : 325 And finally this ticket is closed: 334 326 335 327 {{{ … … 354 346 }}} 355 347 356 357 358 == Bugs/Feature Requests == 348 == Bugs/Feature Requests 359 349 360 350 Existing bugs and feature requests for MailToTracPlugin are … … 364 354 [http://trac-hacks.org/newticket?component=MailToTracPlugin&owner=zitune new ticket]. 365 355 366 == Download == 356 [[TicketQuery(component=MailToTracPlugin&group=type,format=progress)]] 357 358 == Download 367 359 368 360 Download the zipped source from [download:mailtotracplugin here]. 369 361 370 == Source ==362 == Source 371 363 372 364 You can check out MailToTracPlugin from [http://trac-hacks.org/svn/mailtotracplugin/0.12 here] using Subversion, or [source:mailtotracplugin browse the source] with Trac. 373 365 374 375 == Recent Changes == 366 == Recent Changes 376 367 377 368 [[ChangeLog(mailtotracplugin, 3)]] 378 369 379 == Author/Contributors ==370 == Author/Contributors 380 371 381 372 '''Author:''' [wiki:zitune] ( was [wiki:k0s] the initial author (thanks a lot)) [[BR]] 373 '''Maintainer''': [[Maintainer]] [[BR]] 382 374 '''Contributors:''' [[BR]]