Changes between Version 20 and Version 21 of MailToTracPlugin


Ignore:
Timestamp:
Apr 21, 2015, 10:25:47 AM (9 years ago)
Author:
figaro
Comment:

Cosmetic changes, tagged with license

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
    66
    77Mail2trac 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
     11The bash script, `mail2tracAdmin` may be called by an [http://en.wikipedia.org/wiki/Mail_transfer_agent MTA], for example [http://www.postfix.org/ postfix].
    1312
    1413It 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.  If `None` is returned, then the message is consumed and execution stops.
    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 equal
    18 
    19 {{{
     14If 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
     16To 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
    2019[notification]
    2120smtp_replyto =
    2221}}}
    2322
    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
     23As 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:
    2724
    2825{{{
     
    3027}}}
    3128
    32 == Use ==
    33 
    34 === Permission ===
    35 mail2trac declare 4 permissions :
     29See also: EmailtoTracScript
     30
     31== Usage
     32
     33=== Permission
     34
     35mail2trac declares 4 permissions:
    3636 * MAIL2TICKET_COMMENT : user authorized to comment,
    3737 * MAIL2TICKET_PROPERTIES : user authorized to change properties (like 'owner', 'cc', etc ...),
     
    3939 * MAIL2TICKET_ADMIN : all the above
    4040
    41 
    4241In order to post ticket :
    43  * the trac address must be correctly configured (Mr Obvious)
     42 * the Trac address must be correctly configured (Mr Obvious)
    4443 * you must have declared your mail address in your user preferences.
    4544 * have the correct permission according what you intend to do.
    4645 * the unix user launching the mail2tracAdmin should have permission on the trac files (even file creation for attachment)
    4746
    48 === mail parsing ===
    49 
    50 An email is parsed by mail2trac as following :
     47=== mail parsing
     48
     49An email is parsed by mail2trac as follows:
    5150
    5251 * Header
     
    5756
    5857 * 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:
    6160     * '''#reassign : user''' , reassign to user
    6261     * '''#resolve : resolution''', The resolution will be set to resolution. Next status will be 'closed'
     
    6867     * '''#wontfix''' is interpreted as '''#resolve:wontfix''',
    6968     * '''#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
     76Any mail attachments will be included as attachment in the ticket.
     77
     78=== Example
     79
     80Creation:
    8581
    8682{{{
     
    109105}}}
    110106
    111 Trac answer :
     107Trac answer:
    112108
    113109{{{
     
    134130}}}
    135131
    136 we send :
     132We send:
    137133
    138134{{{
     
    176172}}}
    177173
    178 
    179 answer :
     174Answer:
    180175
    181176{{{
     
    204199}}}
    205200
    206 
    207 we accept the ticket :
     201We accept the ticket:
    208202
    209203{{{
     
    216210
    217211}}}
    218 (note that end is not mandatory)
    219 
    220 answer :
     212
     213Note that the end end part is not mandatory.
     214
     215Answer:
    221216
    222217{{{
     
    241236}}}
    242237
    243 we close it :
     238We close it:
    244239
    245240{{{
     
    262257}}}
    263258
    264 trac say :
     259Trac says:
    265260
    266261{{{
     
    283278}}}
    284279
    285 
    286 we reopen :
     280We reopen:
     281
    287282{{{
    288283From: Sender <sender@bearstech.com>
     
    295290}}}
    296291
    297 we get :
     292We get:
    298293
    299294{{{
     
    317312}}}
    318313
    319 
    320 
    321 
    322 we close it again
     314We close it again:
    323315
    324316{{{
     
    331323}}}
    332324
    333 and finally this very usefull ticket is closed :
     325And finally this ticket is closed:
    334326
    335327{{{
     
    354346}}}
    355347
    356 
    357 
    358 == Bugs/Feature Requests ==
     348== Bugs/Feature Requests
    359349
    360350Existing bugs and feature requests for MailToTracPlugin are
     
    364354[http://trac-hacks.org/newticket?component=MailToTracPlugin&owner=zitune new ticket].
    365355
    366 == Download ==
     356[[TicketQuery(component=MailToTracPlugin&group=type,format=progress)]]
     357
     358== Download
    367359
    368360Download the zipped source from [download:mailtotracplugin here].
    369361
    370 == Source ==
     362== Source
    371363
    372364You can check out MailToTracPlugin from [http://trac-hacks.org/svn/mailtotracplugin/0.12 here] using Subversion, or [source:mailtotracplugin browse the source] with Trac.
    373365
    374 
    375 == Recent Changes ==
     366== Recent Changes
    376367
    377368[[ChangeLog(mailtotracplugin, 3)]]
    378369
    379 == Author/Contributors ==
     370== Author/Contributors
    380371
    381372'''Author:''' [wiki:zitune] ( was [wiki:k0s] the initial author (thanks a lot)) [[BR]]
     373'''Maintainer''': [[Maintainer]] [[BR]]
    382374'''Contributors:''' [[BR]]