You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ketanbparekh <ta...@yahoo.com> on 2007/04/10 16:59:35 UTC

mail not getting filtered using jsieve

Hi All,

I am using james-2.3.0 and jsieve for content filtering

I have created two users user1 and user2 through telnet. I have configured
outllook for sending mails from user1 to user1(same user).

I am able to get the mails but they are not getting filtered by jsieve.  I
get an exception on james console but still i am getting the mails in user1
inbox.

SEVERE: Exception processing Configuration:
java.io.IOException: Resource "sieveConfig.xml" not found
        at
org.apache.jsieve.ConfigurationManager.getConfigStream(ConfigurationM
anager.java:162)
        at
org.apache.jsieve.ConfigurationManager.parse(ConfigurationManager.jav
a:383)
        at
org.apache.jsieve.ConfigurationManager.<init>(ConfigurationManager.ja
va:73)
        at
org.apache.jsieve.ConfigurationManager.computeInstance(ConfigurationM
anager.java:120)
        at
org.apache.jsieve.ConfigurationManager.updateInstance(ConfigurationMa
nager.java:136)
        at
org.apache.jsieve.ConfigurationManager.getInstance(ConfigurationManag
er.java:98)
        at
org.apache.jsieve.CommandManager.getClassNameMap(CommandManager.java:
211)
        at
org.apache.jsieve.CommandManager.getClassName(CommandManager.java:190
)
        at org.apache.jsieve.CommandManager.lookup(CommandManager.java:116)
        at
org.apache.jsieve.CommandManager.newInstance(CommandManager.java:145)

        at org.apache.jsieve.Command.execute(Command.java:41)
        at org.apache.jsieve.Commands.execute(Commands.java:85)
        at org.apache.jsieve.Block.execute(Block.java:79)
        at
org.apache.jsieve.SieveParserVisitorImpl.visit(SieveParserVisitorImpl
.java:198)
        at
org.apache.jsieve.parser.generated.ASTstart.jjtAccept(ASTstart.java:1
8)
        at org.apache.jsieve.SieveFactory.evaluate(SieveFactory.java:152)
        at org.apache.jsieve.samples.james.JSieve.evaluate(JSieve.java:233)
        at org.apache.jsieve.samples.james.JSieve.service(JSieve.java:126)
        at
org.apache.james.transport.LinearProcessor.service(LinearProcessor.ja
va:422)
        at
org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManage
r.java:403)
        at
org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.ja
va:307)
        at java.lang.Thread.run(Thread.java:534)
Apr 10, 2007 1:07:48 PM org.apache.jsieve.SieveFactory evaluate
SEVERE: Evaluation failed. Reason: Lookup failed due to a Configuration
Exceptio
n: java.io.IOException: Resource "sieveConfig.xml" not found
Executed Actions :

Also the content of filter.sieve file which i look up through ftp is

#
# Example Sieve Filter
# Declare any optional features or extension used by the script
#
require["fileinto", "reject"];
#

# Handle messages from known mailing lists
# Move messages from IETF filter discussion list to filter folder
#
if header:is "Sender" "user1@a3-ketanp.com"
        {
        fileinto "filter";  # move to "filter" folder
        }
#
# Keep all messages to or from people in my company
#
elsif address :domain :is ["From", "To"] "a3-ketanp.com"
        {
        keep;               # keep in "In" folder
        }

#
# Try and catch unsolicited email.  If a message is not to me,
# or it contains a subject known to be spam, file it away.
#
elsif anyof (not address :all :contains
               ["To", "Cc", "Bcc"] "user1@a3-ketanp.com",
             header :matches "subject"
               ["*make*money*fast*", "*university*dipl*mas*"])
        {
        # If message header does not contain my address,
        # it's from a list.
        fileinto "spam";   # move to "spam" folder
        }
else
        {
        # Move all other (non-company) mail to "personal"
        # folder.
        fileinto "personal";
        }

#
# Reject any large messages (note that the four leading dots get
# "stuffed" to three)
#
if size:over 1M
        {
        reject text:
Please do not send me large attachments.
Put your file on a server and send me the URL.
Thank you.
.... Fred
.
;
        stop;
        }


pls provide me some inputs

Thanks in Advance,
Ketan.B.Parekh 


-- 
View this message in context: http://www.nabble.com/mail-not-getting-filtered-using-jsieve-tf3553523.html#a9921520
Sent from the James - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: mail not getting filtered using jsieve

Posted by robert burrell donkin <ro...@gmail.com>.
On 4/11/07, ketanbparekh <ta...@yahoo.com> wrote:
>
> Hi All,

hi

> Can anybody provide me some inputs.

i've recently added code that should aid in debugging sieve scripts to
trunk. i'd recommend checking out the latest code, turning up
debugging and then using ScriptChecker to test and debug your script
outside JAMES.

