From 04a64c37104c2a705cabf3cefca4d6c6dfb405e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Bourdeauducq?= Date: Thu, 24 Oct 2024 15:49:41 +0800 Subject: [PATCH] nixbld: set up RT for m-labs-intl.com --- nixbld-etc-nixos/configuration.nix | 13 ++++++++++++- nixbld-etc-nixos/rt.nix | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/nixbld-etc-nixos/configuration.nix b/nixbld-etc-nixos/configuration.nix index f6873794..60350cb8 100644 --- a/nixbld-etc-nixos/configuration.nix +++ b/nixbld-etc-nixos/configuration.nix @@ -1249,7 +1249,18 @@ in Restart = "on-failure"; User = "rt"; Group = "rt"; - ExecStart = "${pkgs.bash}/bin/bash -c 'PATH=${pkgs.rt}/bin HOME=/tmp ${pkgs.fetchmail}/bin/fetchmail -f /etc/nixos/secret/rt_fetchmailrc'"; + ExecStart = "${pkgs.bash}/bin/bash -c 'PATH=${pkgs.rt}/bin HOME=/tmp ${pkgs.fetchmail}/bin/fetchmail --pidfile /tmp/.fetchmail.pid -f /etc/nixos/secret/rt_fetchmailrc'"; + }; + }; + systemd.services.rt-fetchmail-intl = { + description = "Fetchmail for RT (intl)"; + wantedBy = [ "multi-user.target" ]; + after = [ "dovecot2.service" ]; + serviceConfig = { + Restart = "on-failure"; + User = "rt"; + Group = "rt"; + ExecStart = "${pkgs.bash}/bin/bash -c 'PATH=${pkgs.rt}/bin HOME=/tmp ${pkgs.fetchmail}/bin/fetchmail --pidfile /tmp/.fetchmail-intl.pid -f /etc/nixos/secret/rt_fetchmailrc_intl'"; }; }; diff --git a/nixbld-etc-nixos/rt.nix b/nixbld-etc-nixos/rt.nix index 30b8e5a0..8dda5f56 100644 --- a/nixbld-etc-nixos/rt.nix +++ b/nixbld-etc-nixos/rt.nix @@ -30,7 +30,7 @@ let Set($OwnerEmail, '${cfg.ownerEmail}'); Set($MaxAttachmentSize, 15360000); Set($CheckMoreMSMailHeaders, 1); - Set($RTAddressRegexp, '^(helpdesk|sales)\@(m-labs.hk)$'); + Set($RTAddressRegexp, '^(helpdesk)\@(m-labs.hk|m-labs-intl.com)$'); Set($LoopsToRTOwner, 0); # System (Outgoing mail)