TracHtmlNotificationPlugin only sends text/plain

75 views
Skip to first unread message

Manuel Bilderbeek

unread,
Apr 11, 2023, 11:55:38 AM4/11/23
to Trac Users

Hi,

As plain text notifications look totally garbled in Outlook, I wanted to start sending HTML formatted notifications. So I installed the TracHtmlNotificationPlugin.

 I followed the steps from https://trac-hacks.org/wiki/TracHtmlNotificationPlugin to install it.

But whatever, I do (e.g. set the default for all users to text/html), I still get text/plain e-mails.

This is what the debug log says:

2023-04-11 13:21:43,718 Trac[loader] DEBUG: Loading trachtmlnotification.notification from /usr/local/lib/python2.7/dist-packages/TracHtmlNotificationPlugin-0.12.0.3-py2.7.egg

2023-04-11 13:21:44,090 Trac[mail] DEBUG: EmailDistributor has found the following formats capable of handling 'email' of 'ticket': text/html, text/plain

2023-04-11 13:21:44,114 Trac[mail] DEBUG: EmailDistributor is sending event as 'text/plain' to: te...@example.com

2023-04-11 13:21:44,118 Trac[mail] INFO: Sending notification through SMTP at 127.0.0.1:25 to ['te...@example.com']

 

So, I can’t really find the reason why the code decides to send as text/plain, instead of text/html.

 

What am I missing here?

 

This is Trac 1.2 on Ubuntu bionic.


Thanks for any attempt to help.


Kind regards,

Manuel Bilderbeek

RjOllos

unread,
Apr 12, 2023, 12:21:55 AM4/12/23
to Trac Users
If the installed version of Trac is 1.1.4 or later, configure to use text/html format for email distributor in the Notifications panel of the Preferences page in your Trac or set the default_format.email option to text/html in the notifications section of your trac.ini.
 

Manuel Bilderbeek

unread,
Apr 14, 2023, 10:23:09 AM4/14/23
to Trac Users
Hi,

Yes, I actually did both. So, the default is set to text/html and my personal preference has been set to text/html:
In Trac.ini under [notification]:
default_format.email = text/html

So, in my user prefs I also set it to text/html, but when I just reviewed it, I noticed it is back to text/plain. And when I change it again to text/html and save the settings, it is automatically changed back to text/plain... So I guess that's where things go wrong. Any idea why this is happening?

Op woensdag 12 april 2023 om 06:21:55 UTC+2 schreef RjOllos:

Jun Omae

unread,
Apr 16, 2023, 8:39:35 AM4/16/23
to trac-...@googlegroups.com
Hi,

On Fri, Apr 14, 2023 at 11:23 PM Manuel Bilderbeek
<manuel.bild...@gmail.com> wrote:
> Yes, I actually did both. So, the default is set to text/html and my personal preference has been set to text/html:
> In Trac.ini under [notification]:
> default_format.email = text/html
>
> So, in my user prefs I also set it to text/html, but when I just reviewed it, I noticed it is back to text/plain. And when I change it again to text/html and save the settings, it is automatically changed back to text/plain... So I guess that's where things go wrong. Any idea why this is happening?
>

It is the issue in Trac 1.2 and has been fixed in Trac 1.2.1.
Also, [notification] default_format.email option is introduced in Trac
1.2.1, doesn't exist in Trac 1.2 yet.

Please upgrade to Trac 1.2.6, at least 1.2.1.

See also: https://trac.edgewall.org/ticket/11928

--
Jun Omae <jun...@gmail.com> (大前 潤)

Manuel Bilderbeek

unread,
Apr 19, 2023, 12:23:23 AM4/19/23
to Trac Users
Hi,

OK, thanks a lot for the response. Unfortunately, the policy is to use the available Ubuntu packages only. And in Ubuntu bionic (18.04 LTS) apparently only plain 1.2 is available. The next available version seems to be 1.5.3 (in 22.04 LTS) or 1.5.4 (in the latest release), but I read on the Trac website that the 1.5 series are not considered stable. So upgrading to a newer Ubuntu version will get us a Trac 1.5 which is apparently not considered stable for production...
I'm therefore in a squeeze. Looks like I have to wait until a Trac 1.6 is available in a new Ubuntu release. Or am I missing something?
(Is 1.5.3 or 1.5.4 perhaps more stable than indicated?)

Kind regards,
Manuel
Op zondag 16 april 2023 om 14:39:35 UTC+2 schreef Jun Omae:

Jun Omae

