Changes between Version 2 and Version 3 of TracNotification


Ignore:
Timestamp:
Apr 16, 2016, 7:07:21 PM (8 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracNotification

    v2 v3  
    1 = Email Notification of Ticket Changes =
     1= Email Notification of Ticket Changes
    22[[TracGuideToc]]
    33
     
    88Disabled by default, notification can be activated and configured in [wiki:TracIni trac.ini].
    99
    10 == Receiving Notification Mails ==
     10== Receiving Notification Mails
     11
    1112When reporting a new ticket or adding a comment, enter a valid email address or your Trac username in the ''reporter'', ''assigned to/owner'' or ''cc'' field. Trac will automatically send you an email when changes are made to the ticket, depending on how notification is configured.
    1213
    13 === How to use your username to receive notification mails ===
     14=== How to use your username to receive notification mails
    1415
    1516To receive notification mails, you can either enter a full email address or your Trac username. To get notified with a simple username or login, you need to specify a valid email address in the ''Preferences'' page.
     
    2728}}}
    2829
    29 == Configuring SMTP Notification ==
     30== Configuring SMTP Notification
    3031
    3132'''Important:''' For TracNotification to work correctly, the `[trac] base_url` option must be set in [wiki:TracIni trac.ini].
    3233
    33 === Configuration Options ===
    34 These are the available options for the `[notification]` section in trac.ini:
     34=== Configuration Options
     35
     36These are the available options for the `[notification]` section in `trac.ini`:
    3537
    3638[[TracIni(notification)]]
    3739
    38 === Example Configuration (SMTP) ===
    39 {{{
     40=== Example Configuration (SMTP)
     41
     42{{{#!ini
    4043[notification]
    4144smtp_enabled = true
     
    4649}}}
    4750
    48 === Example Configuration (`sendmail`) ===
    49 {{{
     51=== Example Configuration (`sendmail`)
     52
     53{{{#!ini
    5054[notification]
    5155smtp_enabled = true
     
    5761}}}
    5862
    59 === Customizing the e-mail subject ===
     63=== Customizing the e-mail subject
     64
    6065The e-mail subject can be customized with the `ticket_subject_template` option, which contains a [http://genshi.edgewall.org/wiki/Documentation/text-templates.html Genshi text template] snippet. The default value is:
    6166{{{
    6267$prefix #$ticket.id: $summary
    6368}}}
     69
    6470The following variables are available in the template:
    6571
     
    6975 * `ticket`: The ticket model object (see [trac:source:/trunk/trac/ticket/model.py model.py]). Individual ticket fields can be addressed by appending the field name separated by a dot, eg `$ticket.milestone`.
    7076
    71 === Customizing the e-mail content ===
     77=== Customizing the e-mail content
    7278
    7379The notification e-mail content is generated based on `ticket_notify_email.txt` in `trac/ticket/templates`. You can add your own version of this template by adding a `ticket_notify_email.txt` to the templates directory of your environment. The default looks like this:
     
    108114}}}
    109115
    110 == Sample Email ==
     116== Sample Email
     117
    111118{{{
    112119#42: testing
     
    134141}}}
    135142
    136 == Customizing e-mail content for MS Outlook ==
     143== Customizing e-mail content for MS Outlook
    137144
    138145MS Outlook normally presents plain text e-mails with a variable-width font, and as a result the ticket properties table will most certainly look like a mess in MS Outlook. This can be fixed with some customization of the [#Customizingthee-mailcontent e-mail template].
     
    200207However, the solution is still a workaround to an automatically HTML-formatted e-mail.
    201208
    202 == Using GMail as the SMTP relay host ==
     209== Using GMail as the SMTP relay host
    203210
    204211Use the following configuration snippet:
    205 {{{
     212{{{#!ini
    206213[notification]
    207214smtp_enabled = true
     
    219226You should not use `smtp_port = 465`. Doing so may deadlock your ticket submission. Port 465 is reserved for the SMTPS protocol, which is not supported by Trac. See [trac:comment:2:ticket:7107 #7107] for details.
    220227 
    221 == Filtering notifications for one's own changes and comments ==
    222 In Gmail, use the filter:
     228== Filtering notifications for one's own changes and comments
     229
     230To delete these notifications in Gmail, use the following filter:
    223231{{{
    224232from:(<smtp_from>) (("Reporter: <username>" -Changes -Comment) OR "Changes (by <username>)" OR "Comment (by <username>)")
    225233}}}
    226 
    227 to delete these notifications.
    228234
    229235In Thunderbird, there is no such solution if you use IMAP, see http://kb.mozillazine.org/Filters_(Thunderbird)#Filtering_the_message_body.
     
    232238http://trac-hacks.org/wiki/NeverNotifyUpdaterPlugin, or vote for [trac:#2247] to be fixed.
    233239
    234 == Troubleshooting ==
     240== Troubleshooting
    235241
    236242If you cannot get the notification working, first make sure the log is activated and have a look at the log to find if an error message has been logged. See TracLogging for help about the log feature.
     
    238244Notification errors are not reported through the web interface, so the user who submits a change or a new ticket never gets notified about a notification failure. The Trac administrator needs to look at the log to find the error trace.
    239245
    240 === ''Permission denied'' error ===
     246=== ''Permission denied'' error
    241247
    242248Typical error message:
     
    251257
    252258Many users get confused when their manual attempts to contact the SMTP server succeed:
    253 {{{
     259{{{#!sh
    254260telnet localhost 25
    255261}}}
     262
    256263This is because a regular user may connect to the SMTP server, but the web server cannot:
    257 {{{
     264{{{#!sh
    258265sudo -u www-data telnet localhost 25
    259266}}}
     
    261268In such a case, you need to configure your server so that the web server is authorized to post to the SMTP server. The actual settings depend on your Linux distribution and current security policy. You may find help in the Trac [trac:MailingList MailingList] archive.
    262269
    263 Relevant ML threads:
    264  * SELinux: http://article.gmane.org/gmane.comp.version-control.subversion.trac.general/7518
     270Relevant mailing list thread on SELinux: http://article.gmane.org/gmane.comp.version-control.subversion.trac.general/7518
    265271
    266272For SELinux in Fedora 10:
    267 {{{
    268 $ setsebool -P httpd_can_sendmail 1
    269 }}}
    270 
    271 === ''Suspected spam'' error ===
     273{{{#!sh
     274setsebool -P httpd_can_sendmail 1
     275}}}
     276
     277=== ''Suspected spam'' error
    272278
    273279Some SMTP servers may reject the notification email sent by Trac.