You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Muhammad Ismail <it...@gmail.com> on 2015/03/24 16:30:39 UTC

James:: Move Succesfully Processed Email to a separte directory

Hi

After processing an email successfully if change its state to some custom
processor & inside that processor can we copy/ move file to specified
directory  ?

Actually I am trying to figure out how we can copy or move the email which
get processed successfully to a separate directory.

-- 
Thanks

Re: James:: Move Succesfully Processed Email to a separte directory

Posted by Jerry Malcolm <te...@malcolms.com>.
There is a ToFolder mailet provided by James (I'm on James 3b5...). 
Unfortunately, it is not easily subclassable to set the target folder.  
But I just cloned the entire mailet from the James source, renamed it, 
and customized it.  You can then add whatever logic you need and define 
the folder that each mail item is to be placed into.

Jerry

On 3/27/2015 10:25 AM, Muhammad Ismail wrote:
> Anyone ?
>
> On Tue, Mar 24, 2015 at 8:30 PM, Muhammad Ismail <it...@gmail.com>
> wrote:
>
>> Hi
>>
>> After processing an email successfully if change its state to some custom
>> processor & inside that processor can we copy/ move file to specified
>> directory  ?
>>
>> Actually I am trying to figure out how we can copy or move the email which
>> get processed successfully to a separate directory.
>>
>> --
>> Thanks
>>
>>
>


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


AW: AW: James:: Move Succesfully Processed Email to a separte directory

Posted by Bernd Waibel <BW...@intarsys.de>.
Yes, should work, if the state of the mail is not changed by your code.

-----Ursprüngliche Nachricht-----
Von: Muhammad Ismail [mailto:it.is.ismail@gmail.com] 
Gesendet: Freitag, 27. März 2015 23:10
An: James Users List
Betreff: Re: AW: James:: Move Succesfully Processed Email to a separte directory

Thanks Bernd for detail reply. I am currently using james version 2.3. I have already write a custom mailet which process emails where host-is-local.
All I want is after processing email in my custom mailet, I want to store those email in directory like "success-emails" Remote dilevry is disabled.

After processing email in my custom mailet changin email state to "to repositry" will work ?
 On 28 Mar 2015 03:00, "Bernd Waibel" <BW...@intarsys.de> wrote:

> Hello Muhammad,
>
> depends on which version von James you are running.
> And it depends on the question if you want the mail to store and 
> finish, or store and send further.
> Also it depends if you want it to be stored in a database, a 
> directory, a imap folder,...
> I suppose you mean a "directory on the local server". A directory is 
> called a "File Repository".
>
> In version 3 there are some mailets to handle that, see:
> http://james.apache.org/server/3/dev-provided-mailets.html
> ToRepository
> ToMultiRepository
> ToSenderFolder
>
> In version 2 there are some mailets to handle that, see:
> https://james.apache.org/server/2/repositories.html
> https://james.apache.org/server/2/provided_mailets.html
> https://james.apache.org/server/2/
>
> Also here, not sure which version:
> http://james.apache.org/mailet/standard/mailet-report.html
>
> So I think, yes, you could do that.
>
> The state of a mail is "root", if it is in process.
> It is "error", if something went terrible wrong.
> And it is "ghost", if it will not been sent to another server.
> "Ghost" means also, that it will be deleted from memory after handling.
>
> Some mailets provide an attribute called "passThrough".
> This decides, if the "mail flow" will continue to the next 
> matcher/mailet, or not.
>
> For example: The standard "error" processor will just store the file 
> in the "error" folder (in V2).
>
>
> Greetings
> Bernd
>
> -----Ursprüngliche Nachricht-----
> Von: Muhammad Ismail [mailto:it.is.ismail@gmail.com]
> Gesendet: Freitag, 27. März 2015 16:26
> An: server-user@james.apache.org
> Betreff: Re: James:: Move Succesfully Processed Email to a separte 
> directory
>
> Anyone ?
>
> On Tue, Mar 24, 2015 at 8:30 PM, Muhammad Ismail 
> <it...@gmail.com>
> wrote:
>
> > Hi
> >
> > After processing an email successfully if change its state to some 
> > custom processor & inside that processor can we copy/ move file to 
> > specified directory  ?
> >
> > Actually I am trying to figure out how we can copy or move the email 
> > which get processed successfully to a separate directory.
> >
> > --
> > Thanks
> >
> >
>
>
> --
> Thanks
> Muhammad Ismail
> cell (PAK) : +92.322.5100362
> cell (Sweden): +46 700-321-521
> e-mail: it.is.ismail@gmail.com
>
> This message may contain confidential and/or privileged information.  
> If you are not the addressee or authorized to receive this for the 
> addressee, you must not use, copy, disclose or take any action based 
> on this message or any information herein.  If you have received this 
> message in error, please advise the sender immediately by reply e-mail 
> and delete this message.  Thank you for your cooperation.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>

Re: AW: James:: Move Succesfully Processed Email to a separte directory

Posted by Muhammad Ismail <it...@gmail.com>.
Thanks Bernd for detail reply. I am currently using james version 2.3. I
have already write a custom mailet which process emails where host-is-local.
All I want is after processing email in my custom mailet, I want to store
those email in directory like "success-emails" Remote dilevry is disabled.

After processing email in my custom mailet changin email state to "to
repositry" will work ?
 On 28 Mar 2015 03:00, "Bernd Waibel" <BW...@intarsys.de> wrote:

> Hello Muhammad,
>
> depends on which version von James you are running.
> And it depends on the question if you want the mail to store and finish,
> or store and send further.
> Also it depends if you want it to be stored in a database, a directory, a
> imap folder,...
> I suppose you mean a "directory on the local server". A directory is
> called a "File Repository".
>
> In version 3 there are some mailets to handle that, see:
> http://james.apache.org/server/3/dev-provided-mailets.html
> ToRepository
> ToMultiRepository
> ToSenderFolder
>
> In version 2 there are some mailets to handle that, see:
> https://james.apache.org/server/2/repositories.html
> https://james.apache.org/server/2/provided_mailets.html
> https://james.apache.org/server/2/
>
> Also here, not sure which version:
> http://james.apache.org/mailet/standard/mailet-report.html
>
> So I think, yes, you could do that.
>
> The state of a mail is "root", if it is in process.
> It is "error", if something went terrible wrong.
> And it is "ghost", if it will not been sent to another server.
> "Ghost" means also, that it will be deleted from memory after handling.
>
> Some mailets provide an attribute called "passThrough".
> This decides, if the "mail flow" will continue to the next matcher/mailet,
> or not.
>
> For example: The standard "error" processor will just store the file in
> the "error" folder (in V2).
>
>
> Greetings
> Bernd
>
> -----Ursprüngliche Nachricht-----
> Von: Muhammad Ismail [mailto:it.is.ismail@gmail.com]
> Gesendet: Freitag, 27. März 2015 16:26
> An: server-user@james.apache.org
> Betreff: Re: James:: Move Succesfully Processed Email to a separte
> directory
>
> Anyone ?
>
> On Tue, Mar 24, 2015 at 8:30 PM, Muhammad Ismail <it...@gmail.com>
> wrote:
>
> > Hi
> >
> > After processing an email successfully if change its state to some
> > custom processor & inside that processor can we copy/ move file to
> > specified directory  ?
> >
> > Actually I am trying to figure out how we can copy or move the email
> > which get processed successfully to a separate directory.
> >
> > --
> > Thanks
> >
> >
>
>
> --
> Thanks
> Muhammad Ismail
> cell (PAK) : +92.322.5100362
> cell (Sweden): +46 700-321-521
> e-mail: it.is.ismail@gmail.com
>
> This message may contain confidential and/or privileged information.  If
> you are not the addressee or authorized to receive this for the addressee,
> you must not use, copy, disclose or take any action based on this message
> or any information herein.  If you have received this message in error,
> please advise the sender immediately by reply e-mail and delete this
> message.  Thank you for your cooperation.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>

AW: James:: Move Succesfully Processed Email to a separte directory

Posted by Bernd Waibel <BW...@intarsys.de>.
Hello Muhammad,

depends on which version von James you are running.
And it depends on the question if you want the mail to store and finish, or store and send further.
Also it depends if you want it to be stored in a database, a directory, a imap folder,...
I suppose you mean a "directory on the local server". A directory is called a "File Repository".

In version 3 there are some mailets to handle that, see:
http://james.apache.org/server/3/dev-provided-mailets.html
ToRepository
ToMultiRepository
ToSenderFolder

In version 2 there are some mailets to handle that, see:
https://james.apache.org/server/2/repositories.html
https://james.apache.org/server/2/provided_mailets.html
https://james.apache.org/server/2/

Also here, not sure which version:
http://james.apache.org/mailet/standard/mailet-report.html

So I think, yes, you could do that.

The state of a mail is "root", if it is in process.
It is "error", if something went terrible wrong.
And it is "ghost", if it will not been sent to another server.
"Ghost" means also, that it will be deleted from memory after handling.

Some mailets provide an attribute called "passThrough". 
This decides, if the "mail flow" will continue to the next matcher/mailet, or not.

For example: The standard "error" processor will just store the file in the "error" folder (in V2).


Greetings
Bernd

-----Ursprüngliche Nachricht-----
Von: Muhammad Ismail [mailto:it.is.ismail@gmail.com] 
Gesendet: Freitag, 27. März 2015 16:26
An: server-user@james.apache.org
Betreff: Re: James:: Move Succesfully Processed Email to a separte directory

Anyone ?

On Tue, Mar 24, 2015 at 8:30 PM, Muhammad Ismail <it...@gmail.com>
wrote:

> Hi
>
> After processing an email successfully if change its state to some 
> custom processor & inside that processor can we copy/ move file to 
> specified directory  ?
>
> Actually I am trying to figure out how we can copy or move the email 
> which get processed successfully to a separate directory.
>
> --
> Thanks
>
>


--
Thanks
Muhammad Ismail
cell (PAK) : +92.322.5100362
cell (Sweden): +46 700-321-521
e-mail: it.is.ismail@gmail.com

This message may contain confidential and/or privileged information.  If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein.  If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message.  Thank you for your cooperation.

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

Re: James:: Move Succesfully Processed Email to a separte directory

Posted by Muhammad Ismail <it...@gmail.com>.
Anyone ?

On Tue, Mar 24, 2015 at 8:30 PM, Muhammad Ismail <it...@gmail.com>
wrote:

> Hi
>
> After processing an email successfully if change its state to some custom
> processor & inside that processor can we copy/ move file to specified
> directory  ?
>
> Actually I am trying to figure out how we can copy or move the email which
> get processed successfully to a separate directory.
>
> --
> Thanks
>
>


-- 
Thanks
Muhammad Ismail
cell (PAK) : +92.322.5100362
cell (Sweden): +46 700-321-521
e-mail: it.is.ismail@gmail.com

This message may contain confidential and/or privileged information.  If
you are not the addressee or authorized to receive this for the addressee,
you must not use, copy, disclose or take any action based on this message
or any information herein.  If you have received this message in error,
please advise the sender immediately by reply e-mail and delete this
message.  Thank you for your cooperation.