On 6/26/25 15:12, Mark wrote:

On 2025-06-26 16:10, Mark Sapiro wrote:

What does the database query
```
SELECT uri FROM template WHERE name = 'list:member:regular:footer' AND
context = '<IDENTIFIER>';
```
return?

=================================

The result of the query is:
+---
uri
+----
http://localhost:8000/mailman3/api/templates/list/<IDENTIFIER>/list:member:regular:footer
+----

I should have also said, if I delete the template, emails still use the old footer -- not the Mailman default as I would have expected.


As long as there is an entry in the template table with a uri which is not a `mailman://` scheme, that entry is cached in the file_cache table in the database with a key = the uri and a lifetime set by cache_life in the [mailman] section of mailman.cfg - default 7 days.

You can delete the cached entry from the database via `mailman shell as in
```
$ mailman shell
Welcome to the GNU Mailman shell
Use commit() to commit changes.
Use abort() to discard changes since the last commit.
Exit with ctrl+D does an implicit commit() but exit() does not.

>>> cm = getUtility(ICacheManager)
>>> uri = 'the_uri_from_the_template_table'
>>> cm.get(uri, expunge=True)
>>> commit()
```

You can also delete the entry from the file_cache table, but if you do that, the actual file containing the cached data will remain. To remove it, note that the file_cache table entry has a file_id. This will be a hex digest of the sha256 hash of the uri, something like `c85210810f8824cf9227c1689817e1d081046ff132bf8abe56a7c08a89016e4e` and the file is stored in the cache/ directory in Mailman's var/ directory with a path of `file_id[0:2]/file_id[2:4]/file_id`. I.e. for the above example file_id, the file will be `var/cache/c8/52/c85210810f8824cf9227c1689817e1d081046ff132bf8abe56a7c08a89016e4e`.

If you remove the entry from the file_cache table without removing the file, the file will remain forever but will be overwritten if the same uri is cached again.

Rather than doing any of the above, if you want to manipulate the database, just set the expires_on column in the file_cache table entry to a date in the past.

--
Mark Sapiro <m...@msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

_______________________________________________
Mailman-users mailing list -- mailman-users@mailman3.org
To unsubscribe send an email to mailman-users-le...@mailman3.org
https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
Archived at: 
https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/E4FK3LS62ML55UV3Z76TFITW4HYZU3GM/

This message sent to arch...@mail-archive.com

Reply via email to