[SOLVED] Mail Filter / Regular expression error

abzsol

Well-Known Member
Sep 18, 2019
93
6
48
Italy
www.abzsol.com
Hello everyone,
I'm trying to insert a regular expression inside Mail Filter but I get this error

invalid regex: ^* matches null string many times in regex; marked by <-- HERE in m/^* <-- HERE [B]domain.ext[/B]$/ at /usr/share/perl5/PMG/Utils.pm line 1590. (500)

What am I doing wrong?
Thanks in advance.
 
Well ^* does not really make sense as a regex. * is a quantifier and needs something to quantify. It matches whatever is before it zero to many times. ^ just matches the beginnings of lines so this can only be matched ones per line.

What is it that you want to match with your regex?
 
Well ^* does not really make sense as a regex. * is a quantifier and needs something to quantify. It matches whatever is before it zero to many times. ^ just matches the beginnings of lines so this can only be matched ones per line.

What is it that you want to match with your regex?
I just want to match everything that ends with domain.ext ;)
I've always inserted it in PMG 7 as *domain.ext, now with version 8 is not working.
 
I've always inserted it in PMG 7 as *domain.ext, now with version 8 is not working.
We added a check to see if your regex is valid with PMG 8, so this regex never really worked, the check just didn't exist.

What you could do is this: .*domain\.ext. .* will match any letter or digit zero or multiple times. You'll also need to escape the . as otherwise it matches any character. So .*domain.ext is a valid regex but will also match .*domainPext and .*domain4ext for example. You can check how your regex works on a site like regex101 [1].

[1]: https://regex101.com/
 
Last edited:
We added a check to see if your regex is valid with PMG 8, so this regex never really worked, the check just didn't exist.

What you could do is this: .*domain\.ext. .* will match any letter or digit zero or multiple times. You'll also need to escape the . as otherwise it matches any character. So .*domain.ext is a valid regex but will also match .*domainPext and .*domain4ext for example. You can check how your regex works on a site like regex101 [1].

[1]: https://regex101.com/
Thanks @sterzy
So I have to edit all the regexes I entered incorrectly with version 7? :(
 
So I have to edit all the regexes I entered incorrectly with version 7? :(
Well, probably yeah, otherwise they probably don't do what you expect them to do.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!