From 99398273f32c9c5313321ae5478af1e10aae25ef Mon Sep 17 00:00:00 2001 From: Leona Maroni Date: Sat, 17 May 2025 18:22:45 +0200 Subject: [PATCH 1/2] nixos/clamsmtp: drop drop as package is removed --- .../manual/release-notes/rl-2511.section.md | 2 +- nixos/modules/module-list.nix | 1 - nixos/modules/rename.nix | 4 + nixos/modules/services/mail/clamsmtp.nix | 189 ------------------ 4 files changed, 5 insertions(+), 191 deletions(-) delete mode 100644 nixos/modules/services/mail/clamsmtp.nix diff --git a/nixos/doc/manual/release-notes/rl-2511.section.md b/nixos/doc/manual/release-notes/rl-2511.section.md index e3e7bce9160a..7eada5536eb1 100644 --- a/nixos/doc/manual/release-notes/rl-2511.section.md +++ b/nixos/doc/manual/release-notes/rl-2511.section.md @@ -22,4 +22,4 @@ -- Create the first release note entry in this section! +- `services.clamsmtp` is unmaintained and was removed from Nixpkgs. diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 283d022293c5..fc9849ad37ad 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -713,7 +713,6 @@ ./services/logging/ulogd.nix ./services/logging/vector.nix ./services/mail/automx2.nix - ./services/mail/clamsmtp.nix ./services/mail/cyrus-imap.nix ./services/mail/davmail.nix ./services/mail/dkimproxy-out.nix diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index 94cf7428e09d..28c1ef3a6b49 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -102,6 +102,10 @@ in "services" "chronos" ] "The corresponding package was removed from nixpkgs.") + (mkRemovedOptionModule [ + "services" + "clamsmtp" + ] "The corresponding package was removed from nixpkgs.") (mkRemovedOptionModule [ "services" "confluence" ] "Atlassian software has been removed, as support for the Atlassian Server products ended in February 2024 and there was insufficient interest in maintaining the Atlassian Data Center replacements" ) diff --git a/nixos/modules/services/mail/clamsmtp.nix b/nixos/modules/services/mail/clamsmtp.nix deleted file mode 100644 index 6def179e5e10..000000000000 --- a/nixos/modules/services/mail/clamsmtp.nix +++ /dev/null @@ -1,189 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -let - cfg = config.services.clamsmtp; - clamdSocket = "/run/clamav/clamd.ctl"; # See services/security/clamav.nix -in -{ - ##### interface - options = { - services.clamsmtp = { - enable = lib.mkOption { - type = lib.types.bool; - default = false; - description = "Whether to enable clamsmtp."; - }; - - instances = lib.mkOption { - description = "Instances of clamsmtp to run."; - type = lib.types.listOf ( - lib.types.submodule { - options = { - action = lib.mkOption { - type = lib.types.enum [ - "bounce" - "drop" - "pass" - ]; - default = "drop"; - description = '' - Action to take when a virus is detected. - - Note that viruses often spoof sender addresses, so bouncing is - in most cases not a good idea. - ''; - }; - - header = lib.mkOption { - type = lib.types.str; - default = ""; - example = "X-Virus-Scanned: ClamAV using ClamSMTP"; - description = '' - A header to add to scanned messages. See {manpage}`clamsmtpd.conf(5)` for - more details. Empty means no header. - ''; - }; - - keepAlives = lib.mkOption { - type = lib.types.int; - default = 0; - description = '' - Number of seconds to wait between each NOOP sent to the sending - server. 0 to disable. - - This is meant for slow servers where the sending MTA times out - waiting for clamd to scan the file. - ''; - }; - - listen = lib.mkOption { - type = lib.types.str; - example = "127.0.0.1:10025"; - description = '' - Address to wait for incoming SMTP connections on. See - {manpage}`clamsmtpd.conf(5)` for more details. - ''; - }; - - quarantine = lib.mkOption { - type = lib.types.bool; - default = false; - description = '' - Whether to quarantine files that contain viruses by leaving them - in the temporary directory. - ''; - }; - - maxConnections = lib.mkOption { - type = lib.types.int; - default = 64; - description = "Maximum number of connections to accept at once."; - }; - - outAddress = lib.mkOption { - type = lib.types.str; - description = '' - Address of the SMTP server to send email to once it has been - scanned. - ''; - }; - - tempDirectory = lib.mkOption { - type = lib.types.str; - default = "/tmp"; - description = '' - Temporary directory that needs to be accessible to both clamd - and clamsmtpd. - ''; - }; - - timeout = lib.mkOption { - type = lib.types.int; - default = 180; - description = "Time-out for network connections."; - }; - - transparentProxy = lib.mkOption { - type = lib.types.bool; - default = false; - description = "Enable clamsmtp's transparent proxy support."; - }; - - virusAction = lib.mkOption { - type = with lib.types; nullOr path; - default = null; - description = '' - Command to run when a virus is found. Please see VIRUS ACTION in - {manpage}`clamsmtpd(8)` for a discussion of this option and its safe use. - ''; - }; - - xClient = lib.mkOption { - type = lib.types.bool; - default = false; - description = '' - Send the XCLIENT command to the receiving server, for forwarding - client addresses and connection information if the receiving - server supports this feature. - ''; - }; - }; - } - ); - }; - }; - }; - - ##### implementation - config = - let - configfile = - conf: - pkgs.writeText "clamsmtpd.conf" '' - Action: ${conf.action} - ClamAddress: ${clamdSocket} - Header: ${conf.header} - KeepAlives: ${toString conf.keepAlives} - Listen: ${conf.listen} - Quarantine: ${if conf.quarantine then "on" else "off"} - MaxConnections: ${toString conf.maxConnections} - OutAddress: ${conf.outAddress} - TempDirectory: ${conf.tempDirectory} - TimeOut: ${toString conf.timeout} - TransparentProxy: ${if conf.transparentProxy then "on" else "off"} - User: clamav - ${lib.optionalString (conf.virusAction != null) "VirusAction: ${conf.virusAction}"} - XClient: ${if conf.xClient then "on" else "off"} - ''; - in - lib.mkIf cfg.enable { - assertions = [ - { - assertion = config.services.clamav.daemon.enable; - message = "clamsmtp requires clamav to be enabled"; - } - ]; - - systemd.services = lib.listToAttrs ( - lib.imap1 ( - i: conf: - lib.nameValuePair "clamsmtp-${toString i}" { - description = "ClamSMTP instance ${toString i}"; - wantedBy = [ "multi-user.target" ]; - script = "exec ${pkgs.clamsmtp}/bin/clamsmtpd -f ${configfile conf}"; - after = [ "clamav-daemon.service" ]; - requires = [ "clamav-daemon.service" ]; - serviceConfig.Type = "forking"; - serviceConfig.PrivateTmp = "yes"; - unitConfig.JoinsNamespaceOf = "clamav-daemon.service"; - } - ) cfg.instances - ); - }; - - meta.maintainers = with lib.maintainers; [ ekleog ]; -} From 7238d0553f3f39cfdf8c4ddc2a70a2656d55f41d Mon Sep 17 00:00:00 2001 From: Leona Maroni Date: Sat, 17 May 2025 18:22:45 +0200 Subject: [PATCH 2/2] clamsmtp: drop --- pkgs/by-name/cl/clamsmtp/header-order.patch | 25 ------------------- pkgs/by-name/cl/clamsmtp/package.nix | 27 --------------------- pkgs/top-level/aliases.nix | 1 + 3 files changed, 1 insertion(+), 52 deletions(-) delete mode 100644 pkgs/by-name/cl/clamsmtp/header-order.patch delete mode 100644 pkgs/by-name/cl/clamsmtp/package.nix diff --git a/pkgs/by-name/cl/clamsmtp/header-order.patch b/pkgs/by-name/cl/clamsmtp/header-order.patch deleted file mode 100644 index 102ae0a471dd..000000000000 --- a/pkgs/by-name/cl/clamsmtp/header-order.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/common/smtppass.c b/common/smtppass.c -index d9be1ba..4a366f4 100644 ---- a/common/smtppass.c -+++ b/common/smtppass.c -@@ -60,15 +60,15 @@ - - #include "usuals.h" - --#ifdef LINUX_TRANSPARENT_PROXY --#include --#endif -- - #include "compat.h" - #include "sock_any.h" - #include "stringx.h" - #include "sppriv.h" - -+#ifdef LINUX_TRANSPARENT_PROXY -+#include -+#endif -+ - /* ----------------------------------------------------------------------- - * STRUCTURES - */ - diff --git a/pkgs/by-name/cl/clamsmtp/package.nix b/pkgs/by-name/cl/clamsmtp/package.nix deleted file mode 100644 index a54a48da5bc8..000000000000 --- a/pkgs/by-name/cl/clamsmtp/package.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ - lib, - stdenv, - fetchurl, -}: - -stdenv.mkDerivation rec { - pname = "clamsmtp"; - version = "1.10"; - - src = fetchurl { - url = "http://thewalter.net/stef/software/clamsmtp/${pname}-${version}.tar.gz"; - sha256 = "0apr1pxifw6f1rbbsdrrwzs1dnhybg4hda3qqhqcw7p14r5xnbx5"; - }; - - patches = [ ./header-order.patch ]; - - meta = with lib; { - description = "SMTP filter that allows to check for viruses using the ClamAV - anti-virus software"; - homepage = "http://thewalter.net/stef/software/clamsmtp/"; - license = licenses.bsd3; - maintainers = [ maintainers.ekleog ]; - mainProgram = "clamsmtpd"; - platforms = platforms.all; - }; -} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index e74c0cc4ecde..11f9de75ac5e 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -432,6 +432,7 @@ mapAliases { cloog = throw "cloog has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2024-09-13 cloog_0_18_0 = throw "cloog_0_18_0 has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2024-09-13 cloogppl = throw "cloogppl has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2024-09-13 + clamsmtp = throw "'clamsmtp' has been removed as it is unmaintained and broken"; # Added 2025-05-17 clang-sierraHack = throw "clang-sierraHack has been removed because it solves a problem that no longer seems to exist. Hey, what were you even doing with that thing anyway?"; # Added 2024-10-05 clang-sierraHack-stdenv = clang-sierraHack; # Added 2024-10-05 inherit (libsForQt5.mauiPackages) clip; # added 2022-05-17