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 Rajender Vallapureddy <ra...@hnexus.com> on 2013/02/18 17:29:24 UTC

missing SieveMailet.java functions setFilesystem & setFolder in james beta 3

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-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: missing SieveMailet.java functions setFilesystem & setFolder in james beta 3

Posted by Eric Charles <er...@apache.org>.
If your code works with beta4, You should diff SieveMailet-beta4 with 
SieveMailet-beta3 and backport that diff to SieveMailet-beta3.

The change should normally be trivial. And you will need to 
recompile/repackage James.

Hopes this help, Eric


On 19/02/2013 10:11, Rajender Vallapureddy wrote:
> 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 <er...@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-unsubscribe@james.apache.org
>>> For additional commands, e-mail: server-dev-help@james.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-dev-help@james.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>

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


Re: missing SieveMailet.java functions setFilesystem & setFolder in james beta 3

Posted by Rajender Vallapureddy <ra...@hnexus.com>.
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 <er...@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-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-dev-help@james.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>

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


Re: missing SieveMailet.java functions setFilesystem & setFolder in james beta 3

Posted by Eric Charles <er...@apache.org>.
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-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>

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