[SOLVED] Regular expression in Whitelist

Apr 7, 2020
7
1
3
44
Good afternoon,

If I would like to accept (whitelist) a root domain e.g. lets say *.com
What would my best approach be?
Configuration > Mail Proxy > Whitelist > add regex: *@*.com
Or use Administration > User Whitelist > add *.com

Regards, Ragnar
 
That depends on which part of the mail-processing you want to ignore/whitelist:
Configuration > Mail Proxy > Whitelist > add regex: *@*.com
This skips greylisting and potentially SPF lookups and RBL checks (this works only for ips not domains/regexes) on smtp-dialog level
Or use Administration > User Whitelist > add *.com
this is the user whitelist, which lets individual users decide whether a mail, which would end up in quarantine should get directly delivered - i.e. not the place for you as admin to add a domain

The third level (and maybe the one your looking for from you description) is to create a rule with fitting priority and a who-object that matches the domain and accept as action.

check out the reference documentation (also especially about the use of regular expressions since the examples you posted don't look quite right):
https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html

I hope this helps!
 
Hi Stoiko and thanks for your reply,

So Who-object it is thanks. The regular expression e.g. "*@*.com " seems to be working on the test cases I did.
Do you have a better solution? ;-)

Ragnar
 
this works but maybe not in the way you mean - also check your journal (`journalctl -r`) there should be quite a few warnings about the regular expression.

the regular-expression in Who-Objects are anchroed - i.e. they need to match the whole address.

I would probably write it like '.*@.*\.com'

(check out our reference manual https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmg_mailfilter_regex - or one of the excellent tutorials on regular expressions on the net)

I hope this helps!
 
Sounds good!

please mark the thread as 'SOLVED' - it can help others with the same questions

Thanks!
 
Hello, which expression can I adjust to only let mail from any domain pass to a user / group of the AD and deny the others, and to another user / group only * .cu
 
Last edited:

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!