On 30/07/25 20:34, Klaipedaville via Postfix-users wrote:
Hello List,

I have a question and would be grateful if somebody could give me a hand. It looks very simple, but I cannot seem to figure it out.

Postfix 3.4.23

I have the following setting:
smtpd_recipient_restrictions = check_client_access regexp:/etc/postfix/ checkĀ  (other settings here)

Now /etc/postfix/check contains the following line:

/^send\d+\.server\.com$/ REJECT No spam allowed.

POSIX regex doesn't support \d.

Now for testing purposes when I set it specifically to a certain number like this:

/^send71\.server\.com$/ REJECT No spam allowed.

and run postmap -q "send71.server.com" regex:/etc/postfix/check it correctly says: No spam allowed.

Because this regex doesn't have \d.

What am I doing wrong? Why any number of \d+ is not recognized? I also tried some other ways to do it like this:

/^send\d{2}\.server\.com$/ REJECT No spam allowed.

Still has \d.

and like this:

/^send\b([0-9]|[1-9][0-9])\b\.server\.com$/ REJECT No spam allowed.

and regex doesn't support \b either.

But the results are the same. There are no errors reported, but "no spam allowed" is never printed out when postmap -q is run.

Either don't use use \d or \b or use pcre: (which does support \d and \b) instead of regex:


Peter

_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to