Skip to content

Instantly share code, notes, and snippets.

@st63jun
Created December 20, 2016 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save st63jun/e2fd3d7597ef16f4c6b31f76d5112a72 to your computer and use it in GitHub Desktop.
Save st63jun/e2fd3d7597ef16f4c6b31f76d5112a72 to your computer and use it in GitHub Desktop.
AMaViS virus sender whitelisting hack
--- /usr/sbin/amavisd.orig 2016-12-20 17:47:33.587273253 +0900
+++ /usr/sbin/amavisd 2016-12-20 18:18:18.257693185 +0900
@@ -13926,7 +13926,8 @@
$r->recip_is_local($is_local ? 1 : 0); # canonical boolean, untainted
if (!defined($r->bypass_virus_checks)) {
my $bypassed_v = lookup2(0,$recip, ca('bypass_virus_checks_maps'));
- $r->bypass_virus_checks($bypassed_v);
+ my $whitelisted_v = lookup2(0,$sender, ca('whitelist_sender_maps'));
+ $r->bypass_virus_checks($whitelisted_v || $bypassed_v);
}
if (!defined($r->bypass_banned_checks)) {
my $bypassed_b = lookup2(0,$recip, ca('bypass_banned_checks_maps'));
@st63jun
Copy link
Author

st63jun commented Dec 20, 2016

Tested on amavisd-new-2.10.1-4.el7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment