Hey all. I've been following the recent discussion regarding adding
addresses to a whitelist, and I've gotten it working. I've also added
the blacklist side of the coin and all is fine. On that end of the
rope, anyway.
What I'm having trouble with is getting procmail to properly check
that list and set a condition variable based on the outcome.
I have a list of addresses for the blacklist and whitelist, with one
address on each line, no whitespace.
This is how I am attempting to verify a message against the lists:
###########################################
# ~/.proc_precheck: userlevel prechecking against
# black and whitelists
:0Bfhw
* ? formail -x From: -x Sender: -x Reply-To: -x Return-Path: -x To: |
egrep -is -f /home/leblanc/.mutt/whitelist | formail -Y -f -A "X-Whitelist:
keep it
:0A
{ WHITE=YES }
:0Bfhw
* WHITE ?? !YES
* ? formail -x From: -x Sender: -x Reply-To: -x Return-Path: -x To: |
egrep -is -f /home/leblanc/.mutt/blacklist | formail -Y -f -A "X-Blacklist:
toss it
:0A
{ FOLDER=trash }
###########################################
If this script returns to /etc/procmailrc with either of the variables
set, I'd like it to just skip the next INCLUDERC line (my spam
recipes) and just do the global stuff (adding a Lines: header then
deliver it).
I'll attach my /etc/procmailrc - it's not too big.
I know it's a wierd setup, but I'm delivering to an imap mailbox. If
set, FOLDER tells which folder the message should be dropped into. It
works. The only problem is getting the whitelist to work.
This is the relevant part of the procmail log:
-----------------------------------
procmail: Assigning "INCLUDERC=/home/leblanc/.proc_precheck"
procmail: Assigning "WHITELIST=/home/leblanc/.mutt/whitelist"
procmail: Assigning "BLACKLIST=/home/leblanc/.mutt/blacklist"
procmail: Executing " formail -x From: -x Sender: -x Reply-To: -x Return-Path:
-x To: | egrep -is -f /home/leblanc/.mutt/whitelist"
procmail: Non-zero exitcode (1) from " formail -x From: -x Sender: -x Reply-To:
-x Return-Path: -x To: | egrep -is -f /home/leblanc/.mutt/whitelist"
procmail: No match on " formail -x From: -x Sender: -x Reply-To: -x
Return-Path: -x To: | egrep -is -f /home/leblanc/.mutt/whitelist"
procmail: Match on ! "YES"
procmail: Executing " formail -x From: -x Sender: -x Reply-To: -x Return-Path:
-x To: | egrep -is -f /home/leblanc/.mutt/blacklist"
procmail: Non-zero exitcode (1) from " formail -x From: -x Sender: -x Reply-To:
-x Return-Path: -x To: | egrep -is -f /home/leblanc/.mutt/blacklist"
procmail: No match on " formail -x From: -x Sender: -x Reply-To: -x
Return-Path: -x To: | egrep -is -f /home/leblanc/.mutt/blacklist"
procmail: Match on ! "trash"
procmail: Match on ! "yes"
procmail: Assigning "INCLUDERC=/etc/myspamkillrc"
. . .
-----------------------------------
It looks to me like the whitelist check is botched somehow. This
particular entry should have matched on the whitelist check, but
didn't. The From header is:
From: Louis LeBlanc <leblanc(_at_)keyslapper(_dot_)org>
and I have verified that leblanc(_at_)keyslapper(_dot_)org is in the
whitelist.
Putting that header in a test file and executing the grep from the
commandline goes a follows:
$ egrep -is -f ~/.mutt/whitelist testheader.txt
From: Louis LeBlanc <leblanc(_at_)keyslapper(_dot_)org>
Any ideas why it doesn't seem to work from procmail?
Thanks!
Lou
--
Louis LeBlanc leblanc(_at_)keyslapper(_dot_)org
Fully Funded Hobbyist, KeySlapper Extrordinaire :)
http://www.keyslapper.org ԿԬ
All syllogisms have three parts, therefore this is not a syllogism.
procmailrc
Description: Text document