Wildcards in Whitelist/blacklist
Wildcards in Whitelist/blacklist
What wildcards are supported in the Whitelist/Blacklist on MailWatch? I've tried the "*" but it doesn't seem to work.
Thanks Richard.
Thanks Richard.
Re: Wildcards in Whitelist/blacklist
Appears I've found my answer over on the mail scanner faq. Apparently you can't use wildcards at all. Looks like my blacklist is going to get VERY LARGE.
- shawniverson
- Posts: 3783
- Joined: 13 Jan 2014 23:30
- Location: Indianapolis, Indiana USA
- Contact:
Re: Wildcards in Whitelist/blacklist
Hmm....feature request? Or you can perhaps use a postfix rule instead since it allows regex and wildcards?
Re: Wildcards in Whitelist/blacklist
I'd be interested in any solution. As I've mention I'm not very good with Linux (yet) so I'd need a bit of schooling on how to.
- shawniverson
- Posts: 3783
- Joined: 13 Jan 2014 23:30
- Location: Indianapolis, Indiana USA
- Contact:
Re: Wildcards in Whitelist/blacklist
It takes some tweaking in postfix, here's the post I saw that describes how to do it.
http://permalink.gmane.org/gmane.mail.v ... nner/80423
I'll highlight the important parts...
In /etc/postfix/main.cf...
smtpd_client_restrictions = reject_unknown_client_hostname,
check_sender_access pcre:/etc/postfix/sender_access
smtpd_sender_restrictions = reject_unknown_sender_domain,
check_sender_access pcre:/etc/postfix/sender_access
In /etc/postfix/sender_access
'
Reject anything from example TLD
http://permalink.gmane.org/gmane.mail.v ... nner/80423
I'll highlight the important parts...
In /etc/postfix/main.cf...
smtpd_client_restrictions = reject_unknown_client_hostname,
check_sender_access pcre:/etc/postfix/sender_access
smtpd_sender_restrictions = reject_unknown_sender_domain,
check_sender_access pcre:/etc/postfix/sender_access
In /etc/postfix/sender_access
Code: Select all
/\.example$/ REJECT
Reject anything from example TLD
Re: Wildcards in Whitelist/blacklist
Thanks, I'll post back results.
Re: Wildcards in Whitelist/blacklist
OK. The information you've provided. Is this added to the existing main.cf or does it replace the two lines in the file?
Also sender_access is blank. Am I adding the /\.example$/ REJECT ? Or what? What I want to reject at this time is China (.cn), Russia (.ru), Palau (.pw) and .asia. How would I format that into the sender access?
Thanks.
Richard
Also sender_access is blank. Am I adding the /\.example$/ REJECT ? Or what? What I want to reject at this time is China (.cn), Russia (.ru), Palau (.pw) and .asia. How would I format that into the sender access?
Thanks.
Richard
Re: Wildcards in Whitelist/blacklist
Went ahead and "added" the lines after the other smtpd lines and added /\.pw REJECT plus the others in the sender access file. Hope this is correct.
As a follow on is there a way to report number of rejected emails? By domain?
Thanks.
Richard.
As a follow on is there a way to report number of rejected emails? By domain?
Thanks.
Richard.
Re: Wildcards in Whitelist/blacklist
FYI; .asia didn't get blocked. Do I need to restart anything?
Re: Wildcards in Whitelist/blacklist
Follow up, after configuring it blocked ALL email coming in so I know I did something wrong.
- shawniverson
- Posts: 3783
- Joined: 13 Jan 2014 23:30
- Location: Indianapolis, Indiana USA
- Contact:
Re: Wildcards in Whitelist/blacklist
Feel free to share your postfix edits...
Re: Wildcards in Whitelist/blacklist
I followed the instructions in Shawn's link above, to block the .top TLD, and it worked without any problems. The sender_access file already exists. I just copied and pasted the additional four lines to the end of the /etc/postfix/main.cf file:
and populated the sender_access file (which was blank) with
I then restarted postfix, and no more .top messages. 
Code: Select all
smtpd_client_restrictions = reject_unknown_client_hostname,
check_sender_access pcre:/etc/postfix/sender_access
smtpd_sender_restrictions = reject_unknown_sender_domain,
check_sender_access pcre:/etc/postfix/sender_access
Code: Select all
/\.top$/ REJECT
