HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Developers' Forum (http://www.howtoforge.com/forums/forumdisplay.php?f=33)
-   -   API mail_user_filter_add (http://www.howtoforge.com/forums/showthread.php?t=60504)

abdi 10th February 2013 08:04

API mail_user_filter_add
 
Hello Till,

I have used the API functions (mail_user_filter_add, mail_user_filter_delete, mail_user_filter_get, mail_user_filter_update) ..

But they dont have any effect or rather don't yield any results. I created a filter with action DELETE but I still get the mail ...

Do these functions really work? I ask because there's no such feature listed in client's control panel in ISPConfig3.

Thanks, Joseph

till 11th February 2013 13:55

Quote:

Do these functions really work? I ask because there's no such feature listed in client's control panel in ISPConfig3.
The feature is available for the client, see Mailbox details > filter tab

abdi 11th February 2013 19:54

Thanks alot Till.

I have indeed seen it though it has not worked regardless of the key words I define with action delete ...

till 12th February 2013 09:40

Did you test it by using the ispconfig interface or api? I've tested it here by using the interface with the current 3.0.5 SVN branch version and the filters work.

abdi 12th February 2013 10:03

Mail Filters
 
1 Attachment(s)
Till am not sure why it would not work on my server ...Please see attachment and that rule was created through ISPConfig panel.

I also sent a test message from YahooMail with the following subjects:

Subject #1: jesus cares
Subject #2: does jesus care

And in ALL the above cases, the messages were delivered to my inbox yet i expected them to be deleted as I had indicated with the action.

till 12th February 2013 10:09

maybe the rules were not written to disk, e.g. because the server.sh cronjob is not running or a similar issue. Check the .sieve file of this mailbox if you use dovecot or the mailfilter file if you use courier to see if it contains the filter rules.

abdi 13th February 2013 16:59

Till thanks for the endevour to help. I have looked at the .sieve file and below is the content of it in regards to that rule

Code:

### BEGIN FILTER_ID:4
if (/^Subject: .*jesus/:h)
{
exception {
to /dev/null
}
}

Is that fine?

abdi 23rd February 2013 05:11

Till I did look at the .sieve.log and I see the following:

Code:

# cat .sieve
require ["fileinto", "regex", "date", "relational", "vacation"];



### BEGIN FILTER_ID:6
if (/^Subject: .*Jesus/:h)
{
exception {
to /dev/null
}
}
### END FILTER_ID:6


keep;

As for sieve.log
Code:

# cat .sieve.log
sieve: info: started log at Feb 23 03:04:14.
main_script: line 6: error: expecting test identifier after '(' in test list, but found '/'.
main_script: line 6: error: unexpected character(s) starting with '^'.
main_script: line 6: error: unexpected character(s) starting with '.'.
main_script: line 7: error: failed to accept more tests for command 'if'.
main_script: error: parse failed.
sieve: info: started log at Feb 23 03:05:02.
main_script: line 6: error: expecting test identifier after '(' in test list, but found '/'.
main_script: line 6: error: unexpected character(s) starting with '^'.
main_script: line 6: error: unexpected character(s) starting with '.'.
main_script: line 7: error: failed to accept more tests for command 'if'.
main_script: error: parse failed.
sieve: info: started log at Feb 23 03:05:39.
main_script: line 6: error: expecting test identifier after '(' in test list, but found '/'.
main_script: line 6: error: unexpected character(s) starting with '^'.
main_script: line 6: error: unexpected character(s) starting with '.'.
main_script: line 7: error: failed to accept more tests for command 'if'.
main_script: error: parse failed.

Kindly advice why the errors above ...

Thanks, Joseph


All times are GMT +2. The time now is 22:58.

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