procmail
[Top] [All Lists]

Re: firing a script only once with procmail

2000-12-19 10:30:45
On Tue, 19 Dec 2000, Eric Smith wrote:

My procmail correctly fires a script on the arrival of certain mail.
<snip>
The problem is that if the email addresses are valid ones for the
local machine then sendmail calls procmail once for each recipient
and of course procmil call my script once each time.
Is there a way to get procmail to only fire the script once for each
actual email

Seperate the 'marking' that an event fire is needed seperately from
the actual firing of the event -- maintain semaphore files to  check
the 'recently received queue' similar to how a vacation script does.

Sample marking code:

:0fwh
* ^Subject:\/.*Chimetest.*
        | formail -I "Subject: [Ring]$MATCH " \
                -A "X-Chime: Ring"


and the Event Fire code:

:0 H
* ^X-Chime: Ring
{
 :0Wic
        | /usr/local/bin/ORCchime  /usr/lib/games/xboing/sounds/spring.au
}

----------------

The Marking code requests an action -- the Event Fire code does it
(a basic client-server model) -- In this case,
/usr/local/bin/ORCchime plays a sound effect -- but it could consult
a recently received semaphore queue, and perform the action only for
the FIRST in a series, and then drop subsequent occurences.

-- Russ


_______________________________________________
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>