procmail
[Top] [All Lists]

Re: Having problems with a simple recipe, please help

2010-01-21 16:00:39
Hello:

Something like this better illustrates my purpose:

:0fw
| spamc

# Getting my email messages from the timecard app on iPhone.
:0:
{
        ORIGSUBJECT=`formail -c -xSubject:`
        $ORIGSUBJECT=TimeLogger Report  -- This is wrong, I'm just
illustrating the idea
        ${DEFAULT}
}

# Spamassassin Section
:0:
* ^X-Spam-Flag:.*YES
Spam

# Accept all the rest to your default mailbox
:0:
${DEFAULT}


Professional Software Engineering wrote:
At 13:24 2010-01-21 -0800, Alex Rodriguez wrote:
Recipe:

:0fw
| spamc

# Getting my email messages from the timecard app on iPhone.
:0:
{
        ORIGSUBJECT=`formail -c -xSubject:`
        * ^Subject:.TimeLogger Report
        ${DEFAULT}
}

This is not syntactically correct.  Besides, what is the purpose of
setting
ORIGSUBJECT if you're not DOING anything with it?

the singular dot before "TimeLogger" means exactly one character MUST be
there.  You probably want to match a bracketed space+tab, or anything with
TimeLogger following it.

# Getting my email messages from the timecard app on iPhone.
:0
{
         # if not USING this, just get rid of it.
         ORIGSUBJECT=`formail -c -xSubject:`

         :0:
         * ^Subject:[    ]*TimeLogger Report
         ${DEFAULT}
}



# Spamassassin Section
:0:
* ^X-Spam-Flag:.*YES*

The trailing asterisk means zero or more 'S'.  If you're matching for YES,
drop the trailing asterisk.

# Accept all the rest to your default mailbox
:0:
${DEFAULT}

Which, uhm, is where it'd go if you simply don't do anything at the bottom
of your procmailrc.  That's why it's called DEFAULT.


You could condense your entire post to something like:

# filter through spamc if the subject DOES NOT match
:0fw
* ! ^Subject:[  ]*TimeLogger Report
| spamc

# Check for and file spam flagged messages only if WE scanned.
:0A:
* ^X-Spam-Flag:.*YES
Spam

# messages still with us will go to default


... and here is a snippet of the log:

Those SKIPPED bits are because your condition and action are not properly
preceeded by a flag line (the :0 bit).


---
  Sean B. Straw / Professional Software Engineering

  Procmail disclaimer:
<http://www.professional.org/procmail/disclaimer.html>
  Please DO NOT carbon me on list replies.  I'll get my copy from the
list.

____________________________________________________________
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



Regards,
Alex Rodriguez



-----------------------------------------
Spectrecom Corporation.
PO Box 950096.
Mission Hills, California 91395.

Phone: 818.832.4111.
Fax:   818.832.8111.
For Epson consumables please visit
 http://www.spectrecom.com

____________________________________________________________
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

<Prev in Thread] Current Thread [Next in Thread>