- robert

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: mail not getting filtered using jsieve

Posted by ketanbparekh <ta...@yahoo.com>.
Hi All,

I have included sieveConfig.xml in jsieve-0.2-SNAPSHOT.jar so it does not
give me sieveConfig.xml not found Exception.



But i am getting the flolowing error





Class to be loaded isrequire  class org.apache.jsieve.commands.Require
Class to be loaded isfileinto  class
org.apache.jsieve.commands.optional.FileInto
Class to be loaded isreject  class
org.apache.jsieve.commands.optional.Reject
Class to be loaded isif  class org.apache.jsieve.commands.If
Class to be loaded iselsif  class org.apache.jsieve.commands.Elsif
Class to be loaded iselsif  class org.apache.jsieve.commands.Elsif
Class to be loaded iselse  class org.apache.jsieve.commands.Else
Class to be loaded isfileinto  class
org.apache.jsieve.commands.optional.FileInto
Class to be loaded isif  class org.apache.jsieve.commands.If

Evaluated nodes :

Apr 11, 2007 9:10:34 PM org.apache.jsieve.SieveFactory evaluate
SEVERE: Evaluation failed. Reason: null
exception! javax.mail.MessagingException: Exception evaluating Sieve script;
  nested exception is:
        org.apache.jsieve.SieveException

It seems there is some problem with this sieve file.

my content of filter.sieve is


#
# Example Sieve Filter
# Declare any optional features or extension used by the script
#
require["fileinto", "reject"];
#

# Handle messages from known mailing lists
# Move messages from IETF filter discussion list to filter folder
#
if header:is "Sender" "user1@a3-ketanp.com"
        {
        fileinto "filter";  # move to "filter" folder
        }
#
# Keep all messages to or from people in my company
#
elsif address :domain :is ["From", "To"] "user1@a3-ketanp.com"
        {
        keep;               # keep in "In" folder
        }

#
# Try and catch unsolicited email.  If a message is not to me,
# or it contains a subject known to be spam, file it away.
#
elsif anyof (not address :all :contains
               ["To", "Cc", "Bcc"] "user1@a3-ketanp.com",
             header :matches "subject"
               ["*make*money*fast*", "*university*dipl*mas*"])
        {
        # If message header does not contain my address,
        # it's from a list.
        fileinto "spam";   # move to "spam" folder
        }
else
        {
        # Move all other (non-company) mail to "personal"
        # folder.
        fileinto "personal";
        }

#
# Reject any large messages (note that the four leading dots get
# "stuffed" to three)
#
if size:over 1M
        {
        reject text:
Please do not send me large attachments.
Put your file on a server and send me the URL.
Thank you.
.... Fred
.
;
        stop;
        }


Can anybody provide me some inputs.

Thanks,
Ketan.B.Parekh


ketanbparekh wrote:
> 
> hi norman,
> 
> my sieveconfig.xml is in james-2.3.0/conf also in apps/SAR-INF/conf
> 
> where is the right place to keep sieveConfig.xml. ?
> 
> Ketan.B.Parekh
> 
> Norman Maurer-3 wrote:
>> 
>> Where is your sieveConfig.xml located ? Is it in the right path ?
>> 
>> bye
>> Norman
>> 
>> ketanbparekh schrieb:
>>> Hi All,
>>>
>>> I am using james-2.3.0 and jsieve for content filtering
>>>
>>> I have created two users user1 and user2 through telnet. I have
>>> configured
>>> outllook for sending mails from user1 to user1(same user).
>>>
>>> I am able to get the mails but they are not getting filtered by jsieve. 
>>> I
>>> get an exception on james console but still i am getting the mails in
>>> user1
>>> inbox.
>>>
>>> SEVERE: Exception processing Configuration:
>>> java.io.IOException: Resource "sieveConfig.xml" not found
>>>         at
>>> org.apache.jsieve.ConfigurationManager.getConfigStream(ConfigurationM
>>> anager.java:162)
>>>         at
>>> org.apache.jsieve.ConfigurationManager.parse(ConfigurationManager.jav
>>> a:383)
>>>         at
>>> org.apache.jsieve.ConfigurationManager.<init>(ConfigurationManager.ja
>>> va:73)
>>>         at
>>> org.apache.jsieve.ConfigurationManager.computeInstance(ConfigurationM
>>> anager.java:120)
>>>         at
>>> org.apache.jsieve.ConfigurationManager.updateInstance(ConfigurationMa
>>> nager.java:136)
>>>         at
>>> org.apache.jsieve.ConfigurationManager.getInstance(ConfigurationManag
>>> er.java:98)
>>>         at
>>> org.apache.jsieve.CommandManager.getClassNameMap(CommandManager.java:
>>> 211)
>>>         at
>>> org.apache.jsieve.CommandManager.getClassName(CommandManager.java:190
>>> )
>>>         at
>>> org.apache.jsieve.CommandManager.lookup(CommandManager.java:116)
>>>         at
>>> org.apache.jsieve.CommandManager.newInstance(CommandManager.java:145)
>>>
>>>         at org.apache.jsieve.Command.execute(Command.java:41)
>>>         at org.apache.jsieve.Commands.execute(Commands.java:85)
>>>         at org.apache.jsieve.Block.execute(Block.java:79)
>>>         at
>>> org.apache.jsieve.SieveParserVisitorImpl.visit(SieveParserVisitorImpl
>>> .java:198)
>>>         at
>>> org.apache.jsieve.parser.generated.ASTstart.jjtAccept(ASTstart.java:1
>>> 8)
>>>         at
>>> org.apache.jsieve.SieveFactory.evaluate(SieveFactory.java:152)
>>>         at
>>> org.apache.jsieve.samples.james.JSieve.evaluate(JSieve.java:233)
>>>         at
>>> org.apache.jsieve.samples.james.JSieve.service(JSieve.java:126)
>>>         at
>>> org.apache.james.transport.LinearProcessor.service(LinearProcessor.ja
>>> va:422)
>>>         at
>>> org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManage
>>> r.java:403)
>>>         at
>>> org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.ja
>>> va:307)
>>>         at java.lang.Thread.run(Thread.java:534)
>>> Apr 10, 2007 1:07:48 PM org.apache.jsieve.SieveFactory evaluate
>>> SEVERE: Evaluation failed. Reason: Lookup failed due to a Configuration
>>> Exceptio
>>> n: java.io.IOException: Resource "sieveConfig.xml" not found
>>> Executed Actions :
>>>
>>> Also the content of filter.sieve file which i look up through ftp is
>>>
>>> #
>>> # Example Sieve Filter
>>> # Declare any optional features or extension used by the script
>>> #
>>> require["fileinto", "reject"];
>>> #
>>>
>>> # Handle messages from known mailing lists
>>> # Move messages from IETF filter discussion list to filter folder
>>> #
>>> if header:is "Sender" "user1@a3-ketanp.com"
>>>         {
>>>         fileinto "filter";  # move to "filter" folder
>>>         }
>>> #
>>> # Keep all messages to or from people in my company
>>> #
>>> elsif address :domain :is ["From", "To"] "a3-ketanp.com"
>>>         {
>>>         keep;               # keep in "In" folder
>>>         }
>>>
>>> #
>>> # Try and catch unsolicited email.  If a message is not to me,
>>> # or it contains a subject known to be spam, file it away.
>>> #
>>> elsif anyof (not address :all :contains
>>>                ["To", "Cc", "Bcc"] "user1@a3-ketanp.com",
>>>              header :matches "subject"
>>>                ["*make*money*fast*", "*university*dipl*mas*"])
>>>         {
>>>         # If message header does not contain my address,
>>>         # it's from a list.
>>>         fileinto "spam";   # move to "spam" folder
>>>         }
>>> else
>>>         {
>>>         # Move all other (non-company) mail to "personal"
>>>         # folder.
>>>         fileinto "personal";
>>>         }
>>>
>>> #
>>> # Reject any large messages (note that the four leading dots get
>>> # "stuffed" to three)
>>> #
>>> if size:over 1M
>>>         {
>>>         reject text:
>>> Please do not send me large attachments.
>>> Put your file on a server and send me the URL.
>>> Thank you.
>>> .... Fred
>>> .
>>> ;
>>>         stop;
>>>         }
>>>
>>>
>>> pls provide me some inputs
>>>
>>> Thanks in Advance,
>>> Ketan.B.Parekh 
>>>
>>>
>>>   
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-dev-help@james.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/mail-not-getting-filtered-using-jsieve-tf3553523.html#a9942351
Sent from the James - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: mail not getting filtered using jsieve

Posted by ketanbparekh <ta...@yahoo.com>.
hi norman,

my sieveconfig.xml is in james-2.3.0/conf also in apps/SAR-INF/conf

where is the right place to keep sieveConfig.xml. ?

Ketan.B.Parekh

