Thread: Mail Filter
View Single Post
  #8  
Old 9th July 2009, 02:04
Rescue9 Rescue9 is offline
Member
 
Join Date: Jun 2007
Posts: 52
Thanks: 4
Thanked 3 Times in 2 Posts
Default

Ok, after much trial and error from a complete php noob, I've figured a few things out.

First, I have verified that using a $variable inside the .mailfilter file works. I stripped out quite a bit of the .mailfilter file as follows:
Code:
### BEGIN FILTER_ID:2

if (/^Subject:.*\[BGTEditors\]/:h)
{
myfolder = "$DEFAULT/.Yahoo Groups.BGTEditors/"
exception {
to $myfolder
}
}
### END FILTER_ID:2
Assigning myfolder must happen without $. Trying to assign it as $myfolder breaks it. Also, the $DEFAULT/.Yahoo Groups.BGTEditors/ MUST be wrapped in quotes. Not having these also breaks it.

Now, not knowing how ISPConfig writes these rules, I can only assume that having multiple rules with only 1 $myfolder would break things. I plan on changing this variable to [filter_id]EndFolder as such; 2EndFolder. As each FilterID is unique, this should help avoid variables being named the same.

Right now, I'm working on modifying the mail_user_filter_edit.php to write the .mailfilter as above. I'll work on changing the variable later.
Reply With Quote