public inbox for pgsql-www@postgresql.org
help / color / mirror / Atom feedFrom: Célestin Matte <contact@cmatte.me>
To: PostgreSQL WWW <pgsql-www@lists.postgresql.org>
Subject: pglister: pgarchives does not synchronize subscribers with email delivery disabled (proposed patch)
Date: Mon, 22 Sep 2025 20:12:35 +0200
Message-ID: <b39abaaf-00f0-47b9-b819-3b22d83a67d8@cmatte.me> (raw)
The pglister_sync script is supposed to synchronize subscribers from pglister to pgarchives, so they can access archives.
From what I understand of its semantics, the "nomail" field (labeled "Disable mail delivery") is used to remain subscribed, to be able to access archives, without receiving emails.
However, due to the way the API works, this is not the case. pglister_sync.py makes a call to the API, which get subscribers from the mailinglist_subscribers SQL view. This view is built in the 0027_merge_migrations.py migrations and excludes users with nomail.
I propose a patch with a migration to change this SQL view to include nomail users (copying previous definition, without "AND NOT nomail").
Note that this changes results of the API, which might have consequences if other scripts use it (I haven't found any with some grepping).
--
Célestin Matte
Attachments:
[text/x-patch] 0001-Include-nomail-users-in-API-call-results.patch (1.6K, 2-0001-Include-nomail-users-in-API-call-results.patch)
download | inline diff:
From 37ad3abc2887f28f118d1ae478e704698b731c3b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9lestin=20Matte?= <dev@cmatte.me>
Date: Mon, 22 Sep 2025 19:57:21 +0200
Subject: [PATCH] Include nomail users in API call results
Otherwise, pgarchives's pglister_sync won't give access to these users
---
...60_fix_mailinglist_subscribers_sql_view.py | 28 +++++++++++++++++++
1 file changed, 28 insertions(+)
create mode 100644 web/pglister/lists/migrations/0060_fix_mailinglist_subscribers_sql_view.py
diff --git a/web/pglister/lists/migrations/0060_fix_mailinglist_subscribers_sql_view.py b/web/pglister/lists/migrations/0060_fix_mailinglist_subscribers_sql_view.py
new file mode 100644
index 0000000..5f49e48
--- /dev/null
+++ b/web/pglister/lists/migrations/0060_fix_mailinglist_subscribers_sql_view.py
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('lists', '0059_rfc8058'),
+ ]
+
+ operations = [
+ migrations.RunSQL("""
+CREATE OR REPLACE VIEW mailinglist_subscribers AS
+ SELECT list_id AS listid,
+ ls.subscriber_id AS subscriberaddress_id,
+ email,
+ eliminatecc,
+ token,
+ s.user_id AS userid,
+ (SELECT array_agg(listtag_id) FROM lists_listsubscription_tags lst WHERE lst.listsubscription_id=ls.id) AS tags
+ FROM lists_listsubscription ls
+ INNER JOIN lists_subscriberaddress sa ON sa.id=ls.subscriber_id
+ LEFT JOIN lists_subscriber s ON s.user_id=sa.subscriber_id
+ WHERE confirmed AND subscription_confirmed
+"""),
+ ]
--
2.51.0
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-www@postgresql.org
Cc: contact@cmatte.me, pgsql-www@lists.postgresql.org
Subject: Re: pglister: pgarchives does not synchronize subscribers with email delivery disabled (proposed patch)
In-Reply-To: <b39abaaf-00f0-47b9-b819-3b22d83a67d8@cmatte.me>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox