On Fri, 2013-05-10 at 08:57 -0700, psychobyte wrote: > So i was able to write a plugin that overrides the AWL > check_from_in_auto_whitelist() eval rule. Thanks for the help Karsten.
You're welcome. Was actually fun digging through the code. > # awl_ignore_from postmaster mailer-daemon Configuration option, nice, yeah. > ## Overridden AWL params > # > # header AWL eval:awl_ignore_check_from_in_auto_whitelist() > # describe AWL From: address is in the auto white-list > # tflags AWL userconf noautolearn > # priority AWL 1000 > # Replace check_from_in_auto_whitelist() > # > sub awl_ignore_check_from_in_auto_whitelist { > my ($self, $pms) = @_; [...] > ## ignore addresses in awl_ignore_from > foreach (keys %{$pms->{conf}->{awl_ignore_from}}) { > if ($from =~ /$_\@/) { > dbg("auto-whitelist: AWL ignoring ". $from); > return 0; > } > } > > # find the earliest usable "originating IP". ignore private nets > my $origip; Whoa, is this... Yes, a copy of the check_from_in_auto_whitelist() function from the AWL plugin. Code duplication. Any reason you didn't just hack the AWL.pm code? All you would need is the contents of your plugin's sub set_config, and the single foreach loop doing the actual work. Slightly more than 10 lines, including your POD. (Yay for that, btw!) No overriding of the existing AWL rule definition, just a single conf line. No naughty code duplication. -- char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4"; main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1: (c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}