Email to DocuWare, Laserfiche or M-Files: file email attachments with index fields automatically

Email to DocuWare, Laserfiche or M-Files: Mail Attachment Downloader files attachments with index fields from the email and never files one twice.

Mail Attachment Downloader's Send to document management step: connection Accounts payable (DocuWare), file cabinet Invoices, 5 fields filled, document name {INVOICE_NUMBER} {FILENAME}, one document per saved file, and Update the document filed before if the email comes again

To get email into DocuWare, Laserfiche or M-Files without dragging files by hand, let a rule pick the emails and add the Send to document management step. Mail Attachment Downloader then files each saved attachment in your file cabinet, repository folder or vault, with its index fields filled from the email and from values found in the document. If the same email is processed again, the document it filed is updated, not duplicated.

New in version 4.0. The examples use Contoso’s mailbox finance@contoso.com, invoices from Acme and Fabrikam, and invoice numbers like INV-2026-0423.

Which document management systems does it work with?

  • DocuWare: DocuWare Cloud or your own DocuWare server. Documents go into a file cabinet (or a basket).
  • Laserfiche Cloud, and Laserfiche on your own server with the Laserfiche API Server, version 11 or later. Documents go into a folder of the repository.
  • M-Files: a vault on your M-Files server or in M-Files Cloud. Documents get a class, whose properties are the fields.

Using another system, or a capture tool such as Chronoscan? See email capture through a watched folder below.

What you need

  • The edition: PRO Rules Client or PRO Rules Server. Send to document management is a step in a PRO rule.
  • Windows: Windows 10 or later, 64-bit, on a PC, a server or a cloud VM. No Outlook needed.
  • The mailbox: Gmail, Google Workspace, Microsoft 365, Outlook.com, Exchange, or any IMAP or POP3 mailbox.
  • The system: a sign-in with the right to store documents where they should go.

Step 1: Connect DocuWare, Laserfiche or M-Files once

Open Settings › Sources › Document Management, click Add… and choose the system. Each window says what it needs; Where to find these values explains where they are in the system. Give it a Connection name, such as “Accounts payable”, click Test, then OK. Rules pick the connection by name, so many rules share one sign-in.

DocuWare (Cloud or on-premises)

Enter the Server: your DocuWare Cloud name, such as contoso, or the address of your own server. Sign in with offers three ways:

  • Service application (client ID and client secret): an app registration that signs in for itself. Nobody has to be signed in.
  • DocuWare user name and password: a DocuWare user, not a single sign-on one.
  • Sign in in the browser: for organizations that sign in through single sign-on.

List then finds the Organization.

New DocuWare connection window in Mail Attachment Downloader for email to DocuWare: Sign in with Service application (client ID and client secret), Server, Organization with List, Client ID, Client secret, Connection name DocuWare and Test
A DocuWare connection: DocuWare Cloud or your own server.

Laserfiche Cloud

In Laserfiche Cloud’s Developer Console, create a service app with a service principal that has rights to the repository, and an access key. Paste the Access key (or Load file…) and the Service principal key; List finds the Repository.

New Laserfiche Cloud connection window for Laserfiche email import: Sign in with Service app (access key and service principal key), Access key with Load file, Service principal key, Repository with List and Connection name Laserfiche Cloud
Laserfiche Cloud signs in with a service app’s access key.

Laserfiche on your own server

Enter the API Server, such as https://lfserver.contoso.com/LFRepositoryAPI, and sign in with a repository user, a Directory Server user or a Windows user (DOMAIN\user), or through Directory Server in the browser.

New Laserfiche connection window for Laserfiche on your own server (API Server, version 11 or later): Sign in with User name and password, API Server, Repository with List, User name, Password, Certificate Windows' own trust
Self-hosted Laserfiche needs the API Server, version 11 or later.

M-Files (server or M-Files Cloud)

Enter the Server: the M-Files Web address, or your M-Files Cloud vault’s address. Sign in with an M-Files user and password, a Windows user, or a federated sign-in in the browser (Entra ID, Okta, Google…). List finds the vaults the user can open.

New M-Files connection window to save email attachments to M-Files: Sign in with M-Files user name and password, Server, Vault with List, User name, Password and Connection name M-Files
An M-Files connection: your server or M-Files Cloud.

For your own server, the certificate must be one Windows trusts; one it doesn’t is shown when you test, for you to check and accept. Keys and passwords stay on this computer, encrypted, and nothing is sent until a rule uses the connection.

