Dear Eric,

Thank you for your reply.

The below code is working fine with beta james 4. When I call the
sieveMailet.service(mail) the mails are getting stored in MyFolder. I
am confused as to how the code needs to be changed to make it work in
james beta 3 to get the mails stored in MyFolder rather than INBOX.
Please guide me. Below is my code.

        public void init() throws MessagingException {
                sieveMailet = new SieveMailet();
                sieveMailet.setUsersRepository(usersRepository);
                sieveMailet.setMailboxManager(mailboxManager);
                sieveMailet.setFileSystem(fileSystem);
                sieveMailet.init(new MailetConfig() {
                        /*
                         * @see
                         * 
org.apache.mailet.MailetConfig#getInitParameter(java.lang.String)
                         */
                        public String getInitParameter(String name) {
                                if ("addDeliveryHeader".equals(name)) {
                                        return "Delivered-To";
                                } else if ("resetReturnPath".equals(name)) {
                                        return "true";
                                } else {
                                        return 
getMailetConfig().getInitParameter(name);
                                }
                        }

                        /*
                         * @see 
org.apache.mailet.MailetConfig#getInitParameterNames()
                         */
                        @SuppressWarnings("unchecked")
                        public Iterator<String> getInitParameterNames() {
                                IteratorChain c = new IteratorChain();
                                Collection<String> h = new ArrayList<String>();
                                h.add("addDeliveryHeader");
                                h.add("resetReturnPath");
                                
c.addIterator(getMailetConfig().getInitParameterNames());
                                c.addIterator(h.iterator());
                                return c;
                        }

                        /*
                         * @see 
org.apache.mailet.MailetConfig#getMailetContext()
                         */
                        public MailetContext getMailetContext() {
                                return getMailetConfig().getMailetContext();
                        }

                        /*
                         * @see org.apache.mailet.MailetConfig#getMailetName()
                         */
                        public String getMailetName() {
                                return getMailetConfig().getMailetName();
                        }

                });
                // Override the default value of "quiet"
                sieveMailet.setQuiet(getInitParameter("quiet", true));
                sieveMailet.setFolder(getInitParameter("folder", "MyFolder"));
        }

Regards,
Rajender

On Tue, Feb 19, 2013 at 3:27 PM, Eric Charles <e...@apache.org> wrote:
> Hi Rajender,
>
> The setFolder method has been introduced to make the SieveMailet
> configurable for e.g. the ToSenderFolder mailet.
>
> The setFilesystem is there since a longer time and is needed to allow access
> to the mailrepository system if I remember well.
>
> In all cases, there are too many changes in the injection system to easily
> run the beta3 SieveMailet in the current trunk code.
>
> Thx, Eric
>
>
>
> On 18/02/2013 16:29, Rajender Vallapureddy wrote:
>>
>> Dear Eric,
>>
>> I am using james beta 4 SieveMailet.java to direct mails to a
>> particular folder other than "Inbox".
>> setFilesystem & setFolder are two functions which I am using to get
>> the required functionality working.
>>
>>
>> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.james/james-server-mailets/3.0-beta4/org/apache/james/transport/mailets/SieveMailet.java
>>
>> For a reason I had to move back to James beta 3. I couldn't find the
>> above mentioned functions in James beta 3 SieveMailet.java.
>>
>> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.james/james-server-mailets/3.0-beta3/org/apache/james/transport/mailets/SieveMailet.java
>>
>> Is there any work around in James Beta 3 so that my functionality
>> works properly even if I move back to beta 3?
>>
>> Appreciate your help.
>>
>> Thank you,
>> Regards,
>> Rajender
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
>> For additional commands, e-mail: server-dev-h...@james.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
> For additional commands, e-mail: server-dev-h...@james.apache.org
>

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

Reply via email to