trying to setup a spam filter with procmail 3.22 (compiled from procmail.org)
and solaris 2.8
I get error messages.
I copied the code from a magazine and modified it (replacing the content of
variables with lists in files)
trying to fgrep or egrep the contents of this lists mostly I get an error:
/usr/bin/sh <regex> cannot open
It seems that it depends on the content of the pattern to match on if I get the
error or not.
I send a code exampel and two logfile exampels one with the error one without.
code snipped:
file /etc/procmailrc:
LOG=`type mktemp`
LOG=`type mimencode`
VERBOSE=off
TZ='CET-1CEST-2'
DATUM=`date '+%d. %T'`
BACKUPD=`date '+%Y%m%d'`
SHELL=/usr/bin/sh
PATH=/usr/bin:$PATH:/usr/sbin:/usr/ucb:/usr/local/procmail/bin
LOCKFILE=$HOME/.lockmail
#
# -------------------------- begin SPAM-Settings -----------------------------
#
PASSWD='/etc/passwd' # Passwort-Datei enthaelt Mail-Accounts und
-Adressen
CACHE="/etc/procmail/cache" #
MY_ACCOUNT=$LOGNAME # aktueller Account
MY_MAILHOST=minerva.sicad.de # Hostname des Mail-Servers
GUTESENDER=/etc/procmail/Gute_Sender.txt # Whitelist Absender
GUTEDOMAIN=/etc/procmail/Gute_Domain.txt # Whitelist Domains
MAILINGLISTEN=/etc/procmail/Gute_Mailing-Listen.txt # (Whitelist) Mailinglisten
SPAMFOLDER="/var/mail/spamtrap" # Folder für Spam-verdächtige Mail
XXL_SIZE=100000 # Mails ab dieser Größe weniger genau untersuchen
DELETE="/var/mail/spamtrap" # Löschen nur bei eindeutiger Lage: #
"/dev/null"
LF="
" # Zeilenumbruch für übersichtlichere Log-Datei
...
INCLUDERC=/etc/procmail/local-rules.spam
...
DROPPRIVS=YES
------------------------------------------------
file local-rules.spam:
VERBOSE=on
...
:0
* ^To:[ ]*\/[^ ].*
{ MLISTE=$MATCH }
:0
* $ ? fgrep -is -- "${MLISTE}" $MAILINGLISTEN
{ CHECK="-OK-LISTE: $MATCH$LF$CHECK" }
...
---------------------------------
procmail.log: exampel 1 with error message 'cannot open'
procmail: Assigning "MATCH="
procmail: Matched ""Dragan Crnjac" <dragan(_dot_)crnjac(_at_)sicad(_dot_)de>"
procmail: Match on "^To:[ ]*\/[^ ].*"
procmail: Assigning "MLISTE="Dragan Crnjac"
<dragan(_dot_)crnjac(_at_)sicad(_dot_)de>"
procmail: Executing " fgrep -is -- "Dragan Crnjac"
<dragan(_dot_)crnjac(_at_)sicad(_dot_)de> /etc/procmail/Gute_Mailing-Listen.txt"
/usr/bin/sh: dragan(_dot_)crnjac(_at_)sicad(_dot_)de: cannot open
procmail: Non-zero exitcode (1) from " fgrep -is -- "Dragan Crnjac"
<dragan(_dot_)crnjac(_at_)sicad(_dot_)de> /etc/procmail/Gute_Mailing-Listen.txt"
procmail: No match on " fgrep -is -- "Dragan Crnjac"
<dragan(_dot_)crnjac(_at_)sicad(_dot_)de> /etc/procmail/Gute_Mailing-Listen.txt"
---------------------------------
procmail.log exampel 2 without error message
procmail: Assigning "MATCH="
procmail: Matched "suse-linux(_at_)suse(_dot_)com"
procmail: Match on "^To:[ ]*\/[^ ].*"
procmail: Assigning "MLISTE=suse-linux(_at_)suse(_dot_)com"
procmail: Executing
"fgrep,-is,--,suse-linux(_at_)suse(_dot_)com,/etc/procmail/Gute_Mailing-Listen.txt"
procmail: Match on "fgrep -is -- suse-linux(_at_)suse(_dot_)com
/etc/procmail/Gute_Mailing-Listen.txt"
procmail: Assigning "CHECK=-OK-LISTE: suse-linux(_at_)suse(_dot_)com
What is wrong with my recipe or better how to change the script so that it
works always correct ?
Michael
--
+---- Michael Meltzer ---+-----------------------------------------+
| SICAD GEOMATICS | EMail : Michael(_dot_)Meltzer(_at_)sicad(_dot_)de
|
| Lilienthal-Str. 7 | Phone : +49-89-45026-108 |
| 85579 Neubiberg | Fax : +49-89-45026-113 |
+------------------------+-----------------------------------------+
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail