This patch makes mod_evasive to find and use the Slackware default mailer (mailx) in the proper way.
Thanks to Roberto Corrado

--- ./mod_evasive24.c	2025-02-16 17:36:05.000000000 +0100
+++ ./mod_evasive24.c	2026-08-17 21:09:51.000000000 +0200
@@ -45,7 +45,8 @@
 
 AP_DECLARE_MODULE(evasive);
 
-#define MAILER  "/bin/mail %s"
+/* #define MAILER  "/bin/mail %s" */
+#define MAILER  "/usr/bin/mailx -s \"HTTP Blacklist %s\" %s"
 
 #define DEFAULT_HASH_TBL_SIZE   3079UL  // Default hash table size
 #define DEFAULT_PAGE_COUNT      2       // Default maximum page hit count per interval
@@ -549,11 +550,12 @@
 
                     ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, "Blacklisting address %s: possible DoS attack.", r->useragent_ip);
                     if (cfg->email_notify != NULL) {
-                        snprintf(filename, sizeof(filename), MAILER, cfg->email_notify);
+                        /*snprintf(filename, sizeof(filename), MAILER, cfg->email_notify);*/
+                        snprintf(filename, sizeof(filename), MAILER, r->useragent_ip, cfg->email_notify);
                         file = popen(filename, "w");
                         if (file != NULL) {
-                            fprintf(file, "To: %s\n", cfg->email_notify);
-                            fprintf(file, "Subject: HTTP BLACKLIST %s\n\n", r->useragent_ip);
+                            /*fprintf(file, "To: %s\n", cfg->email_notify);*/
+                            /*fprintf(file, "Subject: HTTP BLACKLIST %s\n\n", r->useragent_ip);*/
                             fprintf(file, "mod_evasive HTTP Blacklisted %s\n", r->useragent_ip);
                             pclose(file);
                         }


