summary refs log tree commit diff
path: root/fleet/hosts/trieste/lists.nix
blob: a4e9a69ac7d84fd3ace174d4c7f02ad5158ba79a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# SPDX-FileCopyrightText: V <v@unfathomable.blue>
# SPDX-License-Identifier: OSL-3.0

{ lib, pkgs, ... }:

with lib;

{
  # Block HTML e-mail
  # FIXME(V): This is global, and will affect anyone sending HTML mail to e.g. postmaster@
  # We should fix this, and limit it to just the list: this is possible using http://mlmmj.org/docs/readme-access/
  # Unfortunately this doesn't let us pick an error message, though. So maybe not.
  services.postfix = {
    enableHeaderChecks = true;
    headerChecks = [
      {
        pattern = ''/^Content-Type: text\/html/'';  # This feels kind of brittle, but should work in 99% of cases.
        action = "REJECT HTML e-mail is not allowed on this list. See https://useplaintext.email/ for more information.";
      }
    ];
  };

  services.mlmmj = {
    enablePostfix = true;
    enablePublicInbox = true;

    control.customheaders = [ "X-Clacks-Overhead: GNU Terry Pratchett" ];

    lists."lists.unfathomable.blue" = {
      ripple-announce = {
        description = "Progress updates and other major announcements about Ripple";
        moderators = [
          "v@unfathomable.blue"
          "edef@unfathomable.blue"
        ];
        # FIXME(V): This doesn't have quite the effect I was looking for.
        # It submits non-moderator posts for review, rather than outright rejecting them as I'd wanted.
        # Perhaps this is good, though, as it allows guest posts?
        # Downside is there's no immediate rejection, so the user is left with the impression that their mail disappeared…
        # Maybe http://mlmmj.org/docs/readme-access/ would be more appropriate?
        control.modonlypost = true;
      };
      ripple-devel.description = "Technical discourse and patches for Ripple";
      ripple-discuss.description = "General discussion about Ripple";
      # TODO(V): ripple-commits, read-only commit notifications
    };
  };

  # By default, the index 404s with the rather confusing message "no inboxes, yet", even when there are inboxes configured.
  services.public-inbox.settings.publicinbox.wwwlisting = "all";

  services.caddy.config = ''
    lists.unfathomable.blue {
      import common
      reverse_proxy unix//run/public-inbox/httpd.sock
    }
  '';
}