Question
"We have an email inbox that we like to monitor for incoming emails. These emails can contain attachments. If they contain PDF attachments, we would like to print these attachments automatically."
Configuration
- Create a new channel with the name "Print PDF attachments from inbox"
- 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 minutes
to prevent attacks!
- For [Input] use [Email] as input type.
- Configure the email connection. In our case we use
IMAP
and 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 theINBOX
. - 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:(?i).*[.]pdf$
- Skip the [Input Filter] and also skip the [Conversion] tab.
- For the [Output] select
Print
in case you want to print the attachments. You can also dump the PDF attachments to a folder by selectingLocal\Network
as Output Type. - 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.
Extra
Only print PDF files?
How can we process only emails with PDF attachments, coming from the email domain @ricoh.com
?
This can be done by using an Input Filter
.
- Go to [Input Filter].
- Click the green [Add] button.
- Select the option
Property
for [Filter type:] and click [Add]:
- We want to match the From-email address with a regular expression
.*[@]ricoh.com$
Note: some email servers will not give you the From-email address but will also prefix the name,
for example(John Peeters) John@ricoh.com
or"John Peeters" <john@ricoh.com>
For this you will need to test and modify your regular expression.
Gmail.com
Gmail has a strict security policy. Make sure you allow Less secure apps for your Google account.
- Go to your Google Account ( https://myaccount.google.com/ )
- From the menu select Security.
- Scroll down to the Less secure app access section.
- Turn the setting On.
Summary
You should have learned how to process email 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.
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.
See also
- Less secure apps & your Google account support.google.com