Ignore:
Timestamp:
05/22/06 15:23:24 (18 years ago)
Author:
bas
Message:

EmailtoTracScript?:

email2trac.py.in:

  • Added options for mailto_cc and ticket_update
  • Ticket updates are now working

INSTALL:

  • Adjusted the docs for new options
File:
1 edited

Legend:

Unmodified
Added
Removed
  • emailtotracscript/trunk/email2trac.py.in

    r73 r74  
    4747----------
    4848 * Create an config file:
    49         [DEFAULT]                        # REQUIRED
    50         project      : /data/trac/test   # REQUIRED
    51         debug        : 1                 # OPTIONAL, if set print some DEBUG info
    52         spam_level   : 4                 # OPTIONAL, if set check for SPAM mail
    53         reply_address: 1                 # OPTIONAL, if set then fill in ticket CC field
    54     umask        : 022               # OPTIONAL, if set then use this umask for creation of the attachments
    55         mailto_link  : 1                 # OPTIONAL, if set then [mailto:<CC>] in description
    56         trac_version : 0.8               # OPTIONAL, default is 0.9
     49        [DEFAULT]                      # REQUIRED
     50        project      : /data/trac/test # REQUIRED
     51        debug        : 1               # OPTIONAL, if set print some DEBUG info
     52        spam_level   : 4               # OPTIONAL, if set check for SPAM mail
     53        reply_address: 1               # OPTIONAL, if set then fill in ticket CC field
     54    umask        : 022             # OPTIONAL, if set then use this umask for creation of the attachments
     55        mailto_link  : 1               # OPTIONAL, if set then [mailto:<>] in description
     56        mailto_cc    : basv@sara.nl    # OPTIONAL, Use this address as CC in mailto line
     57        ticket_update: 1               # OPTIONAL, if set then check if this is an update for a ticket
     58        trac_version : 0.8             # OPTIONAL, default is 0.9
    5759
    5860        [jouvin]                         # OPTIONAL project declaration, if set both fields necessary
     
    8284import unicodedata
    8385import ConfigParser
     86import sqlite
    8487from email import Header
    8588from stat import *
     
    121124                if parameters.has_key('mailto_link'):
    122125                        self.MAILTO = int(parameters['mailto_link'])
     126                        if parameters.has_key('mailto_cc'):
     127                                self.MAILTO_CC = parameters['mailto_cc']
     128                        else:
     129                                self.MAILTO_CC = ''
    123130                else:
    124131                        self.MAILTO = 0
     
    146153                else:
    147154                        self.REPLY_ALL = 0
     155
     156                if parameters.has_key('ticket_update'):
     157                        self.TICKET_UPDATE = int(parameters['ticket_update'])
     158                else:
     159                        self.TICKET_UPDATE = 0
    148160
    149161
     
    355367                        self.notification = 0
    356368
    357                 # Is this a previous ticket
    358                 #
    359                 if self.ticket_update(msg):
    360                         return True
     369                # Must we update existing tickets
     370                #
     371                if self.TICKET_UPDATE > 0:
     372                        if self.ticket_update(msg):
     373                                return True
    361374               
    362375                tkt = Ticket(self.env)
     
    498511
    499512                # Temporary fix
    500                 str = 'mailto:%s?subject=%s' %(urllib.quote(self.email_addr), urllib.quote('Re: #%s: %s' %(id, subject)))
     513                str = 'mailto:%s?Subject=%s&Cc=%s' %(
     514                       urllib.quote(self.email_addr),
     515                           urllib.quote('Re: #%s: %s' %(id, subject)),
     516                           urllib.quote(self.MAILTO_CC)
     517                           )
     518
    501519                str = '\n{{{\n#!html\n<a href="%s">Reply to: %s</a>\n}}}\n' %(str, author)
    502520
     
    682700                from trac.Href import Href
    683701                from trac import util
    684                 import sqlite
    685702        elif version == 0.9:
    686703                from trac import attachment
Note: See TracChangeset for help on using the changeset viewer.