Step 2: Add Send to document management to a rule

  1. On the PRO Rules tab, click New rule…. Under Which emails, add a condition such as the sender’s domain acme.example. New to rules? Save emails and attachments to folders walks through one.
  2. Under Save, save the attachments. The step files these saved files.
  3. Under Then, click Add a step…, open Other systems and double-click Send to document management.
Add a step window with Other systems: Send to document management files the saved files in Laserfiche, M-Files or DocuWare, next to Upload to cloud, Send for signature, Send to Zapier and Web hook
Add a step › Other systems › Send to document management.

Then set up the step:

  • Connection: pick it. Manage… adds one if it isn’t there yet.
  • File cabinet, Folder or Class: click Browse… and choose where the documents go: the DocuWare file cabinet, the Laserfiche folder, or the M-Files class.
  • Fields: click Mapping… to fill the index fields (next section).
  • Test: signs in, finds the place and checks the fields. It sends nothing.
Mail Attachment Downloader's Send to document management step: connection Accounts payable (DocuWare), file cabinet Invoices, 5 fields filled, document name {INVOICE_NUMBER} {FILENAME}, one document per saved file, and Update the document filed before if the email comes again
Send to document management: pick the connection and the file cabinet, then map the fields.

Map index fields from the email and the document

Mapping… lists the fields of the file cabinet, the Laserfiche template or the M-Files class, with the required ones marked *. For each field, choose where its value comes from:

  • Rule fields: the email’s details, such as {SUBJECT}, {EMAIL_FROM} or {DATE[yyyy-MM-dd]}. Fill in the email’s details fills fields named Subject, From, To, Received or File name in one click.
  • Extracted field: a value the rule found in the document, such as {INVOICE_NUMBER} or {TOTAL_INCLUDING_TAX}, from Find fields in the file, Find fields with AI or the Parser.
  • Fixed text: the same value for each document, such as “Accounts payable”.

For dates and numbers, Format gives the form the field needs, such as MM/dd/yyyy. When empty says what happens to a value that comes out empty: Leave it empty, Use the fallback or Fail the send. Laserfiche documents can also get Tags; an M-Files lookup can add a list item for a value that isn’t one yet.

The field mapping window for the DocuWare file cabinet Invoices: Invoice number and Total from extracted fields, Supplier and Invoice date from the email's fields, Department as fixed text, and what to do when a value is empty
Map each index field to an email field, a value the rule found, or fixed text.

No duplicates when an email is processed again

The step remembers the ID of each document it filed. Under More options, If the email comes again decides what a second run does, for example after a Redo in the Downloads tab:

  • Update the document filed before (the default): its fields, name, and its file when it changed.
  • Add a new version of it: for M-Files; the others update it.
  • File another document, and keep both, or Leave the document as it is, send nothing.

Also under More options:

  • Document name: left empty, the saved file’s name; or fields, such as {INVOICE_NUMBER} {FILENAME}.
  • One document holds: each attachment as its own document, or, in M-Files and DocuWare, the email’s saved files together as one document.
  • If the name is taken (Laserfiche and M-Files; DocuWare doesn’t ask): by a document the program didn’t file. Let the system give it another name (the default), put the file into that document, send nothing, or fail the step.

Before you turn the rule on, click Test this rule…: it shows which emails the rule picks and only describes the send. And each account’s History remembers the emails it has handled, so a normal run doesn’t file the same email twice.

Email capture with Chronoscan or another tool

There’s no direct connector for capture tools such as Chronoscan. Let the rule save the attachments to the folder the tool watches, such as \\fileserver\Finance\Capture, named the way it likes, and the tool takes them from there. For SharePoint, OneDrive or S3, use Upload to cloud instead.

File documents around the clock

To file documents 24×7, even when nobody is signed in, run the program as the Windows service of PRO Rules Server. Pick a sign-in that needs no person: a DocuWare service application, a Laserfiche service app or user, or an M-Files or Windows user.

Questions people ask

Can I file the email itself in DocuWare or M-Files, not only the attachments?

Yes. Under Save, set What to save to The email and its attachments: the email is saved as an .eml file and filed with them. In M-Files and DocuWare, One document holds can keep them together as one document.

Does it fill DocuWare index fields from the PDF?

Yes, from values a Find fields step or the Parser found in the PDF, mapped with Mapping….

Does it work with Laserfiche 10?

The self-hosted connection needs the Laserfiche API Server, version 11 or later.

What if a send fails?

A busy system is tried again a few times. If it still fails, the step fails, the Downloads tab shows it, and History tries it again later.

Try it: download Mail Attachment Downloader and start with the free edition, or compare the PRO editions, each with a 30-day money-back guarantee.

Related

Questions about this post? Contact us.