Procmail recipe doesn't stop


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Procmail recipe doesn't stop
# 1  
Old 02-02-2005
Data Procmail recipe doesn't stop

I have a .procmailrc file that includes a file named .rc.phplist. Within .rc.phplist is the following set of recipes:

: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
}

This handles all messages addressed to phplist@mydomain.org. The sendlist.php script distributes the messages in the queue folder to members of a discussion mailing list. It checks to see if it is already running and exits if so. The script will stop running when all messages in the queue folder have been sent. This recipe will restart it when a new message comes in.

Later in the parent .procmailrc file is this recipe:

:0
* $RECIP ?? ^^phplist@$DOMAIN
{
:0
!myemail@anotherdomain.net
}

Now it's my understanding that the recipe in .rc.phplist should stop procmail from processing the message. And if the message is plain text, that's just what happens. What's weird is that an HTML message causes *all* the recipes to be executed, even the one in .procmailrc.

Why??? Smilie
# 2  
Old 02-02-2005
Quote:
Originally Posted by elmonty
I have a .procmailrc file that includes a file named .rc.phplist.
Just for fun, what happens if you replace the included procmail file in .procmailrc with the actual recipes?

Do you get the same unexpected results?
# 3  
Old 02-02-2005
Yes, the same thing happens.
# 4  
Old 02-02-2005
Thanks for humoring me Smilie

Could you please put the recipies in one file and post them (you can use the quote or code tags, BTW), so I can try it here. I use many procmail recipes, but I'm no procmailrc expert.

Also, did you turn on more debugging in your procmailrc file? Higher levels of debugging really help in these situations. Perhaps you could post the applicable section of a verbose log?

VERBOSE=yes
# 5  
Old 02-02-2005
Here are two procmail logging flags:

# Turn off extra words in log file set to yes for debugging
VERBOSE=yes

# For debugging uncomment this line
LOGABSTRACT=all
# 6  
Old 02-02-2005
This is on a shared web host. I'm not sure I have access to the log.

In any case, I modified the recipe to this:

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

  :0
  phplist/queue/.

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

And now delivery stops as expected. So it appears that something about calling my PHP script is causing this. I thought calling any program would stop delivery.... why does it seem to be conditional with this script?
# 7  
Old 02-02-2005
Quote:
Originally Posted by elmonty
This is on a shared web host. I'm not sure I have access to the log.
Dear elmonty,

You should be able to specify the procmail log location in your procmailrc file at any place in the recipe chain with:

LOGFILE=/your/path/to/your/area/procmail.log

I'll take a look at the script soon.
 
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