Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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

Labels (2)
4 Replies
fdenis
Master
Master

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

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
fdenis
Master
Master

check JavaMail version…
AndreK
Contributor III
Contributor III

I have the same problem.

I have also to move mails from one folder to other.

Do you have already a solution for this issue?

 

Kind regards,