CINXE.COM

TracNotification – The Trac Project

<!DOCTYPE html> <html lang="en-US"> <head> <!-- # block head (placeholder in theme.html) --> <!-- # block head (content inherited from layout.html) --> <title> TracNotification – The Trac Project </title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <!--[if IE]><script> if (/^#__msie303:/.test(window.location.hash)) window.location.replace(window.location.hash.replace(/^#__msie303:/, '#')); </script><![endif]--> <link rel="search" href="/search" /> <link rel="help" href="/wiki/TracGuide" /> <link rel="alternate" href="/wiki/TracNotification?format=txt" title="Plain Text" type="text/x-trac-wiki" /> <link rel="start" href="/wiki" /> <link rel="stylesheet" href="/chrome/common/css/trac.css" type="text/css" /> <link rel="stylesheet" href="/chrome/common/css/wiki.css" type="text/css" /> <link rel="stylesheet" href="/chrome/wikiextras/css/phrases.css" type="text/css" /> <link rel="stylesheet" href="/chrome/wikiextras/css/boxes.css" type="text/css" /> <link rel="stylesheet" href="/wikiextras/dynamicboxes.css" type="text/css" /> <link rel="stylesheet" href="/chrome/vote/css/tracvote.css" type="text/css" /> <link rel="icon" href="/favicon.ico" type="image/x-icon" /> <noscript> <style> .trac-noscript { display: none !important } </style> </noscript> <link type="application/opensearchdescription+xml" rel="search" href="/search/opensearch" title="Search The Trac Project"/> <script src="/chrome/common/js/jquery.js"></script> <script src="/chrome/common/js/babel.js"></script> <script src="/chrome/common/js/trac.js"></script> <script src="/chrome/common/js/search.js"></script> <script src="/chrome/common/js/folding.js"></script> <script src="/chrome/common/js/wiki.js"></script> <script> jQuery(function($) { $(".trac-autofocus").focus(); $(".trac-target-new").attr("target", "_blank"); if ($.ui) { /* is jquery-ui added? */ $(".trac-datepicker:not([readonly])") .prop("autocomplete", "off").datepicker(); // Input current date when today is pressed. var _goToToday = $.datepicker._gotoToday; $.datepicker._gotoToday = function(id) { _goToToday.call(this, id); this._selectDate(id) }; $(".trac-datetimepicker:not([readonly])") .prop("autocomplete", "off").datetimepicker(); $("#main").addClass("trac-nodatetimehint"); } $(".trac-disable").disableSubmit(".trac-disable-determinant"); setTimeout(function() { $(".trac-scroll").scrollToTop() }, 1); $(".trac-disable-on-submit").disableOnSubmit(); }); </script> <!-- # include 'site_head.html' (layout.html) --> <link rel="stylesheet" type="text/css" href="//www.edgewall.org/css/projects013.css" /> <script type="text/javascript"><!-- window.cookieconsent_options = {"message":"This website uses cookies to ensure you get the best experience on our website","dismiss":"Got it!","learnMore":"More info","link":null,"theme":"dark-bottom", "domain": "edgewall.org"}; //--></script> <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/1.0.9/cookieconsent.min.js"></script> <script type="text/javascript"> jQuery(function($) { var $ntg = $("#newticketguide"); if ($ntg.length) $("#propertyform").prepend($ntg.detach()); }); </script> <!-- end of site_head.html --> <!-- # endblock head (content inherited from layout.html) --> <link rel="alternate" type="application/x-wiki" href="/wiki/TracNotification?action=edit&amp;version=" title="Edit this page"/> <script> jQuery(function($) { wikiColumn($("#wikipage")); }); </script> <!-- # endblock head (placeholder in theme.html) --> </head> <body> <!-- # block body (content inherited from theme.html) --> <!-- # include 'site_header.html' (theme.html) --> <!-- site_header_trac.html --> <div id="wrapper"> <div id="topbar"> <a id="home-link" href="//www.edgewall.org/">Edgewall Software</a> </div> <div id="ew-header"> <div id="topnav"><ul> <li><a href="//www.edgewall.org/">Home</a></li> <li class="active"> <a class="trac" href="//trac.edgewall.org/">Trac</a> </li> <li> <a href="//trac-hacks.org/">Trac Hacks</a> </li> <li class=""> <a class="genshi" href="//genshi.edgewall.org/">Genshi</a> </li> <li class=""> <a class="babel" href="//babel.edgewall.org/">Babel</a> </li> <li class=""> <a class="bitten" href="//bitten.edgewall.org/">Bitten</a> </li></ul> </div> </div> <div id="ew-main"> <div id="ew-content"> <div> <script src="//www.google-analytics.com/urchin.js" type="text/javascript"></script> <script type="text/javascript">_uacct = "UA-598265-1";urchinTracker();</script> <div id="left"> <div class="block"> <ul> <li><a href="/">Home</a></li> <li><a href="/wiki/TracDownload">Download</a></li> <li><a href="/wiki/TracGuide">Documentation</a></li> <li><a href="/wiki/MailingList">Mailing Lists</a></li> <li><a href="/wiki/TracLicense">License</a></li> <li><a href="/wiki/TracFaq">FAQ</a></li> </ul> </div> </div> </div><!-- /site_header_trac.html --> <!-- end of site_header.html --> <div id="banner"> <div id="header"> <a id="logo" href="//trac.edgewall.org/"> <img alt="Trac" height="73" src="//www.edgewall.org/gfx/trac_logo.png" width="236" /></a> </div> <form id="search" action="/search" method="get"> <div> <label for="proj-search">Search:</label> <input type="text" id="proj-search" name="q" size="18" value="" /> <input type="submit" value="Search" /> </div> </form> <div id="metanav" class="nav"> <ul><li class="first"><a href="/login">Login</a></li><li ><a href="/prefs">Preferences</a></li><li ><a href="/wiki/TracGuide">Help/Guide</a></li><li class="last"><a href="/about">About Trac</a></li></ul> </div> </div> <div id="mainnav" class="nav"> <ul><li class="active first"><a href="/wiki">Wiki</a></li><li ><a href="/timeline">Timeline</a></li><li ><a href="/roadmap">Roadmap</a></li><li ><a href="/browser">Browse Source</a></li><li ><a href="/report">View Tickets</a></li><li ><a href="/wiki/NewTicket">New Ticket</a></li><li class="last"><a href="/search">Search</a></li></ul> </div> <div id="main" > <div id="pagepath" class="noprint"> <a class="pathentry first" title="View WikiStart" href="/wiki">wiki:</a><a href="/wiki/TracNotification" title="View TracNotification" class="pathentry">TracNotification</a></div> <div id="ctxtnav" class="nav"> <h2>Context Navigation</h2> <ul> <li class="first"><span id="vote" title="Vote count (+1, -1)"><img alt="Up-vote" src="/chrome/vote/aupgray.png" /><span id="votes">+0</span><img alt="Down-vote" src="/chrome/vote/adownmod.png" /></span></li> <li ><a href="/wiki/WikiStart">Start Page</a></li> <li ><a href="/wiki/TitleIndex">Index</a></li> <li class="last"><a href="/wiki/TracNotification?action=history">History</a></li> </ul> <hr /> </div> <!-- # block content (placeholder in theme.html) --> <div id="content" class="wiki narrow"> <div class="wikipage searchable"> <div id="wikipage" class="trac-content borderless"><div class="wikiextras box shadow icon information yellow"><p> This page documents the 1.4 (latest stable) release. Documentation for other releases can be found <a class="wiki" href="/wiki/TitleIndex#TracGuide:BackupandTranslations">here</a>. </p> </div><h1 class="section" id="EmailNotificationofTicketChanges">Email Notification of Ticket Changes</h1> <p> </p><div class="wiki-toc"><h4>Table of Contents</h4><ul><li class="False"><a class="False" href="/wiki/TracGuide">Index</a></li><li class="False"><a class="False" href="/wiki/TracInstall">Installation</a></li><li class="False"><a class="False" href="/wiki/TracInterfaceCustomization">Customization</a></li><li class="False"><a class="False" href="/wiki/TracPlugins">Plugins</a></li><li class="False"><a class="False" href="/wiki/TracUpgrade">Upgrading</a></li><li class="False"><a class="False" href="/wiki/TracIni">Configuration</a></li><li class="False"><a class="False" href="/wiki/TracAdmin">Administration</a></li><li class="False"><a class="False" href="/wiki/TracBackup">Backup</a></li><li class="False"><a class="False" href="/wiki/TracLogging">Logging</a></li><li class="False"><a class="False" href="/wiki/TracPermissions">Permissions</a></li><li class="False"><a class="False" href="/wiki/TracWiki">The Wiki</a></li><li class="False"><a class="False" href="/wiki/WikiFormatting">Wiki Formatting</a></li><li class="False"><a class="False" href="/wiki/TracTimeline">Timeline</a></li><li class="False"><a class="False" href="/wiki/TracBrowser">Repository Browser</a></li><li class="False"><a class="False" href="/wiki/TracRevisionLog">Revision Log</a></li><li class="False"><a class="False" href="/wiki/TracChangeset">Changesets</a></li><li class="False"><a class="False" href="/wiki/TracTickets">Tickets</a></li><li class="False"><a class="False" href="/wiki/TracWorkflow">Workflow</a></li><li class="False"><a class="False" href="/wiki/TracRoadmap">Roadmap</a></li><li class="False"><a class="False" href="/wiki/TracQuery">Ticket Queries</a></li><li class="False"><a class="False" href="/wiki/TracBatchModify">Batch Modify</a></li><li class="False"><a class="False" href="/wiki/TracReports">Reports</a></li><li class="False"><a class="False" href="/wiki/TracRss">RSS Support</a></li><li class="active"><a class="False" href="/wiki/TracNotification">Notification</a></li></ul></div><p> </p> <div class="wiki-toc trac-nav" style="clear:both"> <h4>Languages:</h4> <ul><li><strong>English</strong> </li><li><a class="wiki" href="/wiki/TranslationRu/TracNotification">Русский</a> </li></ul> </div><p> </p> <p> Trac supports notification of ticket changes via email. </p> <p> Email notification is useful to keep users up-to-date on tickets of interest, and also provides a convenient way to post all ticket changes to a dedicated mailing list. </p> <p> Disabled by default, notification can be activated and configured in <a class="wiki" href="/wiki/TracIni">trac.ini</a>. </p> <h2 class="section" id="ReceivingNotificationMails">Receiving Notification Mails</h2> <p> When reporting a new ticket or adding a comment, enter a valid email address or your Trac username in the <em>reporter</em>, <em>assigned to/owner</em> or <em>cc</em> field. Trac may send you an email when changes are made to the ticket, depending on how your notification preferences are configured. </p> <p> Permission groups can also be entered in the CC field, to notify all members of the group. </p> <h3 class="section" id="Howtouseyourusernametoreceivenotificationmails">How to use your username to receive notification mails</h3> <p> To 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 your <a href="/prefs">preferences</a>. </p> <p> Alternatively, a default domain name (<strong><code>smtp_default_domain</code></strong>) can be set in the <a class="wiki" href="/wiki/TracIni">TracIni</a> file, see <a class="wiki" href="/wiki/TracNotification#ConfigurationOptions">Configuration Options</a> below. In this case, the default domain will be appended to the username, which can be useful for an "Intranet" kind of installation. </p> <p> When using apache and mod_kerb for authentication against Kerberos / Active Directory, usernames take the form (<strong><code>username@EXAMPLE.LOCAL</code></strong>). To avoid this being interpreted as an email address, add the Kerberos domain to (<strong><code>ignore_domains</code></strong>). </p> <h3 class="section" id="Ticketattachmentnotifications">Ticket attachment notifications</h3> <p> Since 1.0.3 Trac will send notifications when a ticket attachment is added or deleted. Usually attachment notifications will be enabled in an environment by default. To disable the attachment notifications for an environment the <code>TicketAttachmentNotifier</code> component must be disabled: </p> <div class="wiki-code"><div class="code"><pre><span class="k">[components]</span> <span class="na">trac.ticket.notification.TicketAttachmentNotifier</span> <span class="o">=</span> <span class="s">disabled</span> </pre></div></div><h2 class="section" id="ConfiguringSMTPNotification">Configuring SMTP Notification</h2> <p> <strong>Important:</strong> The <a class="wiki" href="/wiki/TracIni#trac-base_url-option">[trac] base_url</a> option must be configured for links in the notification message to be correctly generated. </p> <h3 class="section" id="ConfigurationOptions">Configuration Options</h3> <p> These are the available options for the <code>[notification]</code> section in trac.ini: </p> <p> </p><div class="tracini"><h3 id="notification-section"><code>[notification]</code></h3><table class="wiki"><tbody><tr class="even" id="notification-admit_domains-option"><td><a class="tracini-option" href="#notification-admit_domains-option"><code>admit_domains</code></a></td><td><p> Comma-separated list of domains that should be considered as valid for email addresses (such as localdomain). </p> </td><td class="nodefault">(no default)</td></tr><tr class="odd" id="notification-ambiguous_char_width-option"><td><a class="tracini-option" href="#notification-ambiguous_char_width-option"><code>ambiguous_char_width</code></a></td><td><p> Width of ambiguous characters that should be used in the table of the notification mail. </p> <p> If <code>single</code>, the same width as characters in US-ASCII. This is expected by most users. If <code>double</code>, twice the width of US-ASCII characters. This is expected by CJK users. </p> </td><td class="default"><code>single</code></td></tr><tr class="even" id="notification-batch_subject_template-option"><td><a class="tracini-option" href="#notification-batch_subject_template-option"><code>batch_subject_template</code></a></td><td><p> Like <code>ticket_subject_template</code> but for batch modifications. (<em>since 1.0</em>) </p> </td><td class="default"><code>${prefix} Batch modify: ${tickets_descr}</code></td></tr><tr class="odd" id="notification-default_format.email-option"><td><a class="tracini-option" href="#notification-default_format.email-option"><code>default_format.email</code></a></td><td><p> Default format to distribute email notifications. </p> </td><td class="default"><code>text/plain</code></td></tr><tr class="even" id="notification-email_address_resolvers-option"><td><a class="tracini-option" href="#notification-email_address_resolvers-option"><code>email_address_resolvers</code></a></td><td><p> Comma separated list of email resolver components in the order they will be called. If an email address is resolved, the remaining resolvers will not be called. </p> </td><td class="default"><code>SessionEmailResolver</code></td></tr><tr class="odd" id="notification-email_sender-option"><td><a class="tracini-option" href="#notification-email_sender-option"><code>email_sender</code></a></td><td><p> Name of the component implementing <code>IEmailSender</code>. </p> <p> This component is used by the notification system to send emails. Trac currently provides <code>SmtpEmailSender</code> for connecting to an SMTP server, and <code>SendmailEmailSender</code> for running a <code>sendmail</code>-compatible executable. </p> </td><td class="default"><code>SmtpEmailSender</code></td></tr><tr class="even" id="notification-ignore_domains-option"><td><a class="tracini-option" href="#notification-ignore_domains-option"><code>ignore_domains</code></a></td><td><p> Comma-separated list of domains that should not be considered part of email addresses (for usernames with Kerberos domains). </p> </td><td class="nodefault">(no default)</td></tr><tr class="odd" id="notification-message_id_hash-option"><td><a class="tracini-option" href="#notification-message_id_hash-option"><code>message_id_hash</code></a></td><td><p> Hash algorithm to create unique Message-ID header. <em>(since 1.0.13)</em> </p> </td><td class="default"><code>md5</code></td></tr><tr class="even" id="notification-mime_encoding-option"><td><a class="tracini-option" href="#notification-mime_encoding-option"><code>mime_encoding</code></a></td><td><p> Specifies the MIME encoding scheme for emails. </p> <p> Supported values are: <code>none</code>, the default value which uses 7-bit encoding if the text is plain ASCII or 8-bit otherwise. <code>base64</code>, which works with any kind of content but may cause some issues with touchy anti-spam/anti-virus engine. <code>qp</code> or <code>quoted-printable</code>, which works best for european languages (more compact than base64) if 8-bit encoding cannot be used. </p> </td><td class="default"><code>none</code></td></tr><tr class="odd" id="notification-sendmail_path-option"><td><a class="tracini-option" href="#notification-sendmail_path-option"><code>sendmail_path</code></a></td><td><p> Path to the sendmail executable. </p> <p> The sendmail program must accept the <code>-i</code> and <code>-f</code> options. </p> </td><td class="default"><code>sendmail</code></td></tr><tr class="even" id="notification-smtp_always_bcc-option"><td><a class="tracini-option" href="#notification-smtp_always_bcc-option"><code>smtp_always_bcc</code></a></td><td><p> Comma-separated list of email addresses to always send notifications to. Addresses are not public (Bcc:). </p> </td><td class="nodefault">(no default)</td></tr><tr class="odd" id="notification-smtp_always_cc-option"><td><a class="tracini-option" href="#notification-smtp_always_cc-option"><code>smtp_always_cc</code></a></td><td><p> Comma-separated list of email addresses to always send notifications to. Addresses can be seen by all recipients (Cc:). </p> </td><td class="nodefault">(no default)</td></tr><tr class="even" id="notification-smtp_default_domain-option"><td><a class="tracini-option" href="#notification-smtp_default_domain-option"><code>smtp_default_domain</code></a></td><td><p> Default host/domain to append to addresses that do not specify one. Fully qualified addresses are not modified. The default domain is appended to all username/login for which an email address cannot be found in the user settings. </p> </td><td class="nodefault">(no default)</td></tr><tr class="odd" id="notification-smtp_enabled-option"><td><a class="tracini-option" href="#notification-smtp_enabled-option"><code>smtp_enabled</code></a></td><td><p> Enable email notification. </p> </td><td class="default"><code>disabled</code></td></tr><tr class="even" id="notification-smtp_from-option"><td><a class="tracini-option" href="#notification-smtp_from-option"><code>smtp_from</code></a></td><td><p> Sender address to use in notification emails. </p> <p> At least one of <code>smtp_from</code> and <code>smtp_replyto</code> must be set, otherwise Trac refuses to send notification mails. </p> </td><td class="default"><code>trac@localhost</code></td></tr><tr class="odd" id="notification-smtp_from_author-option"><td><a class="tracini-option" href="#notification-smtp_from_author-option"><code>smtp_from_author</code></a></td><td><p> Use the author of the change as the sender in notification emails (e.g. reporter of a new ticket, author of a comment). If the author hasn't set an email address, <code>smtp_from</code> and <code>smtp_from_name</code> are used instead. (<em>since 1.0</em>) </p> </td><td class="default"><code>disabled</code></td></tr><tr class="even" id="notification-smtp_from_name-option"><td><a class="tracini-option" href="#notification-smtp_from_name-option"><code>smtp_from_name</code></a></td><td><p> Sender name to use in notification emails. </p> </td><td class="nodefault">(no default)</td></tr><tr class="odd" id="notification-smtp_password-option"><td><a class="tracini-option" href="#notification-smtp_password-option"><code>smtp_password</code></a></td><td><p> Password for authenticating with SMTP server. </p> </td><td class="nodefault">(no default)</td></tr><tr class="even" id="notification-smtp_port-option"><td><a class="tracini-option" href="#notification-smtp_port-option"><code>smtp_port</code></a></td><td><p> SMTP server port to use for email notification. </p> </td><td class="default"><code>25</code></td></tr><tr class="odd" id="notification-smtp_replyto-option"><td><a class="tracini-option" href="#notification-smtp_replyto-option"><code>smtp_replyto</code></a></td><td><p> Reply-To address to use in notification emails. </p> <p> At least one of <code>smtp_from</code> and <code>smtp_replyto</code> must be set, otherwise Trac refuses to send notification mails. </p> </td><td class="default"><code>trac@localhost</code></td></tr><tr class="even" id="notification-smtp_server-option"><td><a class="tracini-option" href="#notification-smtp_server-option"><code>smtp_server</code></a></td><td><p> SMTP server hostname to use for email notifications. </p> </td><td class="default"><code>localhost</code></td></tr><tr class="odd" id="notification-smtp_subject_prefix-option"><td><a class="tracini-option" href="#notification-smtp_subject_prefix-option"><code>smtp_subject_prefix</code></a></td><td><p> Text to prepend to subject line of notification emails. </p> <p> If the setting is not defined, then <code>[$project_name]</code> is used as the prefix. If no prefix is desired, then specifying an empty option will disable it. </p> </td><td class="default"><code>__default__</code></td></tr><tr class="even" id="notification-smtp_user-option"><td><a class="tracini-option" href="#notification-smtp_user-option"><code>smtp_user</code></a></td><td><p> Username for authenticating with SMTP server. </p> </td><td class="nodefault">(no default)</td></tr><tr class="odd" id="notification-ticket_subject_template-option"><td><a class="tracini-option" href="#notification-ticket_subject_template-option"><code>ticket_subject_template</code></a></td><td><p> A Jinja2 text template snippet used to get the notification subject. </p> <p> The template variables are documented on the <a class="wiki" href="/wiki/TracNotification#Customizingthee-mailsubject">TracNotification</a> page. </p> </td><td class="default"><code>${prefix} #${ticket.id}: ${summary}</code></td></tr><tr class="even" id="notification-use_public_cc-option"><td><a class="tracini-option" href="#notification-use_public_cc-option"><code>use_public_cc</code></a></td><td><p> Addresses in the To and Cc fields are visible to all recipients. </p> <p> If this option is disabled, recipients are put in the Bcc list. </p> </td><td class="default"><code>disabled</code></td></tr><tr class="odd" id="notification-use_short_addr-option"><td><a class="tracini-option" href="#notification-use_short_addr-option"><code>use_short_addr</code></a></td><td><p> Permit email address without a host/domain (i.e. username only). </p> <p> The SMTP server should accept those addresses, and either append a FQDN or use local delivery. See also <code>smtp_default_domain</code>. Do not use this option with a public SMTP server. </p> </td><td class="default"><code>disabled</code></td></tr><tr class="even" id="notification-use_tls-option"><td><a class="tracini-option" href="#notification-use_tls-option"><code>use_tls</code></a></td><td><p> Use SSL/TLS to send notifications over SMTP. </p> </td><td class="default"><code>disabled</code></td></tr></tbody></table></div><p> </p> <h3 class="section" id="ExampleConfigurationSMTP">Example Configuration (SMTP)</h3> <div class="wiki-code"><div class="code"><pre><span class="k">[notification]</span> <span class="na">smtp_enabled</span> <span class="o">=</span> <span class="s">true</span> <span class="na">smtp_server</span> <span class="o">=</span> <span class="s">mail.example.com</span> <span class="na">smtp_from</span> <span class="o">=</span> <span class="s">notifier@example.com</span> <span class="na">smtp_replyto</span> <span class="o">=</span> <span class="s">myproj@projects.example.com</span> <span class="na">smtp_always_cc</span> <span class="o">=</span> <span class="s">ticketmaster@example.com, theboss+myproj@example.com</span> </pre></div></div><h3 class="section" id="ExampleConfigurationsendmail">Example Configuration (<code>sendmail</code>)</h3> <div class="wiki-code"><div class="code"><pre><span class="k">[notification]</span> <span class="na">smtp_enabled</span> <span class="o">=</span> <span class="s">true</span> <span class="na">email_sender</span> <span class="o">=</span> <span class="s">SendmailEmailSender</span> <span class="na">sendmail_path</span> <span class="o">=</span> <span class="s">/usr/sbin/sendmail</span> <span class="na">smtp_from</span> <span class="o">=</span> <span class="s">notifier@example.com</span> <span class="na">smtp_replyto</span> <span class="o">=</span> <span class="s">myproj@projects.example.com</span> <span class="na">smtp_always_cc</span> <span class="o">=</span> <span class="s">ticketmaster@example.com, theboss+myproj@example.com</span> </pre></div></div><h3 class="section" id="SubscriberConfiguration">Subscriber Configuration</h3> <p> The default subscriptions are configured in the <a class="wiki" href="/wiki/TracIni#notification-subscriber-section">[notification-subscriber]</a> section. </p> <p> </p><div class="tracini"><h3 id="notification-subscriber-section"><code>[notification-subscriber]</code></h3><p> The notifications subscriptions are controlled by plugins. All <code>INotificationSubscriber</code> components are in charge. These components may allow to be configured via this section in the <code>trac.ini</code> file. </p> <p> See <a class="wiki" href="/wiki/TracNotification">TracNotification</a> for more details. </p> <p> Available subscribers: </p><div class="trac-subscriberlist"><table class="wiki"><thead><tr><th>Subscriber</th><th>Description</th></tr></thead><tbody><tr class="even"><td><code>AlwaysEmailSubscriber</code></td><td></td></tr><tr class="odd"><td><code>CarbonCopySubscriber</code></td><td>Ticket that I'm listed in the CC field is modified</td></tr><tr class="even"><td><code>NewTicketSubscriber</code></td><td>Any ticket is created</td></tr><tr class="odd"><td><code>TicketOwnerSubscriber</code></td><td>Ticket that I own is created or modified</td></tr><tr class="even"><td><code>TicketPreviousUpdatersSubscriber</code></td><td>Ticket that I previously updated is modified</td></tr><tr class="odd"><td><code>TicketReporterSubscriber</code></td><td>Ticket that I reported is modified</td></tr><tr class="even"><td><code>TicketUpdaterSubscriber</code></td><td>I update a ticket</td></tr></tbody></table></div><p> </p> </div><p> </p> <p> Each user can override these defaults in their <em>Notifications</em> preferences. </p> <p> For example to unsubscribe from notifications for one's own changes and comments, the rule "Never notify: I update a ticket" should be added above other subscription rules. </p> <p> The subscription rule name on the left side of the <code>=</code> can be anything, it has no meaning outside this configuration file. The subscriber name on the right side of the <code>=</code> must be one of the subscribers listed in the above table. </p> <p> The following attributes of default subscriptions can be configured: </p> <ul><li><code>.distributor</code> (Default: <code>email</code>) <ul><li>Other values require plugins. For example <code>on-site</code> requires <a class="ext-link" href="https://trac-hacks.org/wiki/OnSiteNotificationsPlugin"><span class="icon">​</span>OnSiteNotificationsPlugin</a>. </li></ul></li><li><code>.priority</code> (Default: <code>100</code>) <ul><li>Smaller values override larger values. </li><li>If you use <code>0</code>, then users will not be able to override this rule. </li></ul></li><li><code>.adverb</code> (Default: <code>always</code>) <ul><li><code>never</code> can be used to silence other subscription rules with higher values. </li></ul></li><li><code>.format</code> (Default: <code>text/plain</code>) <ul><li>Other values require plugins. For example <code>text/html</code> requires <a class="ext-link" href="https://trac-hacks.org/wiki/TracHtmlNotificationPlugin"><span class="icon">​</span>TracHtmlNotificationPlugin</a>. </li></ul></li></ul><h3 class="section" id="ExampleConfigurationdefaultsubscriptions">Example Configuration (default subscriptions)</h3> <p> This example implements the often desired <em>Never Notify Updater</em> behavior by setting the priority of that rule to the highest value, thereby taking precedence over other rules. </p> <div class="wiki-code"><div class="code"><pre><span class="k">[notification-subscriber]</span> <span class="na">always_notify_owner</span> <span class="o">=</span> <span class="s">TicketOwnerSubscriber</span> <span class="na">always_notify_owner.distributor</span> <span class="o">=</span> <span class="s">email</span> <span class="na">always_notify_owner.priority</span> <span class="o">=</span> <span class="s">100</span> <span class="na">always_notify_owner.adverb</span> <span class="o">=</span> <span class="s">always</span> <span class="na">always_notify_owner.format</span> <span class="o">=</span> <span class="s">text/plain</span> <span class="na">always_notify_previous_updater</span> <span class="o">=</span> <span class="s">TicketPreviousUpdatersSubscriber</span> <span class="na">never_notify_updater</span> <span class="o">=</span> <span class="s">TicketUpdaterSubscriber</span> <span class="na">never_notify_updater.adverb</span> <span class="o">=</span> <span class="s">never</span> <span class="na">never_notify_updater.priority</span> <span class="o">=</span> <span class="s">0</span> <span class="na">notify_cc_html</span> <span class="o">=</span> <span class="s">CarbonCopySubscriber</span> <span class="na">notify_cc_html.format</span> <span class="o">=</span> <span class="s">text/html</span> </pre></div></div><h3 class="section" id="Customizingtheemailsubject">Customizing the email subject</h3> <p> The email subject can be customized with the <code>ticket_subject_template</code> option, which contains a <a class="ext-link" href="https://genshi.edgewall.org/wiki/Documentation/text-templates.html"><span class="icon">​</span>Genshi text template</a> snippet. The default value is: </p> <div class="wiki-code"><div class="code"><pre><span class="cp">${</span><span class="n">prefix</span><span class="cp">}</span> #<span class="cp">${</span><span class="n">ticket</span><span class="o">.</span><span class="n">id</span><span class="cp">}</span>: <span class="cp">${</span><span class="n">summary</span><span class="cp">}</span> </pre></div></div><p> The following variables are available in the template: </p> <ul><li><code>changes</code>: The ticket changes (prepared by <a href="https://trac.edgewall.org/intertrac/source%3A/branches/1.4-stable/trac/ticket/model.py" title="source:/branches/1.4-stable/trac/ticket/model.py in The Trac Project">Ticket.get_change</a>). </li><li><code>env</code>: The project environment (see <a href="https://trac.edgewall.org/intertrac/source%3A/branches/1.4-stable/trac/env.py" title="source:/branches/1.4-stable/trac/env.py in The Trac Project">env.py</a>). </li><li><code>prefix</code>: The prefix defined in <code>smtp_subject_prefix</code>. </li><li><code>summary</code>: The ticket summary, with the old value if the summary was edited. </li><li><code>ticket</code>: The ticket model object (see <a href="https://trac.edgewall.org/intertrac/source%3A/branches/1.4-stable/trac/ticket/model.py" title="source:/branches/1.4-stable/trac/ticket/model.py in The Trac Project">model.py</a>). Individual ticket fields can be addressed by appending the field name separated by a dot, eg <code>${ticket.milestone}</code>. </li></ul><h3 class="section" id="CustomizingContent">Customizing the email content</h3> <p> The notification email content is generated based on <code>ticket_notify_email.txt</code> in <code>trac/ticket/templates</code>. You can add your own version of this template by adding a <code>ticket_notify_email.txt</code> to the templates directory of your environment. The default is: </p> <div class="wiki-code"><div class="code"><pre><span class="x">${ticket_body_hdr}</span> <span class="x">${ticket_props}</span> <span class="x"># if ticket.new:</span> <span class="x">${ticket.description}</span> <span class="x"># else:</span> <span class="x"># if changes_body:</span> <span class="x">${_(&#39;Changes (by %(author)s):&#39;, author=change.author)}</span> <span class="x">${changes_body}</span> <span class="x"># endif</span> <span class="x"># if changes_descr:</span> <span class="x"># if not changes_body and not change.comment and change.author:</span> <span class="x">${_(&#39;Description changed by %(author)s:&#39;, author=change.author)}</span> <span class="x"># endif</span> <span class="x">${changes_descr}</span> <span class="x">--</span> <span class="x"># endif</span> <span class="x"># if change.comment:</span> <span class="x">${_(&#39;Comment:&#39;) if changes_body else</span> <span class="x"> _(&#39;Comment (by %(author)s):&#39;, author=change.author)}</span> <span class="x">${change.comment}</span> <span class="x"># endif</span> <span class="x"># endif</span> <span class="x">${&#39;-- &#39;}</span> <span class="x">${_(&#39;Ticket URL: &lt;%(link)s&gt;&#39;, link=ticket.link)}</span> <span class="x">${project.name} &lt;${project.url or abs_href()}&gt;</span> <span class="x">${project.descr}</span> </pre></div></div><p> See the <a href="https://trac.edgewall.org/intertrac/CookBook/Notification/Templates" title="CookBook/Notification/Templates in The Trac Project">cookbook</a> for additional template customization recipes. </p> <h2 class="section" id="SampleEmail">Sample Email</h2> <pre class="wiki">#42: testing ---------------------------+------------------------------------------------ Id: 42 | Status: assigned Component: report system | Modified: Fri Apr 9 00:04:31 2004 Severity: major | Milestone: 0.9 Priority: lowest | Version: 0.6 Owner: anonymous | Reporter: jonas@example.com ---------------------------+------------------------------------------------ Changes: * component: changeset view =&gt; search system * priority: low =&gt; highest * owner: jonas =&gt; anonymous * cc: daniel@example.com =&gt; daniel@example.com, jonas@example.com * status: new =&gt; assigned Comment: I'm interested too! -- Ticket URL: &lt;http://example.com/trac/ticket/42&gt; My Project &lt;http://myproj.example.com/&gt; </pre><h2 class="section" id="UsingGMailastheSMTPrelayhost">Using GMail as the SMTP relay host</h2> <p> Use the following configuration snippet: </p> <div class="wiki-code"><div class="code"><pre><span class="k">[notification]</span> <span class="na">smtp_enabled</span> <span class="o">=</span> <span class="s">true</span> <span class="na">use_tls</span> <span class="o">=</span> <span class="s">true</span> <span class="na">mime_encoding</span> <span class="o">=</span> <span class="s">base64</span> <span class="na">smtp_server</span> <span class="o">=</span> <span class="s">smtp.gmail.com</span> <span class="na">smtp_port</span> <span class="o">=</span> <span class="s">587</span> <span class="na">smtp_user</span> <span class="o">=</span> <span class="s">user</span> <span class="na">smtp_password</span> <span class="o">=</span> <span class="s">password</span> </pre></div></div><p> where <em>user</em> and <em>password</em> match an existing GMail account, ie the ones you use to log in on <a class="ext-link" href="https://gmail.com"><span class="icon">​</span>https://gmail.com</a>. </p> <p> Alternatively, you can use <code>smtp_port = 25</code>.<br /> You should not use <code>smtp_port = 465</code>. Doing so may deadlock your ticket submission. Port 465 is reserved for the SMTPS protocol, which is not supported by Trac. See <a href="https://trac.edgewall.org/intertrac/comment%3A2%3Aticket%3A7107" title="comment:2:ticket:7107 in The Trac Project">#7107</a> for details. </p> <h2 class="section" id="Troubleshooting">Troubleshooting</h2> <p> If notifications are not working, inspect the <a class="wiki" href="/wiki/TracLogging">log</a> for error messages. </p> <p> Notification errors are not always reported through the web interface, so the user who submits a change or creates a ticket may not get notified about a notification failure. The Trac administrator needs to look at the log to find the error message and traceback. </p> <h3 class="section" id="Permissiondeniederror">Permission denied error</h3> <p> Typical error message: </p> <div class="wiki-code"><div class="code"><pre> ... File <span class="s2">&quot;.../smtplib.py&quot;</span>, line <span class="m">303</span>, in connect raise socket.error, msg error: <span class="o">(</span><span class="m">13</span>, <span class="s1">&#39;Permission denied&#39;</span><span class="o">)</span> </pre></div></div><p> This error usually comes from a security settings on the server: many Linux distributions do not allow the web server (Apache, &hellip;) to post email messages to the local SMTP server. </p> <p> Many users get confused when their manual attempts to contact the SMTP server succeed: </p> <div class="wiki-code"><div class="code"><pre>telnet localhost <span class="m">25</span> </pre></div></div><p> This is because a regular user may connect to the SMTP server, but the web server cannot: </p> <div class="wiki-code"><div class="code"><pre>sudo -u www-data telnet localhost <span class="m">25</span> </pre></div></div><p> In 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 <a href="https://trac.edgewall.org/intertrac/MailingList" title="MailingList in The Trac Project">MailingList</a> archive. </p> <p> Relevant ML threads: </p> <ul><li>SELinux: <a class="ext-link" href="http://article.gmane.org/gmane.comp.version-control.subversion.trac.general/7518"><span class="icon">​</span>http://article.gmane.org/gmane.comp.version-control.subversion.trac.general/7518</a> </li></ul><p> For SELinux in Fedora 10: </p> <div class="wiki-code"><div class="code"><pre>$ setsebool -P httpd_can_sendmail <span class="m">1</span> </pre></div></div><h3 class="section" id="Suspectedspamerror">Suspected spam error</h3> <p> Some SMTP servers may reject the notification email sent by Trac. </p> <p> The default Trac configuration uses Base64 encoding to send emails to the recipients. The whole body of the email is encoded, which sometimes trigger <em>false positive</em> spam detection on sensitive email servers. In such an event, change the default encoding to "quoted-printable" using the <code>mime_encoding</code> option. </p> <p> Quoted printable encoding works better with languages that use one of the Latin charsets. For Asian charsets, stick with the Base64 encoding. </p> <h3 class="section" id="Emailsnotsent">Emails not sent</h3> <p> If you are switching back to using Trac to send emails from, say, the <a class="ext-link" href="https://trac-hacks.org/wiki/AnnouncerPlugin"><span class="icon">​</span>AnnouncerPlugin</a>, be sure to enable <code>EmailDistributor</code> in your Trac configuration. It may have been disabled when using an email plugin. There may be no message in the Trac log when all is good to go, but the actual sending is disabled. </p> <hr /> <p> See also: <a class="wiki" href="/wiki/TracTickets">TracTickets</a>, <a class="wiki" href="/wiki/TracIni">TracIni</a>, <a class="wiki" href="/wiki/TracGuide">TracGuide</a>, <a href="https://trac.edgewall.org/intertrac/TracDev/NotificationApi" title="TracDev/NotificationApi in The Trac Project">TracDev/NotificationApi</a> </p> </div> <div class="trac-modifiedby"> <span> <a href="/wiki/TracNotification?action=diff&amp;version=114" title="Version 114 by figaro: Cosmetic change">Last modified</a> <a class="timeline" href="/timeline?from=2022-09-24T15%3A45%3A52%2B02%3A00&amp;precision=second" title="See timeline at Sep 24, 2022, 3:45:52 PM">3 years ago</a> </span> <span class="trac-print"> Last modified on Sep 24, 2022, 3:45:52 PM </span> </div> </div> <div id="attachments"> </div> <div class="buttons"> <form method="get" action="/wiki/TracNotification" id="modifypage"> <div> <input type="hidden" name="action" value="edit" /> <input type="submit" value="Edit this page" /> </div> </form> <form method="get" action="/attachment/wiki/TracNotification/" id="attachfile"> <div> <input type="hidden" name="action" value="new" /> <input type="submit" id="attachfilebutton" value="Attach file"/> </div> </form> </div> <div class="trac-help"> <strong>Note:</strong> See <a href="/wiki/TracWiki">TracWiki</a> for help on using the wiki. </div> </div> <!-- # block content (content inherited from layout.html) --> <script> jQuery.loadStyleSheet("/pygments/trac.css", "text/css"); </script> <div id="altlinks"> <h3>Download in other formats:</h3> <ul> <li class="last first"> <a rel="nofollow" href="/wiki/TracNotification?format=txt" class=""> Plain Text</a> </li> </ul> </div> <!-- # endblock content (content inherited from layout.html) --> <!-- # endblock content (placeholder in theme.html) --> </div> <div id="footer"><hr/> <a id="tracpowered" href="https://trac.edgewall.org/" ><img src="/chrome/common/trac_logo_mini.png" height="30" width="107" alt="Trac Powered"/></a> <p class="left"> Powered by <a href="/about"><strong>Trac 1.4.3</strong></a> <br /> By <a href="http://www.edgewall.org/">Edgewall Software</a> . </p> <p class="right">Visit the Trac open source project at<br /><a href="//trac.edgewall.org/">https://trac.edgewall.org/</a></p> </div> <!-- # include 'site_footer.html' (theme.html) --> <!-- site_footer_trac.html --> </div><!-- #ew-content --> </div> </div> <div id="ew-footer"> <p><a href="mailto:info@edgewall.com">info@edgewall.com</a></p> <p>Copyright &copy; 2003-2024 Edgewall Software. All rights reserved.</p> </div> <div id="right"> <div id="ohloh-badge"> <a href="//www.openhub.net/p/trac"> <img src="//www.openhub.net/p/trac/widgets/project_thin_badge.gif" /> </a> </div> <script type="text/javascript"><!-- google_ad_client = "pub-3746245347013177"; google_ad_width = 120; google_ad_height = 600; google_ad_format = "120x600_as"; google_ad_channel ="9044578517"; google_ad_type = "text_image"; google_color_border = "8b8d8d"; /*google_color_border = "6b6d6d";*/ google_color_bg = "6b6d6d"; /*google_color_bg = "4b4d4d";*/ google_color_link = "336699"; google_color_url = "E2B200"; google_color_text = "8c8c8c"; /*google_color_text = "cccccc";*/ //--></script> <script type="text/javascript" src="//pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> <!-- /site_footer_trac.html --> <!-- end of site_footer.html --> <!-- # endblock body (content inherited from theme.html) --> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10