[Mimedefang] whitelist_from_rcvd question
mimedefang at nabs.net
Tue Jun 10 15:22:02 EDT 2008
On 10 Jun 2008 at 14:23, Jason Bertoch wrote:
> Since we all know Comcast will never grow a clue, I'm left with whitelisting
> the sender. However, it seems to me that MD ought to generate a header I
> can work with and choose the final action. If the header isn't generated
> with the all information given to it from sendmail, I lose that ability. I
> would certainly prefer that the sender fix their end, but I need to be able
> to create workarounds.
> Is this a limitation of the milter interface, or is it a feature request for
> MD? I'm certainly aware that the decision to have MD work the way it does
> was made for a reason...I just looking for options.
One solution to this is to not send the message to SA at all if the
message comes from that IP address. This is an easy change to your
filter that has been discussed many times here.
Another alternative if you don't want to completely avoid SA for e-mail
from that relay is to send to SA but then adjust the score (and maybe
even the hits list) after the fact for any messages from that relay IP
address, something like this:
my ($hits, $req, $names, $report) = spam_assassin_check();
if ($RelayAddr == '18.104.22.168')
$hits -= 100; # use whatever value you want for a whitelist bias
$names .= ',USER_IN_WHITELIST';
$score_reject = 10;
$score_graph = "." x int($hits);
if ($hits < $score_reject)
# We add a header which looks like this:
# X-Spam-Score: ...... (6.8) NAME_OF_TEST,NAME_OF_TEST
# The number of periods is the integer part
# of the spam score clamped to a maximum of $score_reject.
# MUA filters can easily be written to trigger on a
# minimum number of periods...
if ($hits >= $req)
action_change_header("X-Spam-Score", "$score_graph ($hits) $names");
# Add the SA report
action_add_part($entity, "text/plain", "-suggest",
action_reject("Refused: message is spam");
Jeff Rife | "I once did a news report on the dangers of
| plastic surgery, and do you know what the
| statistics say?"
| "Yes...that 9 out of 10 men prefer women
| with big boobs."
| "And the 10th guy preferred the 9 other men."
| -- "Just Shoot Me"
More information about the MIMEDefang