#1  
Old 5th January 2011, 22:11
cyrus1977 cyrus1977 is offline
Junior Member
 
Join Date: Jan 2011
Posts: 11
Thanks: 6
Thanked 0 Times in 0 Posts
Default Postfix regex

Maybe a good idea for a thread.
Post your regex examples here in this thread, so others can benefit.
Reply With Quote
Sponsored Links
  #2  
Old 6th January 2011, 15:16
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,739 Times in 2,574 Posts
Default

This is from the ISPConfig 3 Manual - these are regular expressions for Postfix header and body checks:

Code:
Regexp. Pattern:  	Filter Type:  	Explanation:
/^Subject: .*Make Money Fast!/ 	Header Filter 	Searches for the string Make Money Fast! in the Subject line.
/name=[^>]*\.(bat|com|exe|dll)/ 	MIME-Header Filter 	This will match all messages that have attachments whose files end in .bat, .com, .exe or .dll.
/^<iframe src=(3D)?cid:.* height=(3D)?0 width=(3D)?0>$/ 	Body Filter 	Body pattern to stop a specific HTML browser vulnerability exploit.
/^From: joe@example.com/ 	Header Filter 	Matches all messages sent by joe@example.com.
/^From: .*@example.com/ 	Header Filter 	Matches all messages sent from the example.com domain.
/Real Bad Words/ 	Body Filter 	This matches "real bad words" in any case (upper, lower, or mixed).
/^Date: .* 200[0-2]/ 	Header Filter 	This matches all emails sent in the years 2000 - 2002.
/^Date: .* 19[0-9][0-9]/ 	Header Filter 	This matches all emails sent between 1900 and 1999.
/^To: postmaster@yourdom.ain/ 	Header Filter 	Matches all messages sent to postmaster@yourdom.ain.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following 2 Users Say Thank You to falko For This Useful Post:
bajodel (7th January 2011), cyrus1977 (7th January 2011)
  #3  
Old 7th January 2011, 23:08
cyrus1977 cyrus1977 is offline
Junior Member
 
Join Date: Jan 2011
Posts: 11
Thanks: 6
Thanked 0 Times in 0 Posts
Default

thank but actually i was more looking for custom filters other users made.

Here is a more fine tuned one out of the manual:

Regexp. Pattern: Filter Type: Explanation:
/^Content-(Disposition|Type).*name\s*=\s*"?(.*\.(bat|exe|scr |lnk|com))(\?=)?"?\s*(;|$)/x MIME-Header Filter This will match all messages that have attachments whose files end in .bat, .com, .exe or .dll.


What i dont understand is what the difference is betwee reject (does a warning go out), ignore and discard.

Can you shed some light on it ?

Added two cronjobs aswell related to messages who where hold.

10 2 * * * find /var/lib/amavis/virusmails/ -type f -mtime +31 -exec rm {} \;
15 2 * * * find /var/lib/amavis/tmp/ -type f -mtime +31 -exec rm -r {} \;

Last edited by cyrus1977; 7th January 2011 at 23:13.
Reply With Quote
Reply

Bookmarks

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
mail authentication failure - unknown user or password evok Installation/Configuration 9 16th October 2010 06:37
Undelivered Mail Returned to Sender Error202 General 5 7th May 2009 11:14
localhost postfix/master: fatal: bind 127.0.0.1 port 125: Permission denied g18c Installation/Configuration 4 24th March 2009 17:39
Centos 4.4 32bit Hangs, High Server load 3cwired_com Server Operation 11 16th November 2006 15:47
Verify email setup meekish Installation/Configuration 28 27th October 2006 15:36


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


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