[SOLVED] Mail Proxy Whitelist Regex

osgit

Member
Jan 12, 2021
46
5
8
Hello,

I'm trying to verify that my regex looks good, in theory, it should be fine, but I'm seeing this in the logs:
Code:
Apr 13 18:18:11 smtp postfix/smtpd[1039]: warning: regexp map /etc/postfix/senderaccess, line 1: Invalid preceding regular expression
Apr 13 18:18:11 smtp postfix/smtpd[1039]: warning: regexp map /etc/postfix/senderaccess, line 2: Invalid preceding regular expression
Apr 13 18:18:11 smtp postfix/smtpd[1039]: warning: regexp map /etc/postfix/senderaccess, line 3: Invalid preceding regular expression
Apr 13 18:18:11 smtp postfix/smtpd[1039]: warning: regexp map /etc/postfix/senderaccess, line 4: Invalid preceding regular expression
Apr 13 18:18:11 smtp postfix/smtpd[1039]: warning: regexp map /etc/postfix/senderaccess, line 5: Invalid preceding regular expression
Apr 13 18:18:11 smtp postfix/smtpd[1039]: warning: regexp map /etc/postfix/senderaccess, line 6: Invalid preceding regular expression
Apr 13 18:18:11 smtp postfix/smtpd[1039]: warning: regexp map /etc/postfix/senderaccess, line 7: Invalid preceding regular expression
Apr 13 18:18:11 smtp postfix/smtpd[1039]: warning: regexp map /etc/postfix/rcptaccess, line 1: Invalid preceding regular expression
Apr 13 18:18:11 smtp postfix/smtpd[1039]: warning: regexp map /etc/postfix/rcptaccess, line 2: Invalid preceding regular expression

This is what I have in the whitelist:
1649899364943.png

That is a real regex, but seeing those warnings, it seems like postfix is wanting something different.

Here is the senderaccess file:
Code:
/^*af.mil$/ OK
/^*amazon.com$/ OK
/^*army.mil$/ OK
/^*chrobinson.com$/ OK
/^*mail.mil$/ OK
/^*medline.com$/ OK
/^*navy.mil$/ OK

and the rcptaccess
Code:
/^*adp.com$/ OK
/^*dicentral.com$/ OK
/^scorecard@truevalue\.com$/ OK

I've tried adding just the domain for the dicentral.com one and it still has issues receiving those at times. Using the regex like this, it seems like it does work, but just litters the logs with the warnings. Thank you for the assistance. :)
 

osgit

Member
Jan 12, 2021
46
5
8
Try this regex

(\W|^).*\.mil(\W|$)
(\W|^).*mail\.mil(\W|$)
I've replaced the existing one's with these. I'll keep an eye on the logs and see what it looks like and report back if there are any issues. Thank you! :)
 
  • Like
Reactions: hata_ph

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 your own in 60 seconds.

Buy now!