Procmail recipe doesn't stop


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Procmail recipe doesn't stop
# 8  
Old 02-02-2005
Dear elmonty,

Query: You removed the continue flag (the "c" flag) in the

:0
phplist/queue/.

recipe.

I forgot, remind me please, does a "c" flag only apply to the recipes in the inner {} (brackets) or to the entire recipe?
# 9  
Old 02-02-2005
I think this example from man procmailrx answers my question:

Forward all mail from peter about compilers to william (and keep a copy of it here in petcompil).

Code:
              :0
              * ^From.*peter
              * ^Subject:.*compilers
              {
                 :0 c
                 ! william@somewhere.edu

                 :0
                 petcompil
              }

# 10  
Old 02-02-2005
One more example. Note the order of the example recipes in the braces:

Code:
Q: Can I list several actions under a common condition? How?

A: Here you go:

	:0
	* common-condition
	{
	    :0fbw
	    * perhaps an additional condition on this one, even
	    | sed -e 's/definately/definitely/g' -e 's/seperate/separate/g'

	    :0c:
            * perhaps an additional condition on this one, too
	    action1

	    :0
	    ! action2
	}

* Notice how the "action" of the top-level condition is a set of curly braces containing more recipes.

* Notice also how there is no lock on the top-level recipe.

* And no :c flag either (in the general case. Of course you should have a :c if you want Procmail to branch, and do the braces in one branch, and continue basically as if this recipe hadn't matched in another).

* Every recipe in the braces can have any additional flags and conditions, and even another set of braces as their action, recursively recursively. In other words, they're exactly the same as a recipe in the top level .procmailrc.
# 11  
Old 02-02-2005
Yes, I removed the c in the test case and commented out the recipe that calls my php script. That worked as expected. When I restored it to the original, the strange behavior began again.

I got it to work right by using the following hack:

Code:
:0
* $RECIP ?? ^^phplist@$DOMAIN
{
  # Has this message already been sent? If so, delete it.
  :0h
  * ^X-Mailing-List:
  /dev/null

  :0cw
  phplist/queue/.

  :0
  |/usr/local/bin/php -f /home/myuser/scripts/sendlist.php >> /home/myuser/scripts/sendlist.log

  :0
  /dev/null
}

# 12  
Old 02-02-2005
That's quite a hack!

Seems the "c" flag is acting strange, doesn't it?

Maybe if you added a lockfile to the last recipe (before the hack) that would work?

Wild guess!!! Smilie

Code:
  :0:
  |/usr/local/bin/php -f /home/myuser/scripts/sendlist.php >> /home/myuser/scripts/sendlist.log

# 13  
Old 02-02-2005
OR, maybe try to wait:

Code:
  :0w
  |/usr/local/bin/php -f /home/myuser/scripts/sendlist.php >> /home/myuser/scripts/sendlist.log

# 14  
Old 02-02-2005
Good On-Line Reference, FYI:

Manual Reference Pages - PROCMAILRC (5)
 
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. Linux

Set -n doesn't stop executing

When I do "set -n" or "set -o noexec" the shell doesn't do what it sould. Infact if I check: $: set -o .... noexec off .... f ...instead I can set normally the other option. Who Knows what could be up? (2 Replies)
Discussion started by: flaviofachin
2 Replies

2. UNIX for Dummies Questions & Answers

Make - two target produced by one recipe

Suppose executable X produces files A and B from nothing, Y produces C from A, Z produces D from B, and my final goal is to produce C and D. I wrote the following makefile: .PHONY: all all: C D C: A Y A D: B Z B A B: X This makefile seems to reflect all dependencies, as it should... (2 Replies)
Discussion started by: ybelenky
2 Replies

3. UNIX for Dummies Questions & Answers

Script that doesn't stop

Hi all, I got a script that runs automatically using the cron file. The script starts running at midnight and suppose to delete image files from folders and sub-folders. The script ends when he finishes deleting or after 5 hours. My problem is that the script doesn't stop running even after 5... (3 Replies)
Discussion started by: biot
3 Replies

4. Email Antispam Techniques and Email Filtering

Procmail recipe: From "number spam"

This procmail recipe catches a lot of spam, but might accidently catch a friendly email occasionally: :0 * ^From:.*()+.*@ number_spam ... trapping user names in the From header field that have 3 or more numbers. (0 Replies)
Discussion started by: Neo
0 Replies

5. Email Antispam Techniques and Email Filtering

Procmail recipe: blocking 'unsubscribe and opt-out' messages....

Here is a crude procmail recipe that I quickly created (NOT a procmail recipe expert, btw) that has been catching lots of spam (current second after the charset_spam recipe posted earlier): :0B * .*If.you.do.not.wish.to.receive...* more_spam :0B * You.requested.to.receive.this.mailing... (0 Replies)
Discussion started by: Neo
0 Replies
Login or Register to Ask a Question