clamsmtp: drop (#408043)

This commit is contained in:
Atemu
2025-05-18 16:11:16 +02:00
committed by GitHub
7 changed files with 6 additions and 243 deletions
@@ -22,4 +22,4 @@
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
- Create the first release note entry in this section!
- `services.clamsmtp` is unmaintained and was removed from Nixpkgs.
-1
View File
@@ -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
+4
View File
@@ -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"
)
-189
View File
@@ -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 ];
}
@@ -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 <linux/netfilter_ipv4.h>
-#endif
-
#include "compat.h"
#include "sock_any.h"
#include "stringx.h"
#include "sppriv.h"
+#ifdef LINUX_TRANSPARENT_PROXY
+#include <linux/netfilter_ipv4.h>
+#endif
+
/* -----------------------------------------------------------------------
* STRUCTURES
*/
-27
View File
@@ -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;
};
}
+1
View File
@@ -436,6 +436,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