procmail
[Top] [All Lists]

Re: fgrep problem...Im pulling my hair out.

2003-05-06 16:53:54
On Tue, May 06, 2003 at 04:38:32PM -0600, Linux wrote:

I have been using the following in /etc/procmailrc for the longest time:

USER=`echo $LOGNAME`

There is a $LOGNAME var in procmail already.


INCLUDERC=/opt2/users/vacation/${USER}

  INCLUDERC=/opt2/users/vacation/$LOGNAME

should work fine.

:0fw
* < 12000
| /usr/bin/spamc -f


:0
* ^X-Spam-Status: Yes
/var/log/SpamAss

Not sure why you are showing us the SA stuff, since it seems to work and
seems to have nothing whatever to do with your question.  But okay.
(It might have been clearer to have stated up-top what it is we are
supposed to be looking for before just copying a wide swath of your
rc.)


:0
* ? fgrep -isf /opt2/users/filters/${USER}_blocked_domains <-- This is for 
user defined filters
/var/log/SpamAss/


:0
* ? fgrep -isf /opt2/users/filters/${USER}_blocked_subjects <-- This is for 
user defined filters
/var/log/SpamAss


A couple of weeks ago, I went to the Maildir format and because of the custom 
calls, I wanted to keep procmail.
I installed the latest procmail modifying src/authenication.c

(Lines of 72 or fewer chars would be much appreciated, "Linux.")



That said, I am now using:

I am deleting the repeat of stuff that works and is not relevant to
your quesiton.

INCLUDERC=/home/imap/${USER}/.procmailrc
INCLUDERC=/opt2/users/vacation/${USER}

Are we in an /etc/procmailrc file?  If so, I don't think you should
be INCLUDERCing the user's own .procmailrc.  Are we running suid
root at this point?!  Anyway, I think you want to continue here
until the end and then SWITCHRC to the user's rc.

[. . . .]

:0
* ? fgrep -isf /opt2/users/filters/${USER}_blocked_domains
/var/log/SpamAss/Maildir/


:0
* ? fgrep -isf /opt2/users/filters/${USER}_blocked_subjects
/var/log/SpamAss/Maildir/



:0
*
Maildir/

You do not need an empty condition.  Just

        :0
        Maildir/

is fine.


[Reformatting unwrapped lines so I can even read what you wrote:]

Now get this.  The first fgrep (fgrep -isf
/opt2/users/filters/${USER}_blocked_domains) works like a charm The
second one (fgrep -isf /opt2/users/filters/${USER}_blocked_subjects)
will ALWAYS return a match regardless, if and only if.
/opt2/users/filters/${USER}_blocked_subjects exists.

A sample /opt2/users/filters/${USER}_blocked_subjects contains:

badword1
badword2
etc

fgrep is reporting a match even for "non-badword".

If I run this command line, it works as designed.

Let us see *the relevant parts of* your verbose logs.

-- 
dman

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail