Related question reference here

Below is my procmail recipe which works fantastic ...

* ^Subject.*register$
| /usr/bin/php -f /root/data/scripts/register.php

However, the recipe/script above takes up to 3 hours to complete (lots of data to process and convert), and only then does procmail continue further processing.

I added an & at the end of the file path in the hope it would run in the background but then the script is not executed:

* ^Subject.*register$
| /usr/bin/php -f /root/data/scripts/register.php &
  • It doesn't make sense to run a job in the background, because Procmail is already running autonomously, without a terminal or job control. If you really want parallel processing within Procmail, the :0c clone flag does that, but it seems out of place in this context. Just leave Procmail running the job for however long it takes. (You might want to examine the TIMEOUT variable, though.) – tripleee Nov 28 '16 at 5:53
  • The system has up to 15 requests every minute ... procmail just needs to process the mail and pass matches off to the relevant script ... then wait for incoming mail again ... procmail should not get bogged down by scripts ... thanks for the TIMEOUT hint ... was not aware of it ;) – Danny Nov 28 '16 at 18:45
  • It simply runs; if another email arrives in the meantime, another instance of Procmail will be spawned. – tripleee Nov 28 '16 at 19:40

Remove f flag from the recipe without adding w or W flags.

f flags marks filter. It makes procmail rewrite the message for next procmail rules in the procmail script. Procmail has to wait for the filter command to finish.

f flag description in procmail mini-faq

Q: How can I change the contents of a message but otherwise proceed through my .procmailrc as usual?
A: This is what the :f flag is for.

  • Would you please give more body to the reply, and add a possible link? – Rui F Ribeiro Nov 27 '16 at 16:35
  • It described in "man procmailrc" but IMHO 1) f flag description is "a little bit cryptic" 2) meaning of filter is not consistent in the man-page [ rewrite message for further use by procmail recipes OR filter for this delivery only ] – AnFi Nov 27 '16 at 17:28
  • 1
    Maybe iki.fi/era/procmail/mini-faq.html#f-flag – tripleee Nov 27 '16 at 17:59
  • @tripleee Thanks for the hint - I have added link to redirect target. – AnFi Nov 27 '16 at 18:56
  • Removing the f worked ... thank you – Danny Nov 28 '16 at 18:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.