Re: suggestion needed on a recipe

On Thu, 31 Oct 2019, Andreas Schamanek wrote:
:0 hw | (formail -I "X-Loop: my-email@my-domain" \ -I "Subject: Problems with ....."; \ cat - notify.moderators.txt) \
You might want to provide example messages. But before you do: The above code seems to read from stdin twice: `formail` does, and `cat -` does, too.
I put in attachment such an example to avoid unexpected line wraps. Using 'formail' and 'cat' together can be found from man pages on "procmailex". As they are put in parenthsis, I think when these shell commands are executed in sequence the outcomes get piped at once to the next action. ZL

On Thu, 31 Oct 2019, at 21:57, Zhiliang Hu wrote:
:0 hw | (formail -I "X-Loop: my-email@my-domain" \ -I "Subject: Problems with ....."; \ cat - notify.moderators.txt) \ Using 'formail' and 'cat' together can be found from man pages on "procmailex". As they are put in parenthsis, I think when these shell commands are executed in sequence the outcomes get piped at once to the next action.
Correct, but procmailex(1) shows only `formail ; cat FILE` not `formail ; cat - FILE`. Here the formail reads from stdin (the headers from procmail), then cat reads again until whatever. In short, remove the "-". -- -- Andreas :-)
participants (2)
-
Andreas Schamanek
-
Zhiliang Hu