procmail
[Top] [All Lists]

Re: Using 'procmail -m ...' (question)

2004-10-28 12:21:15
On Thu, Oct 28, 2004 at 07:44:08PM +0200, Dallman Ross wrote:
On Thu, Oct 28, 2004 at 12:08:05PM -0400, William Park wrote:
On Thu, Oct 28, 2004 at 10:29:57AM +0200, Dallman Ross wrote:
Have you set $DEFAULT anywhere?  Such as inside testforspam.rc?

No, the recipe contains just the above.  With VERBOSE=on, I get (from
memory)
    Folder:  **Bounced**
at the end.

That implies to me that the compiled-in path to $DEFAULT is wrong
and procmail can't deliver.  You should recompile with the right
path to $DEFAULT; and you should, in your test rc, either (re-) set
$DEFAULT to /dev/null or unset $HOST at the end.


Since my post, I experimented with EXITCODE, and I found that's the key.
Now, I have something like

    EXITCODE=1
    
    :0
    * ...
    { EXITCODE=0 }

    :0
    * EXITCODE ?? 0
    spam
    :0
    /dev/null

I wouldn't recommend doing it that way, just because it's
unnecessarily awkward.

How do you return success (0) or failure, then?  I need that, so I can
test for it in my script, like
    if cat ... | procmail -f - testforspam.rc; then
        ...
    fi
If it also saves the spam headers to a file, that's bonus, because
that's one less line in my script.  At the moment, I have

    EXITCODE=1
    DEFAULT=/dev/null

    :0
    * ...
    { EXITCODE=0 }      # I would have many of these in real recipes

    :0
    * EXITCODE ?? 0
    spam

-- 
William Park <opengeometry(_at_)yahoo(_dot_)ca>
Open Geometry Consulting, Toronto, Canada

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail