"We would like to extract all email attachments from incoming emails and archive them to a local or network folder."
- Create a new channel with the name "Archive email attachments automatically"
- Set the schedule to [Periodic scheduling] and set a time interval of 10 minutes.
Note: commercial email providers like Gmail, Hotmail, Outlook tend to use a restriction and only allow a
polling interval of 10 minutesto prevent attacks!
- For [Input] use [Email] as input type.
- Configure the email connection. In our case we use
IMAPand complete the connection info (server, port 993. enable SSL/TLS, username and password). Use the connection settings from your system.
Your configuration might look similar to this one:
- Navigate to the [Options] tab and select the folder you want to monitor by clicking [Browse].
In our case we monitor the
- For the option [Data to return:] select
Only the attachment(s).
- Optionally you can select an [Attachment filter]. This allows you to only process certain types of attachments.
We only want to process emails that have PDF documents attached. By using a regular expression (regex) we filter out files with a pdf extension:
- Skip the [Input Filter] and also skip the [Conversion] tab.
- For the [Output] select
Local/Networkin case you want to archive the documents to a local or network folder.
- For [Post-Action] we will configure two actions on success:
- First mark the email as read.
(File Processor processes unread emails, so we have to mark them as read, otherwise they will be processed over-and-over again!)
- Second, delete the email:
It is a good practice to first mark the email as read and afterwards delete it. Some email servers do not delete emails when they are not first being marked as read.
How can we process only emails with PDF attachments, coming from the email domain
This can be done by using an
- Go to [Input Filter].
- Click the green [Add] button.
- Select the option
Propertyfor [Filter type:] and click [Add]:
- We want to match the From-email address with a regular expression
Note: some email servers will not give you the From-email address but will also prefix the name,
(John Peeters) John@ricoh.comor
"John Peeters" <firstname.lastname@example.org>
For this you will need to test and modify your regular expression.
You should have learned how to process email attachments and archive the attachments. By using the attachments filter from the email you can filter out attachments that end with a specific file extension, or that contain specific words or numbers. For example, this would allow you to only archive PDF attachments from emails.
The Input Filter works on the complete email, not on the attachments (as an attachment is contained inside an email). Therefor the Input Filter is very suited to filter out specific email accounts. With a regular expression it is easy to filter out only emails coming from specific accounts or domains.
In this example we used IMAP, but Exchange or other email providers could also be used.