如何使用Pentaho Kettle从电子邮件中获取附件? [英] How to get attached files from an email, using Pentaho Kettle?

查看:1608
本文介绍了如何使用Pentaho Kettle从电子邮件中获取附件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个很大的问题。我的任务是使用IMAP协议从服务器下载一些电子邮件。这是通过使用获取邮件(POP3 / IMAP)作业条目来完成的,该条目下载电子邮件,但是以二进制格式。



二进制格式的文件是 .mail 包含发件人,主题,正文和编码附件文件的文件。我需要获取单独的文件,因为我必须意识到这些文件作为输入的一些步骤。



我看到有第三方库或实用程序来解码 .mail 文件,并获取附件文件列表。然而,我想做这个过程没有任何额外的实用程序(因为这应该需要一个shell步骤,取决于SO)。



有什么办法或技巧得到附件仅使用Pentaho作业条目或转换步骤?



我使用的是Pentaho Kettle的版本5.1。

解决方案

我会解释整个过程,以便任何人都可以获得优势。




1 )添加 START 获取邮件(POP3 / IMAP)作业条目,并在它们之间创建一个跳转。

2)编辑获取邮件条目以使用IMAP服务器(主机名,端口号,用户名,密码等),然后单击测试连接以验证设置。

3)在目标文件夹中,取消选中保存消息内容,然后选中获取邮件附件和不同文件夹以进行附件。为目标目录和附件文件夹定义目标文件夹。

4)在设置选项卡上,选择要从中下载的IMAP文件夹。根据需要更改其他设置。

5)单击确定,保存作业和运行作业。


I'm stuck in a great problem. My task is to download some emails from a server using the IMAP protocol. This is accomplished by using the "get mails (POP3 / IMAP)" job entry, which downloads the emails, but in binary format.

Files in binary format are .mail files containing sender, subject, body, and encoded attachment files. I need to obtain separate files, because I must realize some steps with these files as input.

I've seen that there are third-party libraries or utilities to decode the .mail file and get the attachment file list. However, I want to do this process without any additional utility (because this should require a shell step, depending on the SO).

Is there any way or trick to get the attachments using only Pentaho job entries or transformation steps?

I'm using the version 5.1 of Pentaho Kettle.

解决方案

I will explain the whole process so that anybody can get the advantage of it.


1) Add START and Get mails (POP3/IMAP) job entries, and create a hop between them.
2) Edit the Get mails entry to use your IMAP server (host name, port number, username, password, etc), and click Test Connection to verify settings.
3) In the Target folder, uncheck Save message content and check Get mail attachment and Different folder for attachment. Define a target folder for both the Target directory and Attachment files folder.
4) On the Settings tab, select the IMAP folder that you want to download from. Change other settings as desired.
5) Click OK, Save the Job, and Run the job.

这篇关于如何使用Pentaho Kettle从电子邮件中获取附件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