Norman Maurer-3 wrote:
> 
> Where is your sieveConfig.xml located ? Is it in the right path ?
> 
> bye
> Norman
> 
> ketanbparekh schrieb:
>> Hi All,
>>
>> I am using james-2.3.0 and jsieve for content filtering
>>
>> I have created two users user1 and user2 through telnet. I have
>> configured
>> outllook for sending mails from user1 to user1(same user).
>>
>> I am able to get the mails but they are not getting filtered by jsieve. 
>> I
>> get an exception on james console but still i am getting the mails in
>> user1
>> inbox.
>>
>> SEVERE: Exception processing Configuration:
>> java.io.IOException: Resource "sieveConfig.xml" not found
>>         at
>> org.apache.jsieve.ConfigurationManager.getConfigStream(ConfigurationM
>> anager.java:162)
>>         at
>> org.apache.jsieve.ConfigurationManager.parse(ConfigurationManager.jav
>> a:383)
>>         at
>> org.apache.jsieve.ConfigurationManager.<init>(ConfigurationManager.ja
>> va:73)
>>         at
>> org.apache.jsieve.ConfigurationManager.computeInstance(ConfigurationM
>> anager.java:120)
>>         at
>> org.apache.jsieve.ConfigurationManager.updateInstance(ConfigurationMa
>> nager.java:136)
>>         at
>> org.apache.jsieve.ConfigurationManager.getInstance(ConfigurationManag
>> er.java:98)
>>         at
>> org.apache.jsieve.CommandManager.getClassNameMap(CommandManager.java:
>> 211)
>>         at
>> org.apache.jsieve.CommandManager.getClassName(CommandManager.java:190
>> )
>>         at
>> org.apache.jsieve.CommandManager.lookup(CommandManager.java:116)
>>         at
>> org.apache.jsieve.CommandManager.newInstance(CommandManager.java:145)
>>
>>         at org.apache.jsieve.Command.execute(Command.java:41)
>>         at org.apache.jsieve.Commands.execute(Commands.java:85)
>>         at org.apache.jsieve.Block.execute(Block.java:79)
>>         at
>> org.apache.jsieve.SieveParserVisitorImpl.visit(SieveParserVisitorImpl
>> .java:198)
>>         at
>> org.apache.jsieve.parser.generated.ASTstart.jjtAccept(ASTstart.java:1
>> 8)
>>         at org.apache.jsieve.SieveFactory.evaluate(SieveFactory.java:152)
>>         at
>> org.apache.jsieve.samples.james.JSieve.evaluate(JSieve.java:233)
>>         at
>> org.apache.jsieve.samples.james.JSieve.service(JSieve.java:126)
>>         at
>> org.apache.james.transport.LinearProcessor.service(LinearProcessor.ja
>> va:422)
>>         at
>> org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManage
>> r.java:403)
>>         at
>> org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.ja
>> va:307)
>>         at java.lang.Thread.run(Thread.java:534)
>> Apr 10, 2007 1:07:48 PM org.apache.jsieve.SieveFactory evaluate
>> SEVERE: Evaluation failed. Reason: Lookup failed due to a Configuration
>> Exceptio
>> n: java.io.IOException: Resource "sieveConfig.xml" not found
>> Executed Actions :
>>
>> Also the content of filter.sieve file which i look up through ftp is
>>
>> #
>> # Example Sieve Filter
>> # Declare any optional features or extension used by the script
>> #
>> require["fileinto", "reject"];
>> #
>>
>> # Handle messages from known mailing lists
>> # Move messages from IETF filter discussion list to filter folder
>> #
>> if header:is "Sender" "user1@a3-ketanp.com"
>>         {
>>         fileinto "filter";  # move to "filter" folder
>>         }
>> #
>> # Keep all messages to or from people in my company
>> #
>> elsif address :domain :is ["From", "To"] "a3-ketanp.com"
>>         {
>>         keep;               # keep in "In" folder
>>         }
>>
>> #
>> # Try and catch unsolicited email.  If a message is not to me,
>> # or it contains a subject known to be spam, file it away.
>> #
>> elsif anyof (not address :all :contains
>>                ["To", "Cc", "Bcc"] "user1@a3-ketanp.com",
>>              header :matches "subject"
>>                ["*make*money*fast*", "*university*dipl*mas*"])
>>         {
>>         # If message header does not contain my address,
>>         # it's from a list.
>>         fileinto "spam";   # move to "spam" folder
>>         }
>> else
>>         {
>>         # Move all other (non-company) mail to "personal"
>>         # folder.
>>         fileinto "personal";
>>         }
>>
>> #
>> # Reject any large messages (note that the four leading dots get
>> # "stuffed" to three)
>> #
>> if size:over 1M
>>         {
>>         reject text:
>> Please do not send me large attachments.
>> Put your file on a server and send me the URL.
>> Thank you.
>> .... Fred
>> .
>> ;
>>         stop;
>>         }
>>
>>
>> pls provide me some inputs
>>
>> Thanks in Advance,
>> Ketan.B.Parekh 
>>
>>
>>   
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/mail-not-getting-filtered-using-jsieve-tf3553523.html#a9925721
Sent from the James - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org