Thanks Wietse and Matus.

I understand that I must work this way, examples:

if /^Subject:/
/^Subject: Invest once and get passive income(.*)/
 DISCARD SUBJECTSPAM2293
/^Subject: Earnings on a trading robot(.*)/                       DISCARD
SUBJECTSPAM2294
/^Subject: Working Online At Home(.*)/                    DISCARD
SUBJECTSPAM2295
/^Subject: Netflix Je account(.*)/                        DISCARD
SUBJECTSPAM2296
/^Subject: Mailbox Size Warning(.*)/                      DISCARD
SUBJECTSPAM2297
/^Subject:(.*)Sunrise ritual(.*)/                   DISCARD SUBJECTSPAM2298
/^Subject:(.*)pending messages on hold(.*)/                 DISCARD
SUBJECTSPAM2299
endif

/usr/sbin/postmap -v -h -q - pcre:/etc/postfix/header_checks <
/etc/postfix/header_checks

In main.cf i add this:
header_checks = pcre:/etc/postfix/header_checks

This is my server hardware:

Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz
32 Gb RAM




On Fri, Oct 1, 2021 at 2:33 PM Wietse Venema <wie...@porcupine.org> wrote:

> SysAdmin EM:
> > Hello Wietse. Thank you for your answer, you are always attentive to
> > everyone, you were very kind.
> >
> > I'm going to start using pcre, in the header_checks file I have certain
> > locks to prevent sending spam or phishing.
> >
> > /^Subject: Invest once and get passive income.*/
> >                        DISCARD SUBJECTSPAM2293
> > /^Subject: Earnings on a trading robot.*/                       DISCARD
> > SUBJECTSPAM2294
> > /^Subject: Working Online At Home.*/                    DISCARD
> > SUBJECTSPAM2295
> > /^Subject: Netflix Je account.*/                        DISCARD
> > SUBJECTSPAM2296
> > /^Subject: Mailbox Size Warning.*/                      DISCARD
> > SUBJECTSPAM2297
> > /^Subject:.*Sunrise ritual.*/                   DISCARD SUBJECTSPAM2298
> > /^Subject:.*pending messages on hold.*/                 DISCARD
> > SUBJECTSPAM2299
>
> First, DISCARD is not a nice way to eiminate spam if you have many
> users.
>
> Second, the .* at the end is not needed, but I do not expect that
> is causing high CPU usage.
>
> You can save lots of CPU if you have many Subject: patterns, by
> using if-endif.
>
> if /^Subject:/
> # No whitespace before patterns between if-endif
> /^Subject: *this/
> /^Subject:.*that/
> ...
> endif
>
> With this, message headers that aren't a Subject will use very
> little CPU.
>
>         Wietse
>

Reply via email to