IMAP support in tPOP : move to folders after processing

Five Stars

IMAP support in tPOP : move to folders after processing

Hi folks

 

Try to build processing of incomming email and need to move processed imails from [Inbox] email folder to another email folder say [Processed]. Not local folders but email folders.

 

As I can see at the moment tPOP supports IMAP only for (marking for) deleting of emails which were retrieved from the server and saved into a local directory. So there is no visible way to handle moving processed imals between IMAP folders.

 

Meanwhile IMAP specification allows such actons and mayny libraries (Python etc) allow such manipulations. 

 

 

So how it could be achieved? How most of TOS developers handle such tasks? 

 

Any idea would be much appreciated!

Thanks and regards,

Alex

Tags (2)
Twelve Stars

Re: IMAP support in tPOP : move to folders after processing

there is no way on tos to easily do it. You may use tjavaFlex to build your own component using java code.

Francois Denis

Tag as "solved" for others! Kudos to thanks!

Five Stars

Re: IMAP support in tPOP : move to folders after processing

I already had to go Java way but building a complitelly new component would be overkill for me.

 

As for now I am surviving with the following tJava code:

 

System.out.println(message_tPOP_1.getClass().getName());

javax.mail.Message[] messages = new javax.mail.Message[]{ message_tPOP_1 };
javax.mail.Folder inbox = folder_tPOP_1;

javax.mail.Folder processed = store_tPOP_1.getFolder("processed");
inbox.copyMessages(messages, processed);

First println displays "com.sun.mail.imap.IMAPFolder " which brings a hope of using .moveMessages(Message[] msgs, Folder folder) however the hope is false because of very strange situation when Talend throws compilation errors about unknown method:

The method moveMessages(Message[], Folder) is undefined for the type Folder
Twelve Stars

Re: IMAP support in tPOP : move to folders after processing

check JavaMail version…

Francois Denis

Tag as "solved" for others! Kudos to thanks!

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 3

Read about some useful Context Variable ideas

Blog