Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 30th September 2010, 17:52
Turbanator Turbanator is offline
Senior Member
 
Join Date: Jun 2008
Posts: 220
Thanks: 23
Thanked 16 Times in 16 Posts
Default email->global filter->content filter help

I can't seem to get it right.

Using latest ISPC3.

Email->Global filters->Content filter-.Add New filter

Filter = Header filter
RegExp Pattern = /^From: *.info
Data = <blank>
Action = Reject
Save = Check

What I'm trying to do is block any email coming From an email address with .info .

I've tried different variations but it doesn't seem to work.
Reply With Quote
Sponsored Links
  #2  
Old 30th September 2010, 18:23
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,036
Thanks: 841
Thanked 5,655 Times in 4,464 Posts
Default

The regex pattern seem to be incomplete. A regex has to end with the same char then it begins. If your regex starts with / it has to end with / too, please try e.g.

/^From: *.info/
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 30th September 2010, 19:12
Turbanator Turbanator is offline
Senior Member
 
Join Date: Jun 2008
Posts: 220
Thanks: 23
Thanked 16 Times in 16 Posts
Default

Till,
Tried that, didn't work.

This email still came through and it was well after I made the change so the system had time to update:

Code:
X-Greylist: delayed 623 seconds by postgrey-1.31 at dns.domain.com; Thu, 30 Sep 2010 09:08:17 PDT
Received: from aju112.onlyoffer.info (unknown [184.107.24.112])
	by dns.domain.com(Postfix) with ESMTP id DC7CB10B42C0
	for <user@domain.com>; Thu, 30 Sep 2010 09:08:17 -0700 (PDT)
From: "SwipeBids" <gianna@onlyoffer.info>
Date: Thu, 30 Sep 2010 11:30:06 -0400
Mime-Version: 1.0
Subject: WHAT?? iPhones for under 20?? It’s true!
Message-ID: <1624863331.7005481383406083446@aju112.onlyoffer.info>
Reply With Quote
  #4  
Old 30th September 2010, 20:03
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,036
Thanks: 841
Thanked 5,655 Times in 4,464 Posts
Default

A * in a regex is no wildcard, it means only repeat the character before the * a unlimited time. As the character before the * in your regex is a whitespace, your regex will match only things like From: .info and not .info email addresses. I guess what you wanted is something like that:

/From:.*\.info/

Wich means that the line starts with "From:" Then there may be any other characters as . is the placeholder for any character and .* means that any number of any character might be in that place and then the end is .info where the . has to be escaped with a backslash so that it is not interpreted as wildcard.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 30th September 2010, 23:00
Turbanator Turbanator is offline
Senior Member
 
Join Date: Jun 2008
Posts: 220
Thanks: 23
Thanked 16 Times in 16 Posts
Default

I tnk you did it! Thanx Till. Another 10% of spam will be gone.
Reply With Quote
  #6  
Old 4th July 2012, 06:11
Johans Johans is offline
Junior Member
 
Join Date: Jul 2012
Location: Philippines
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Johans
Default

Quote:
Originally Posted by till View Post
A * in a regex is no wildcard, it means only repeat the character before the * a unlimited time. As the character before the * in your regex is a whitespace, your regex will match only things like From: .info and not .info email addresses. I guess what you wanted is something like that:

/From:.*\.info/

Wich means that the line starts with "From:" Then there may be any other characters as . is the placeholder for any character and .* means that any number of any character might be in that place and then the end is .info where the . has to be escaped with a backslash so that it is not interpreted as wildcard.
Thank you for that information..
I have a question.. How do i block spam in content filter if i would like to reject a keyword "viagra"

I am using ISPConfig v. 3.0.2.1

Your immediate response is highly appreciated.
__________________
Thanks,

Johans
Developer / Open Source Enthusiast
Reply With Quote
  #7  
Old 4th July 2012, 16:35
sjau sjau is offline
Local Meanie
 
Join Date: Apr 2006
Location: Switzerland
Posts: 1,158
Thanks: 4
Thanked 58 Times in 54 Posts
Default

keyword "viagra" in the email text somewhere?
__________________
"Common sense is not as common as commonly believed" by sjau

Auto-Install Script for ISPConfig and Horde on a Vanilla Debian Stable

Need more Repos for Ubuntu? Repository Generator
Need more Repos for Debian? Debian Repository Generator
Reply With Quote
  #8  
Old 5th July 2012, 05:09
Johans Johans is offline
Junior Member
 
Join Date: Jul 2012
Location: Philippines
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Johans
Question

Quote:
Originally Posted by sjau View Post
keyword "viagra" in the email text somewhere?
Example if there is a subject or body message name "viagra" - key word how can i put this to spam folder directly or auto delete the emails received.
__________________
Thanks,

Johans
Developer / Open Source Enthusiast
Reply With Quote
  #9  
Old 5th July 2012, 09:25
sjau sjau is offline
Local Meanie
 
Join Date: Apr 2006
Location: Switzerland
Posts: 1,158
Thanks: 4
Thanked 58 Times in 54 Posts
 
Default

ISPC can't do header checks or body checky (yet). However you could set that up manually (or I have created a little form to amend domains to header_checks):

http://www.postfix.org/header_checks.5.html

Code:
/^Subject:.*=\?(big5|euc-kr|ks_c_5601-1987|koi8)\?/ REJECT Spam not tolerated here  - hc 1
/^Subject: offizielle sieger/ REJECT Spam not tolerated here  - hc 2
/^Content-Type:.*charset="?(GB2312|big5|euc-kr|ks_c_5601-1987|koi8|iso-2022-jp)/ REJECT Spam not tolerated here  - hc 3
/^Subject: Sie haben gewonnen/ REJECT Spam not tolerated here  - hc 4

/@usa\.com/             REJECT Spam not tolerated here  - hc 1000
/@mail\.disatel\.com/           REJECT Spam not tolerated here  - hc 1001
/@cantv\.net/           REJECT Spam not tolerated here  - hc 1002
/@infotrading\.it/              REJECT Spam not tolerated here  - hc 1003
/@rafamt\.org/          REJECT Spam not tolerated here  - hc 1004
I also added some info: hc 1000 --> header_checks entry 1000 --> that makes it easier to find out by which rule an email was rejected.
__________________
"Common sense is not as common as commonly believed" by sjau

Auto-Install Script for ISPConfig and Horde on a Vanilla Debian Stable

Need more Repos for Ubuntu? Repository Generator
Need more Repos for Debian? Debian Repository Generator
Reply With Quote
Reply

Bookmarks

Tags
content filter, spam

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ISP Config hesitation when opening web pages frankb Installation/Configuration 7 15th December 2008 14:06
Postfix - Relay access denied gotting Server Operation 3 23rd April 2008 15:06
network issues now it says "401 The web site is blocked by administrator" Check General 3 26th February 2008 15:22
Apache2 Freezes celtic Server Operation 31 28th May 2007 18:18
php script injections Grizzly General 21 18th July 2006 09:55


All times are GMT +2. The time now is 07:53.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.