Changes between Version 4 and Version 5 of TracNotification
- Timestamp:
- Apr 13, 2010, 3:53:03 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracNotification
v4 v5 2 2 [[TracGuideToc]] 3 3 4 Trac supports notification ofticket changes via email.4 Trac supports notification about ticket changes via email. 5 5 6 6 Email notification is useful to keep users up-to-date on tickets/issues of interest, and also provides a convenient way to post all ticket changes to a dedicated mailing list. For example, this is how the [http://lists.edgewall.com/archive/trac-tickets/ Trac-tickets] mailing list is set up. … … 9 9 10 10 == Receiving Notification Mails == 11 When reporting a new ticket or adding a comment, enter a valid email address or your usernamein 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).11 When reporting a new ticket or adding a comment, enter a valid email address 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). 12 12 13 13 This is useful to keep up-to-date on an issue or enhancement request that interests you. 14 14 15 === How to use your username to receive notification mails ===16 17 To receive notification mails, you can either enter a full email address or your username. To get notified with a simple username or login, you need to specify a valid email address in the ''Preferences'' page.18 19 Alternatively, a default domain name ('''`smtp_default_domain`''') can be set in the TracIni file (see [#ConfigurationOptions Configuration Options] below). In this case, the default domain will be appended to the username, which can be useful for an "Intranet" kind of installation.20 21 15 == Configuring SMTP Notification == 22 23 '''Important:''' For TracNotification to work correctly, the `[trac] base_url` option must be set in [wiki:TracIni trac.ini].24 16 25 17 === Configuration Options === … … 44 36 * `none`: no encoding. Use with plain english only (ASCII). E-mails with non-ASCII chars won't be delivered. 45 37 * '''`ticket_subject_template`''': (''since 0.11'') A [http://genshi.edgewall.org/wiki/Documentation/text-templates.html Genshi text template] snippet used to get the notification subject. 46 * '''`email_sender`''': (''since 0.12'') Name of the component implementing `IEmailSender`. This component is used by the notification system to send emails. Trac currently provides the following components:47 * `SmtpEmailSender`: connects to an SMTP server (default).48 * `SendmailEmailSender`: runs a `sendmail`-compatible executable.49 38 50 39 Either '''`smtp_from`''' or '''`smtp_replyto`''' (or both) ''must'' be set, otherwise Trac refuses to send notification mails. … … 57 46 * '''`use_tls`''': (''since 0.10'') Toggle to send notifications via a SMTP server using [http://en.wikipedia.org/wiki/Transport_Layer_Security TLS], such as GMail. 58 47 59 The following option is specific to email delivery through a `sendmail`-compatible executable.60 * '''`sendmail_path`''': (''since 0.12'') Path to the sendmail executable. The sendmail program must accept the `-i` and `-f` options.61 48 62 49 === Example Configuration (SMTP) === … … 70 57 }}} 71 58 72 === Example Configuration (`sendmail`) ===73 {{{74 [notification]75 smtp_enabled = true76 email_sender = SendmailEmailSender77 sendmail_path = /usr/sbin/sendmail78 smtp_from = notifier@example.com79 smtp_replyto = myproj@projects.example.com80 smtp_always_cc = ticketmaster@example.com, theboss+myproj@example.com81 }}}82 59 83 60 === Customizing the e-mail subject === … … 93 70 * `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, e.g. `$ticket.milestone`. 94 71 95 === Customizing the e-mail content ===96 97 The 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:98 99 {{{100 $ticket_body_hdr101 $ticket_props102 #choose ticket.new103 #when True104 $ticket.description105 #end106 #otherwise107 #if changes_body108 Changes (by $change.author):109 110 $changes_body111 #end112 #if changes_descr113 #if not changes_body and not change.comment and change.author114 Description changed by $change.author:115 #end116 $changes_descr117 --118 #end119 #if change.comment120 121 Comment${not changes_body and '(by %s)' % change.author or ''}:122 123 $change.comment124 #end125 #end126 #end127 128 --129 Ticket URL: <$ticket.link>130 $project.name <${project.url or abs_href()}>131 $project.descr132 }}}133 72 == Sample Email == 134 73 {{{ … … 183 122 }}} 184 123 185 For Trac .10, use the filter:186 {{{187 from:(<smtp_from>) (("Reporter: <username>" -Changes -Comment) OR "Changes (by <username>)" OR "Comment (by <username>)")188 }}}189 190 124 to delete these notifications. 191 125 … … 230 164 Relevant ML threads: 231 165 * SELinux: http://article.gmane.org/gmane.comp.version-control.subversion.trac.general/7518 232 233 For SELinux in Fedora 10: 234 {{{ 235 $ setsebool -P httpd_can_sendmail 1 236 }}} 166 237 167 === ''Suspected spam'' error === 238 168 … … 243 173 Quoted printable encoding works better with languages that use one of the Latin charsets. For Asian charsets, it is recommended to stick with the Base64 encoding. 244 174 245 === ''501, 5.5.4 Invalid Address'' error ===246 247 On IIS 6.0 you could get a248 {{{249 Failure sending notification on change to ticket #1: SMTPHeloError: (501, '5.5.4 Invalid Address')250 }}}251 in the trac log. Have a look [http://support.microsoft.com/kb/291828 here] for instructions on resolving it.252 253 254 175 ---- 255 176 See also: TracTickets, TracIni, TracGuide