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.
It is supposed to reject mail from send71.server.com or any other number
that follows right after the word "send". The problem is that the
numbers change every time they sent me mail. Their hostname can be send
34.server.comĀ send98.server.com and so on. I noticed they only change
it from 1 to 99 so this regex is supposed to work. However, running the
following command does not produce any output:
postmap -q "send77.server.com" regex:/etc/postfix/check
It doesn't show any errors either. I tried any random numbers after send
(12, 33, 86, etc.) and the results are the same.
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.
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.
and like this:
/^send\b([0-9]|[1-9][0-9])\b\.server\.com$/ REJECT No spam allowed.
But the results are the same. There are no errors reported, but "no spam
allowed" is never printed out when postmap -q is run.
At first I thought that I had forgotten regex, but no, the regex is
correct, I verified it with numerous regex online testers such as
regex101.com and so on.
I would be really thankful for any pointers, advice, suggestions.
Regards,
Dennis
_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]