<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Retention Configuration]]></title><description><![CDATA[<p dir="auto">Continuing the discussion from <a href="https://forum.cloudron.io/post/85087">What happens in the matrix channels where there are no more users ? Where goes the messages ? #8</a></p>
<p dir="auto">I want to set up a maximum retention in order to keep the memory footprint low. To do so I added the following lines to my <code>homeserver.yaml</code> and am now waiting to see what it will actually do [1] :</p>
<pre><code>retention:
  enabled: true # enables the retention, is enough to enforce it once per day
  default_policy:
    min_lifetime: 1d
    max_lifetime: 4w
media_retention:
  local_media_lifetime: 4w
  remote_media_lifetime: 4w
</code></pre>
<p dir="auto">My first observation is that nothing appears in the room state. I started a new conversation with a <a href="http://matrix.org" target="_blank" rel="noopener noreferrer nofollow ugc">matrix.org</a> user and no default <code>m.room.retention</code> appears in the room state after its creation. <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f914.png?v=63dea4eef9f" class="not-responsive emoji emoji-android emoji--thinking_face" style="height:23px;width:auto;vertical-align:middle" title=":thinking_face:" alt="🤔" /></p>
<ul>
<li>Does the other server (<a href="http://matrix.org" target="_blank" rel="noopener noreferrer nofollow ugc">matrix.org</a>) need to enable the setting as well ?</li>
<li>Is this only for purging empty rooms, not about auto-deleting old messages ?</li>
</ul>
<p dir="auto">Thanks for any info on the topic.</p>
<p dir="auto">[1] Source: <a href="https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html#retention" target="_blank" rel="noopener noreferrer nofollow ugc">https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html#retention</a> (link could be updated in the docs)</p>
]]></description><link>https://forum.cloudron.io/topic/15736/retention-configuration</link><generator>RSS for Node</generator><lastBuildDate>Mon, 24 Aug 2026 03:43:32 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/15736.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 27 Jul 2026 20:38:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Retention Configuration on Wed, 29 Jul 2026 13:20:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mononym" aria-label="Profile: mononym">@<bdi>mononym</bdi></a> Yes, essentially. A federated room is not stored only on the homeserver where it was created. Each homeserver with participating users receives and stores its own copy of the room events for its local members. <strong>The originating server is not a central or authoritative host for the room.</strong></p>
<p dir="auto">A newly joining homeserver does not necessarily receive every historical event immediately, but it can request available history from other participating servers, subject to the room's history visibility and federation rules.</p>
<p dir="auto">Therefore, Synapse retention is not a remote-delete mechanism. Your <code>default_policy</code> controls only what your own homeserver serves to clients and eventually keeps in its database. If <code>matrix.org</code>, or another participating homeserver, does not enforce equivalent retention, it may retain its own copy of the history. In an encrypted room that copy is ciphertext, but clients that still have the encryption keys may be able to decrypt it.</p>
<p dir="auto">A room-level <code>m.room.retention</code> state event is federated and can communicate the intended policy to participating servers, but enforcement still depends on each homeserver supporting and honoring it. It should not be treated as a guarantee that every copy disappears everywhere.</p>
<p dir="auto">Small correction to my previous reply: current Synapse versions use a default purge-job configuration when retention is enabled and no explicit <code>purge_jobs</code> section is provided. Adding <code>purge_jobs</code> is useful when you want to control the purge interval, but it is not strictly required.</p>
]]></description><link>https://forum.cloudron.io/post/127406</link><guid isPermaLink="true">https://forum.cloudron.io/post/127406</guid><dc:creator><![CDATA[andreasdueren]]></dc:creator><pubDate>Wed, 29 Jul 2026 13:20:23 GMT</pubDate></item><item><title><![CDATA[Reply to Retention Configuration on Wed, 29 Jul 2026 08:12:02 GMT]]></title><description><![CDATA[<p dir="auto">Thank you <a class="plugin-mentions-user plugin-mentions-a" href="/user/andreasdueren" aria-label="Profile: andreasdueren">@<bdi>andreasdueren</bdi></a> for the solution and all the extra explanation!</p>
<p dir="auto">Do you know how synapse handles on which server a room is stored? Are the rooms solely on the server which initiated the conversation or are they mirrored across servers? Would that not mean that a room history is potentially always available if one of the servers does not enable the retention setting?</p>
]]></description><link>https://forum.cloudron.io/post/127400</link><guid isPermaLink="true">https://forum.cloudron.io/post/127400</guid><dc:creator><![CDATA[mononym]]></dc:creator><pubDate>Wed, 29 Jul 2026 08:12:02 GMT</pubDate></item><item><title><![CDATA[Reply to Retention Configuration on Mon, 27 Jul 2026 21:14:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mononym" aria-label="Profile: mononym">@<bdi>mononym</bdi></a> Your config is actually valid, the confusion is about what it does and how to verify it, plus one gotcha that means it may silently not work at all.</p>
<p dir="auto">What the retention: block does: it <strong>server-side purges old message history in rooms, based on lifetime settings</strong>. It has nothing to do with purging empty/abandoned rooms.</p>
<p dir="auto">Why nothing appears in room state: that's expected. A server-level default_policy never creates m.room.retention state events, it's purely a homeserver-internal default applied when a room has no policy of its own. You'll only see an m.room.retention event if someone explicitly sets a per-room policy. So "nothing in room state" doesn't mean it isn't working.</p>
<p dir="auto">Does <a href="http://matrix.org" target="_blank" rel="noopener noreferrer nofollow ugc">matrix.org</a> need it too? For your goal (keeping your server's disk usage down), no. Retention purges are local. Your server deletes its own copies. But note other servers keep their own copies of federated rooms; retention is not remote deletion.</p>
<p dir="auto">The gotcha: the daily purge job only runs if <code>retention.purge_jobs</code> is configured. With just <code>enabled: true</code> and a <code>default_policy</code>, some Synapse versions won't schedule any purge job. Add one explicitly:</p>
<pre><code>retention:
  enabled: true
  default_policy:
    min_lifetime: 1d
    max_lifetime: 4w
  purge_jobs:
    - interval: 1d
</code></pre>
<p dir="auto">How to verify it's working: don't watch room state, watch the Synapse log for purge_history / "Purging" entries after the job interval elapses, and compare your Postgres DB size (events table) over a couple of weeks.</p>
<p dir="auto">If what you actually want is <strong>cleaning up dead/empty rooms</strong> (rooms everyone has left), retention is the wrong tool. Use these two settings instead:</p>
<p dir="auto"><code>forget_rooms_on_leave: true</code><br />
<code>forgotten_room_retention_period: 28d</code></p>
<p dir="auto">Rooms get auto-forgotten when users leave, and once every local user has forgotten a room, Synapse's daily background task purges it from the DB entirely. This removes abandoned rooms without touching history in rooms people are still using.</p>
<p dir="auto">Both work fine on the Cloudron Synapse package via /app/data/configs/homeserver.yaml + app restart.</p>
]]></description><link>https://forum.cloudron.io/post/127268</link><guid isPermaLink="true">https://forum.cloudron.io/post/127268</guid><dc:creator><![CDATA[andreasdueren]]></dc:creator><pubDate>Mon, 27 Jul 2026 21:14:12 GMT</pubDate></item></channel></rss>