Problems getting formail to work...

Francesco Peeters francesco at fampeeters.com
Fri Sep 19 22:48:27 CST 2014


Linden May schreef op 19-9-2014 7:19:
> Hi Francesco,
>
> On Thu, Sep 18, 2014 at 10:21 PM, Francesco Peeters
> <francesco at fampeeters.com> wrote:
>> Since there doesn't seem to be any (semi)formal Procmail support lists
>> left, I'm trying my luck here...
>>
>> I am having issues getting formail to work in procmail on my Ubuntu
>> server...
>>
>> My original recipe was:
>> :0HB
>> * !^X-Loop: francesco at fampeeters\.com
>> * ^Subject: Failed Authentication
>> * Client IP: \/.*
>> | formail -rk \
>> -A "X-Address: 1.2.3.4" \
>> -A "X-Loop: francesco at fampeeters.com"
> [...]
>> But when matching email comes in I get this in the procmail log:
> [...]
>> procmail: Executing "formail,-rk, "
> [...]
>
> This is just a guess based on the log messages, but it appears that
> procmail is ignoring (or not understanding) the multi-line command,
> and is only executing the first line.
>
> Perhaps try writing the command on a single line without the
> backslashes, e.g.:
>
> | formail -rk -A "X-Address: 1.2.3.4" -A "X-Loop: francesco at fampeeters.com"
>
> The procmailrc man page <http://linux.die.net/man/5/procmailrc> does
> suggest that multi-line commands are supported though:
>
>> Continued lines in an action line that specifies a program always
>> have to end in a backslash, even if the underlying shell would not
>> need or want the backslash to indicate continuation. This is due to
>> the two pass parsing process needed (first procmail, then the shell
>> (or not, depending on SHELLMETAS)).
> The only other thing I can think of is, if there trailing spaces after
> the backslashes, they might be confusing the parser.
>
> In fact, the ', ' at the end of this line might indicate that '\ ' is
> being interpreted as an argument (i.e. an escaped space), rather than
> a line continuation:
>
>> procmail: Executing "formail,-rk, "
> Cheers,
>
> Linden
>
*Facepalms*

It was indeed a stray space... Must already have been in the code I
copied it from! Of all the things I tried, it never crossed my mind to
check whether there was any unwanted whitespace behind the
line-continuation slashes!

It works now, and I can proceed setting it up as I want...

Thanks a million!

Best,
-- 
Francesco



More information about the linuxsa mailing list