3

Related question reference here

Below is my procmail recipe which works fantastic ...

:0bf
* ^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:

:0bf
* ^Subject.*register$
| /usr/bin/php -f /root/data/scripts/register.php &
AnFi
  • 1,546
Danny
  • 175
  • 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 05: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

1 Answers1

5

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.
[...]

AnFi
  • 1,546