add graylisting

This commit is contained in:
2026-03-27 19:27:10 +01:00
parent b2fec3f7e8
commit 209af5f0e0

View File

@@ -208,11 +208,19 @@ BEGIN {
if (match($0, /[0-9](\.[0-9])+ [^;]+/)) s_reason = substr($0, RSTART, RLENGTH); if (match($0, /[0-9](\.[0-9])+ [^;]+/)) s_reason = substr($0, RSTART, RLENGTH);
else if (match($0, /[0-9]{3} [^;]+/)) s_reason = substr($0, RSTART, RLENGTH); else if (match($0, /[0-9]{3} [^;]+/)) s_reason = substr($0, RSTART, RLENGTH);
# --- NOVÁ LOGIKA PRE GREYLIST ---
s_stat = "REJECT"; scol = red;
if (index($0, "Greylisted") > 0) {
s_stat = "GREYLIST";
scol = yellow;
}
# --------------------------------
if (d_mode == 0 && length(s_reason) > 30) s_reason = substr(s_reason, 1, 27) ".."; if (d_mode == 0 && length(s_reason) > 30) s_reason = substr(s_reason, 1, 27) "..";
if ((f_filt == "" || index(f, f_filt) > 0) && (t_filt == "" || index(t, t_filt) > 0) && (i_filt == "" || i_filt == "NOQUEUE" || index("NOQUEUE", i_filt) > 0)) { if ((f_filt == "" || index(f, f_filt) > 0) && (t_filt == "" || index(t, t_filt) > 0) && (i_filt == "" || i_filt == "NOQUEUE" || index("NOQUEUE", i_filt) > 0)) {
printf "%s%-16s %s%-12s%s %s%-16s%s %-36s %-31s %s%-12s%s %s[%s]%s\n", printf "%s%-16s %s%-12s%s %s%-16s%s %-36s %-31s %s%-12s%s %s[%s]%s\n",
reset, full_time, red, "NOQUEUE", reset, gray, n_ip, reset, shorten(f, 35), shorten(t, 30), red, "REJECT", reset, yellow, s_reason, reset; reset, full_time, red, "NOQUEUE", reset, gray, n_ip, reset, shorten(f, 35), shorten(t, 30), scol, s_stat, reset, yellow, s_reason, reset;
} }
} }
}' > "$TMP_DATA" }' > "$TMP_DATA"