unread,
Apr 19, 2023, 2:12:32 AM4/19/23
to trac-...@googlegroups.com
On 2023/04/17 17:55, Manuel Bilderbeek wrote:
> OK, thanks a lot for the response. Unfortunately, the policy is to use the available Ubuntu packages only. And in Ubuntu bionic (18.04 LTS) apparently only plain 1.2 is available. The next available version seems to be 1.5.3 (in 22.04 LTS) or 1.5.4 (in the latest release), but I read on the Trac website that the 1.5 series are not considered stable. So upgrading to a newer Ubuntu version will get us a Trac 1.5 which is apparently not considered stable for production...
> I'm therefore in a squeeze. Looks like I have to wait until a Trac 1.6 is available in a new Ubuntu release. Or am I missing something?
> (Is 1.5.3 or 1.5.4 perhaps more stable than indicated?)

How about creating new virtualenv and install Trac 1.2.6 and plugins to the virtualenv, rather than the Trac package in the distribution?

Manuel Bilderbeek

unread,
Apr 24, 2023, 9:12:49 AM4/24/23
to Trac Users
Hi,

Yes, that is probably possible, I'll look into it. Actually, I think I could then just uninstall the Ubuntu trac package and manually install the Trac 1.2.6 outside Ubuntu's package management as well. But I'd prefer to keep thing simple, i.e. managed by the distro package system as much as possible.

It seems a bit silly that Ubuntu put the 1.2 (.0?) in their 18.02 LTS and never updated it as updates to 1.2 were released by the trac project. If someone is willing to backport trac 1.2.6 to Ubuntu 18.02 LTS and release that with the Ubuntu maintainers, it would be great. If anyone reading this is interested to make that happen: depending on the price, my company is willing to financially sponsor that. (Feel free to contact me about that.)

Still interested in a statement about the status of 1.5.3 or 1.5.4 regarding stability in production use. How bad (or good!) is it? 
If it's good enough to just use, I can just upgrade to the latest Unbuntu LTS or 23.04 release (much better than using a 5 year old distro). I fully understand that no one is willing to give any guarantees or make promises, but a rough idea on what I can expect would be good to have. Then we could decide whether we would want to try it or not.

Thanks for all your input.

Kind regards,
Manuel Bilderbeek

Op woensdag 19 april 2023 om 08:12:32 UTC+2 schreef Jun Omae:

OSP Hathaway

unread,
Apr 28, 2023, 10:13:13 PM4/28/23
to trac-...@googlegroups.com
Trac 1.5.+ requires Python > 3.5. All plug-ins also need upgrade to a compatible Python version. 
Steve Hathaway 

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/fc88eb50-f69f-4d62-a189-0f64301357cdn%40googlegroups.com.

Manuel Bilderbeek

unread,
May 5, 2023, 11:50:56 AM5/5/23
to Trac Users
Hi,

Yes, I realize that they require Python 3. This would be available in a modern Ubuntu after upgrading.
Good point about the plug-ins. I guess I'll have to check whether all the currently used plugins have been upgraded to Python 3. (The ones packaged/available in Ubuntu will have been, of course.)

Apart from that: what's the risk of using Trac 1.5? Are there serious regressions that I should be aware of? So, what makes it unstable and possibly not good for production use?

Op zaterdag 29 april 2023 om 04:13:13 UTC+2 schreef OSP Hathaway:

Markus Rosjat

unread,
May 5, 2023, 12:30:37 PM5/5/23
to trac-...@googlegroups.com
hi manuel,



Am Fr., 5. Mai 2023 um 17:50 Uhr schrieb Manuel Bilderbeek <manuel.bild...@gmail.com>:
Hi,

Yes, I realize that they require Python 3. This would be available in a modern Ubuntu after upgrading.
Good point about the plug-ins. I guess I'll have to check whether all the currently used plugins have been upgraded to Python 3. (The ones packaged/available in Ubuntu will have been, of course.)


regurading the plugins, as far as i know the plugins are not provided by the OS distribution. You either get them from trac-hacks.org or if someone made a pypi package you pip install it from there. 
And here comes your problem, you need to test those ;) 

what i can confirm is that there are plugins working on my 1.5.4 test instance for the following plugins

AccountManager
TimeandEstimation
TracTags 
TracNav (works from the pipy package)
WikiForms (but thats something i just fixed for the sake of having it ported in my instance, i didnt checked if someone is working on that code)

Dan

unread,
May 5, 2023, 2:39:17 PM5/5/23
to Trac Users
Just to throw in my two cents ... Here is a list of plugins we've been running on our 1.5.4dev under Ubuntu 22.04.  It looks like it's been about a year running in a production environment, since most of the files have a May 2022 date:

Acronym.py
AllTicketsTableMacro-1.0-py3.10.egg
Blog.py
Cards-1.4-py3.10.egg
FlatTableProcessor.py
FoldMacro.py
ImportExportXLS-0.3-py3.10.egg
PackingSlipDownloadPlugin-1.0.3.1-py3.10.egg
PlannedMilestones.py
TicketReminderPlugin-0.2.2-py3.10.egg
TicketValidation-0.0.4.dev0-py3.10.egg
timingandestimationplugin-1.6.1-py3.10.egg
TracAccountManager-0.6.dev0-py3.10.egg
TracCcSelector-0.2.1-py3.10.egg
TracChildTickets-2.6.0.dev0-py3.10.egg
TracDragDrop-0.12.0.16-py3.10.egg
TracFootNoteMacro-1.6.1-py3.10.egg
TracHtmlNotificationPlugin-0.12.0.2-py3.10.egg
TracMovieMacro-0.3-py3.10.egg
TracMultiSelectField-1.0.4.dev0-py3.10.egg
TracTicketChat-1.1-py3.10.egg
TracWikiAutoComplete-1.4-py3.10.egg
TracWikiCalendarMacro-2.2.0.dev0-py3.10.egg
TracWikiExtras-1.3.2.dev0-py3.10.egg
TracWysiwyg-0.12.0.7-py3.10.egg
WikiInclude.py

Some of them are obsolete but we keep them around for sentimental (and backward compatibility) reasons.  Also, a couple are custom made (not publicly available), and some may have local edits by me (though I usually try to upload patches when I make changes).

My company has been using Trac since about 2006 (version 0.9?) and we have over 250 individual projects, though only a handful are active.

- Dan

Markus Rosjat

unread,
May 5, 2023, 2:47:02 PM5/5/23
to trac-...@googlegroups.com
Hey Dan,

I see your timeandestimation plugin has version 1.6.1 so I guess it's work you done? Is the code accessible somewhere?

Cheers

Markus

Dan Mahn

unread,
May 5, 2023, 3:04:02 PM5/5/23
to trac-...@googlegroups.com

It looks like I placed a patch here:

https://trac-hacks.org/ticket/13732

Although it looks like you've already found that.

According to my logs, the last mod I have was made April 7, 2022.

If what's on trac-hacks.org doesn't seem like it'll work for some reason (e.g. the patch I attached or whatever), I could do some more work to check what I have, or make it available somehow.

You mention filter_stream, but it seems it is already ported to Jinja.  I did a bunch of work on several plugins on that, but my memory is fading at this point.  I see the patch contains a "billing_jinja.html", for instance.

- Dan

Markus Rosjat

unread,
May 5, 2023, 3:25:45 PM5/5/23
to trac-...@googlegroups.com
Hi Dan,

Yeah I used the patch but I made the mistake to use the permission version that we dont really need. I applied the patch to the normal version and got it working so far. So no need to stress then, I made an internal repo here so I can use it for the docker stuff I am testing at the moment.

Cheers 

Markus

Manuel Bilderbeek

unread,
May 8, 2023, 4:26:28 AM5/8/23
to Trac Users
hi all,

Thanks a lot for this info. 

We have the following plugins installed as Ubuntu packages:
ii  trac-accountmanager                    0.5~r16056-1                                    all          account management plugin for Trac
ii  trac-customfieldadmin                  0.2.12+r15671-1                                 all          panel for administrating custom ticket fields in Trac
ii  trac-datefieldplugin                   0.7782-3.1                                      all          Add custom date fields to Trac tickets
ii  trac-graphviz                          0.7.5-1.1                                       all          Graphs printing plugin for Trac
ii  trac-icalviewplugin                    0.7889-1.1                                      all          Provides iCalendar feeds for ticket queries
ii  trac-mastertickets                     3.0.2+20111224-2                                all          adds inter-ticket dependencies to Trac
ii  trac-tags                              0.7+svn12392-1                                  all          Tagging plugin for Trac wiki and issue tracking system
ii  trac-wikitablemacro                    1:0.3-1                                         all          SQL Table in Wiki Page for Trac
ii  trac-wysiwyg                           0.12.0.7-1                                      all          WYSIWYG style editor for the Trac issue tracking system

I guess some are obsolete, e.g. trac-mastertickets isn't used, as we also have the following installed:
BatchModify-0.8.0_trac0.12-py2.6.egg
TicketValidator-0.2dev-py2.7.egg
TracHtmlNotificationPlugin-0.12.0.3-py2.7.egg
Tracchildtickets-2.5.5-py2.7.egg

and looks like icalviewplugin, tags , wysiwyg, graphviz, wikitablemacro and datefieldplugin aren't currently enabled either. 

