Postfix [Postfwd2 error]


In /var/log/maillog i see this error, which produce an excessive cpu usage

postfwd2/policy[4807]: warning: Complex regular subexpression recursion
limit (32766) exceeded at /opt/postfix/postfwd/sbin/postfwd2 line 1168,
<$fh> line 230.?

any ideas?



Re: Postfix [Postfwd2 error]

By Viktor Dukhovni at 04/12/2018 - 15:39

Avoid complex regular expressions.

Re: Postfix [Postfwd2 error]

By Emanuel at 04/12/2018 - 15:43

Hello, thanks for reply.

any idea what file to review???


El 12/04/18 a las 16:39, Viktor Dukhovni escribió:

Re: Postfix [Postfwd2 error]

By Bill Cole at 04/12/2018 - 17:57

The error message tells you, after a fashion:

Perhaps ask whoever maintains "postfwd2" what they mean by "<$fh>" ?

Re: Postfix [Postfwd2 error]

By Viktor Dukhovni at 04/12/2018 - 18:20

The "<$fh>" is not the issue. The problem is on line 1168 of the postfwd2
Perl script, while matching a regular expression against line 230 of the
file handle <$fh>.

So the think to check with the author of postfwd2 is what's going on
with the regular expresssion on line 1168.

Re: Postfix [Postfwd2 error]

By Bill Cole at 04/13/2018 - 02:10

One would expect that I'd recognize that error message but it seems that
I need to write MORE bad Perl. In my defense, I don't use postfwd2 and
didn't know it was written in Perl.

That is a scary one. It seems like an attempt to express all of the
leniencies in a config format in a single regex, where a preliminary
canonicalization (reducing all runs of whitespace to a single space
maybe?) would eliminate the need for some of the complexities.

But yes, that's really an issue to take up with the author and/or other
postfwd2 users. The site indicates that a user mailing list

Re: Postfix [Postfwd2 error]

By Jan P. Kessler at 04/15/2018 - 07:38

postfwd takes regular expressions from a user's configuration file.
These expressions were malformed (starting from line 230 in the config

Yep, that's the right place for it. Sorry, for the "noise" :)