procmail
[Top] [All Lists]

error message 'cannot open' in recipe on solaris

2003-06-27 02:53:39
asked this question some days before and got one answer that could not help.

So trying again.


Setup a spam filter with procmail 3.22 (compiled from procmail.org) sendmail 
8.12.4 and solaris 2.8.

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 content of this lists. On some mails I get the 
error: /usr/bin/sh <regex> cannot open
(see procmail.log below).
It seems that the error depends on the content of the pattern to match on with 
fgrep.

The recipe is part of an includerc called from /etc/procmailrc



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'
CACHE="/etc/procmail/cache" 
MY_ACCOUNT=$LOGNAME
MY_MAILHOST=minerva.sicad.de
GUTESENDER=/etc/procmail/Gute_Sender.txt     # whitelist senders ok
GUTEDOMAIN=/etc/procmail/Gute_Domain.txt     # whitelist domains ok
MAILINGLISTEN=/etc/procmail/Gute_Mailing-Listen.txt # whitelist mailinglists ok
SPAMFOLDER="/var/mail/spamtrap"
XXL_SIZE=100000
DELETE="/var/mail/spamtrap"
LF="
"
...
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


Why the fgrep sometimes is passed to the shell without commas ?


What is wrong with my recipe or better how to change the script so that it 
works always correct ?

Any help appreciated


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