• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 345
  • Last Modified:

procmail recipe question

Hi,

I run this from bash:
expr $(cat /home/bryantest/count) + 1 > /home/bryantest/count

Does anyone know how to put it in a procmail recipe?  I just want to use the normal autoresponse, which I have pasted below this at the end.  Can anyone show me how to include it?

What it does is to create a counter for every time the procmail script is run.  Also, if there is a much easier way to do it I will be happy to use the better way instead.



----
Here is the current script from the man pages of procmailex.
----
              SHELL=/bin/sh    # for other shells, this might need adjustment

              :0 Whc: vacation.lock
               # Perform a quick check to see if the mail was addressed to us
              * $^To:.*\<$\LOGNAME\>
               # Don't reply to daemons and mailinglists
              * !^FROM_DAEMON
               # Mail loops are evil
              * !^X-Loop: your@own.mail.address
              | formail -rD 8192 vacation.cache

                :0 ehc         # if the name was not in the cache
                | (formail -rI"Precedence: junk" \
                     -A"X-Loop: your@own.mail.address" ; \
                   echo "I received your mail,"; \
                   echo "but I won't be back until Monday."; \
                   echo "-- "; cat $HOME/.signature \
                  ) | $SENDMAIL -oi -t
0
bryanlloydharris
Asked:
bryanlloydharris
1 Solution
 
ahoffmannCommented:
> Does anyone know how to put it in a procmail recipe?
write is as follows in your .procmailrc (wherever you need it):
expr "`cat /home/bryantest/count`" '+' 1 > /home/bryantest/count
0
 
bryanlloydharrisAuthor Commented:
Thank you ahoffmann (-:
It worked very well
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now