procmail
[Top] [All Lists]

Re: email not going to bit bucket

2001-05-14 14:22:19
First, from reading a response to another question the line
* killmail|killemail|kill mail|kill email|mailkill|mail kill

should be
* (killmail|killemail|kill mail|kill email|mailkill|mail kill)

right?

Doesn't really matter in this case.  The other question was probably
referring to a condition with anchors (^ and/or $) which yours doesn't
have.  It's common to think that

  * ^this|that

means

  * ^(this|that)

when it actually means

  * (^this)|(that)

This snippet below is supposed to remove the line written by the
code above when a Re: to the original email is received:

# remove line from the monitor file if the body has killmail in it
:0Bwi:$HOME/mail_log$LOCKEXT
* killmail|killemail|kill mail|kill email|mailkill|mail kill
* ^Subject: Re:[  ]+\/[^      ].*
| fgrep -v "$MATCH" $HOME/mail_log > $HOME/temp && \
mv $HOME/temp $HOME/mail_log || rm -f $HOME/temp
/dev/null

The recipe is removing the line from the file.  It is *not*
sending the email to the bit bucket - it is sending it out.
I can't figure out why.  Any help appreciated -

The best way to figure out why is to take a look at your logfile.  It
contains loads of useful information.  Especially if you do

  VERBOSE=1

and if it still doesn't make sense it helps us if you include what gets
logged.  However, looking into my crystal ball, I'd guess that your log
file contains the line 'procmail: Skipped "/dev/null"'.  Which means
that procmail doesn't know what that '/dev/null' line means.  You have
two actions - you can only have one action.  Perhaps you mean:

  :0Bwi:$HOME/mail_log$LOCKEXT
  * killmail|killemail|kill mail|kill email|mailkill|mail kill
  * ^Subject: Re:[  ]+\/[^      ].*
  | fgrep -v "$MATCH" $HOME/mail_log > $HOME/temp && \
  mv $HOME/temp $HOME/mail_log || rm -f $HOME/temp

  :0
  /dev/null

???

But I'm not totally clear as to what you are trying to do.  Throw away
every mail that *doesn't* contain 'kill mail' or some variation on the
theme?

Or maybe

  :0 e
  /dev/null

to throw away mail if the preceding action failed?

Whilst you've not got a working recipe I'd strongly suggest delivering
to a mailbox rather than /dev/null in case you accidentally throw away
mails that you meant to keep!

Maybe that's some help.
Martin
-- 
Martin McCarthy                 /</                  PGP key available
    `Procmail Companion'        \>\  http://www.ancient-scotland.co.uk
     Addison Wesley             /</    http://www.ehabitat.demon.co.uk
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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