Blocking Mail with specific alias part in from

GKrem

Member
Apr 10, 2019
13
1
8
60
Hello,

i want to block all emails from

"Dr. med. Frank" <info@happynonsense.com>

where the part between < .... > can be anything.

So i wrote a regex in the global blacklist looking like this:

^\"Dr\.\smed\.\sFrank\"

As far as i could test with regex101.com the expression should be exact what i want.

But if i test it in proxmox i get the result that the expression is not matching.

I wonder if my expression is wrong or if the test function in proxmox is giving me a wrong result?

Any help with this issue?

Thx in advance.
 
Quickly tested this on a test-installation of mine - works here (copy+pasted your regular expression and the test-string)

* Which Version are you running? (`pmgversion -v`)

Keep in mind that Who Objects match the SMTP-envelope sender and not the 'To' Header (see e.g. [0] for a quick explanation).
If you want to match the To header you need a 'Match Field' What Object

I hope this helps!

[0] https://www.mybluelinux.com/what-is-email-envelope-and-email-header/
 
Hello Stoiko,

proxmox-mailgateway: 6.4-1 (API: 6.4-4/1c8a73c7, running kernel: 5.4.114-1-pve)
pmg-api: 6.4-4
pmg-gui: 2.4-3

i want to check for incoming mails - field "from". Guess i should be right with the "Who-Object" than?

Here's what i see in web browser:

Screenshot 2021-06-09 124908.jpg

Screenshot 2021-06-09 124951.jpg

Maybe i just wait and see, as this spam is comming often.

Thank you for you time and prof. answer.

Have a good day and stay safe.
 
i want to check for incoming mails - field "from". Guess i should be right with the "Who-Object" than?
sorry for the mistake w.r.t. from/to but the point with Envelope sender vs From header remains.

Check the error-message - the anchors are added by PMG - try dropping the '^' in the beginning, and add '.*' in the end

I hope this helps!
 
Yepp - this made it work. Allthough i am still not sure if my regex was wrong or just the routine to test.

Again - Thx...
 
Yepp - this made it work. Allthough i am still not sure if my regex was wrong or just the routine to test.
Actually both - your regex was not wrong, but since PMG automatically anchors them (sets '^' in front and '$' in back) - it would not have matched.
The test routine correctly said that the regex does not match.

I guess we should mention this in the documentation - but for now - trust the test-routine - if it does not match then PMG will not match.
 

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!