Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 21st October 2012, 13:21
Dehumanizer Dehumanizer is offline
Junior Member
 
Join Date: Oct 2012
Posts: 16
Thanks: 1
Thanked 2 Times in 1 Post
Question Problem with mail filter rules

I have found that dovecot probably has some problems with regexp in sieve scripts...
Everything is fine until I enter a mail rule which includes some characters that need escaping, like "[". The ISPConfig correctly escapes it and for rule which includes "[Test" in the Subject header it generates a script like this:
### BEGIN FILTER_ID:2
if header :regex ["subject"] [".*\[Test"] {
fileinto "Test";
stop;
}
### END FILTER_ID:2

but then when I try to send an email to this mailbox, I'm getting this error :
main_script: line 34: error: invalid regular expression for regex match: unmatched [ or [^.
main_script: error: validation failed.

even though the regular expression is perfectly fine.
Any ideas on how to fix this? Can anyone test if it works for them hence if it's just a problem with the dovecot version I'm running?
The server is Debian 6 with Dovecot 1.2.15

Last edited by Dehumanizer; 21st October 2012 at 13:26.
Reply With Quote
Sponsored Links
  #2  
Old 21st October 2012, 14:02
Dehumanizer Dehumanizer is offline
Junior Member
 
Join Date: Oct 2012
Posts: 16
Thanks: 1
Thanked 2 Times in 1 Post
Lightbulb

Well after a bit of testing I found that special characters (or at least the square bracket, I haven't tried anything else yet) have to be double escaped, so my filter from the previous message should go like this:

### BEGIN FILTER_ID:2
if header :regex ["subject"] [".*\\[Test"] {
fileinto "Test";
stop;
}
### END FILTER_ID:2

However you need to manually edit the filter in the "custom rules" tab, because if you enter \[ in the mail filtering tab as a rule, it will get triple escaped (it will become \\\[ in the filter).
I'm not sure if it's a bug in the dovecot's sieve plugin implementation of regular expressions or if this is how it should work. If it's a correct behaviour, it needs to be fixed in ISPConfig so that special characters will get double escaped.
Reply With Quote
  #3  
Old 22nd October 2012, 17:27
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
 
Default

I've added this to our bugtracker, so we will check that.
__________________
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
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
Getting Email Working ISPConfig3 Squirrelmail and Courier etc Ian Wilson Installation/Configuration 17 19th June 2013 22:58
ISPconfig 3.0.3.2 postfix not relaying outgoing attachments mychoice2009 Installation/Configuration 3 13th April 2011 17:42
dovecot: lda: Fatal: Unknown user dpicella Installation/Configuration 1 22nd August 2010 02:59
Email problem 'Cannot set my user or group id.' (using ISPConfig 3 + OpenSuSE 11.2) urosm Installation/Configuration 5 19th June 2010 22:41
ISPConfig3 Mail Warn Errors reason8 General 3 25th November 2009 13:58


All times are GMT +2. The time now is 12:47.


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