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 &
3
  • 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.) Commented Nov 28, 2016 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 ;) Commented Nov 28, 2016 at 18:45
  • It simply runs; if another email arrives in the meantime, another instance of Procmail will be spawned. Commented Nov 28, 2016 at 19:40

1 Answer 1

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

6
  • Would you please give more body to the reply, and add a possible link? Commented Nov 27, 2016 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 ] Commented Nov 27, 2016 at 17:28
  • 1
    Maybe iki.fi/era/procmail/mini-faq.html#f-flag Commented Nov 27, 2016 at 17:59
  • @tripleee Thanks for the hint - I have added link to redirect target. Commented Nov 27, 2016 at 18:56
  • Does it process following rules even without c (carbon copy) flag? Commented Nov 28, 2016 at 19:04

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.