So, the ones we currently definitely use and I didn't see mentioned yet are:
BatchModify
TicketValidator (but I do see TicketValidation mentioned by Dan...)

Does anyone of you have any experience with these on Trac 1.5.4?

Note that the latest Ubuntu LTS (or probably any with trac-1.5.x) doesn't seem to have any trac-plugins as Ubuntu packages available. Actually, I can't even find back these old packages, as they came from bionic, and that one isn't even on the Ubuntu website anymore (I guess due to the release of 23.04 LTS).

To be clear: our intention is to move forward (with a recent Ubuntu like 23.04 and modern Trac) and I'm just trying to figure out whether that will break something for us. Any (more) advice most welcome.

Kind regards,
Manuel Bilderbeek

Op vrijdag 5 mei 2023 om 20:39:17 UTC+2 schreef Dan:

Dan Mahn

unread,
May 8, 2023, 9:50:11 AM5/8/23
to trac-...@googlegroups.com
I think batch modification is now built-in to the base.  I don't think I
ever used the plugin, but the feature is certainly very useful.

The ticket validation plugin we use is a bit of an oddball that I've
kept around because it seemed to fit our needs.  It has a copyright
notice 2009 by Mat Booth.  IIRC there is a different one that others
would likely recommend; I don't recall right now which one.  Let me know
if you'd like to try the one I have, though I can't guarantee I would
have time to support it.

- Dan

RjOllos

unread,
May 10, 2023, 11:11:57 AM5/10/23
to Trac Users
On Friday, May 5, 2023 at 5:50:56 PM UTC+2 manuel.bild...@gmail.com wrote:

Still interested in a statement about the status of 1.5.3 or 1.5.4 regarding stability in production use. How bad (or good!) is it? 
If it's good enough to just use, I can just upgrade to the latest Unbuntu LTS or 23.04 release (much better than using a 5 year old distro). I fully understand that no one is willing to give any guarantees or make promises, but a rough idea on what I can expect would be good to have. Then we could decide whether we would want to try it or not.

Trac 1.5.4 is very stable and will be released soon as Trac 1.6. Plugin compatibility will be your main challenge.

RjOllos

unread,
May 10, 2023, 11:18:17 AM5/10/23
to Trac Users
On Monday, May 8, 2023 at 10:26:28 AM UTC+2 manuel.bild...@gmail.com wrote:
We have the following plugins installed as Ubuntu packages:
ii  trac-accountmanager                    0.5~r16056-1                                    all          account management plugin for Trac
ii  trac-customfieldadmin                  0.2.12+r15671-1                                 all          panel for administrating custom ticket fields in Trac
ii  trac-datefieldplugin                   0.7782-3.1                                      all          Add custom date fields to Trac tickets
ii  trac-graphviz                          0.7.5-1.1                                       all          Graphs printing plugin for Trac
ii  trac-icalviewplugin                    0.7889-1.1                                      all          Provides iCalendar feeds for ticket queries
ii  trac-mastertickets                     3.0.2+20111224-2                                all          adds inter-ticket dependencies to Trac
ii  trac-tags                              0.7+svn12392-1                                  all          Tagging plugin for Trac wiki and issue tracking system
ii  trac-wikitablemacro                    1:0.3-1                                         all          SQL Table in Wiki Page for Trac
ii  trac-wysiwyg                           0.12.0.7-1                                      all          WYSIWYG style editor for the Trac issue tracking system

I guess some are obsolete, e.g. trac-mastertickets isn't used, as we also have the following installed:
BatchModify-0.8.0_trac0.12-py2.6.egg
TicketValidator-0.2dev-py2.7.egg
TracHtmlNotificationPlugin-0.12.0.3-py2.7.egg
Tracchildtickets-2.5.5-py2.7.egg

and looks like icalviewplugin, tags , wysiwyg, graphviz, wikitablemacro and datefieldplugin aren't currently enabled either. 

Right, TracDateField isn't needed as of Trac 1.2. See notice at top of the page:
 

So, the ones we currently definitely use and I didn't see mentioned yet are:
BatchModify
TicketValidator (but I do see TicketValidation mentioned by Dan...)

Does anyone of you have any experience with these on Trac 1.5.4?

If the wiki page is tagged with 1.6, it should work. This is true for TracTicketValidator:

Full list here:

You may need to pip install directly from the SVN repository in some cases, like with TracAccountManager.

My strongest recommendation is to start small and build up. Setup Trac 1.5.4 and migrate your data. Add plugins one at a time and test them. Only add what you need because the more plugins you have the more likely one of them will interact poorly or break the site due to a defect or incompatibility,

Reply all
Reply to author
Forward
0 new messages