LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Procmail recipe question (https://www.linuxquestions.org/questions/linux-software-2/procmail-recipe-question-440561/)

gauge73 05-01-2006 10:54 AM

Procmail recipe question
 
I have a spam filtering solution that adds *****SPAM***** as a prefix to the subject line of any email that was detected as spam. I'm trying to get these sent over to a Trash folder using the following recipe:

Code:

VERBOSE=off
MAILDIR=~/mail # elm users might use $HOME/Mail instead
PMDIR=~/.procmail
DEFAULT=$MAILDIR/
LOGFILE=$MAILDIR/log
# INCLUDERC=$PMDIR/other.rc
# add as many INCLUDERC's as you like
# end of .procmailrc


* ^SUBJECT: \*\*\*\*\*SPAM\*\*\*\*\*
{
      :0
      $HOME/mail/.Trash/cur
}

This is putting everything in the Trash folder. What am I doing wrong here?

ioerror 05-02-2006 09:56 AM

A receipe begins with the ':0'. Try:

Quote:

:0
* ^SUBJECT: \*\*\*\*\*SPAM\*\*\*\*\*
.Trash/
The trailing slash on Trash/ tells procmail that this is a maildir, so the mail will actually go in $HOME/mail/.Trash/new.

You don't really need the { } in this case, since there is only one action.

gauge73 05-02-2006 04:45 PM

Thanks! What does the :0 indicate? Should following recipes have incrimenting numbers like :1, then :2, etc? Also, how can these items be marked as read so they're not new in Outlook or Ximian?

ioerror 05-03-2006 04:09 AM

Quote:

Thanks! What does the :0 indicate? Should following recipes have incrimenting numbers like :1, then :2, etc?
It is just a tag (as far as I can tell), all recipes should begin with :0 (not :1, :2 etc).

Quote:

Also, how can these items be marked as read so they're not new in Outlook or Ximian?
Not sure. I just spotted you were trying to deliver to ~/mail/.Trash/cur. That might work, since new mail goes in new and read mail goes in cur. Try changing the last line to '.Trash/cur', similar to what you had before (no trailing slash this time). I think that should work.


All times are GMT -5. The time now is 09:19 PM.