🔌 Mail Attachment Downloader PRO Server

Send every email to your apps, APIs and AI.

Three rule actions connect Mail Attachment Downloader PRO to the rest of your tools. Run Webhook calls any web address with the email's details and files, Run AI prompt asks ChatGPT or Claude about the email and its attachments, and Run Handlebars template turns the JSON they answer into the text you need. Each answer goes into a field that the actions after it can use.

3Actions: webhook, AI prompt, template
5HTTP methods: POST, PUT, PATCH, GET, DELETE
2AI services: OpenAI ChatGPT and Anthropic Claude
24/7Also from the Windows service
How it works

An email in, an answer out

Add the actions to a rule's actions in the rule window. They run for each file the rule saves, or once for each email.

1

A rule matches

Your filters pick the emails and attachments: a sender, a subject, a type of file.

2

Fields are filled in

{SUBJECT}, {FROM}, an extracted invoice number or an earlier answer, each escaped for where it goes.

3

The call is made

To your web address, or to ChatGPT or Claude, with the files if you want. A busy service is tried again.

4

The answer is used

It goes into a field such as {RESULT_1}, and the actions under this one run with it.

Version 3.4, build 1038 and later. Fields in webhooks and AI prompts, their escaping, retries and the other details on this page are in build 1038 and later.
Fields

The email's details, where your request needs them

Type a field anywhere in the web address, a header, the payload or the prompt, or pick one with the button next to the payload or the prompt. The list shows the email's fields, your extractions, and the answers of earlier actions.

Fields you'll use most

  • {SUBJECT}, {FROM}, {EMAIL_FROM} (the address only), {TO} and {CC}
  • {DATE}, or the date in your format, such as {DATE[yyyy-MM-dd]}
  • {FILENAMEEXT} (the saved file's name), {FILENAME}, {EXT} and {SAVE_FILE} (its full path)
  • {EMAIL_BODY}, {ACCOUNT_EMAIL}, {MESSAGE_ID} and any header, such as {EMAIL_HEADER[X-Order-Id]}
  • Your extracted values, such as {INVOICE_NO}, and the answers of earlier actions, such as {RESULT_1}

Escaped for where they go

  • Web address: values are URL-encoded, so ?subject={SUBJECT} stays one parameter even with an & in the subject. An address that is only a field, such as {RESULT_1}, goes in as it is.
  • Headers: line breaks are left out.
  • JSON payload: a field inside quotes is JSON-escaped; a field outside quotes goes in as it is (see the example below).
  • XML payload (application/xml, text/xml or a type ending in +xml): <, >, & and quotes are escaped.
  • Form payload (application/x-www-form-urlencoded): values are URL-encoded.
  • Other content types, and AI prompts: values go in as they are.
{
  "subject": "{SUBJECT}",
  "from": "{EMAIL_FROM}",
  "file": "{FILENAMEEXT}",
  "invoice": "{INVOICE_NO}",
  "order": {RESULT_1}
}
A JSON payload as you type it.
{
  "subject": "Invoice \"1001\" for A&B",
  "from": "billing@supplier.com",
  "file": "invoice_1001.pdf",
  "invoice": "1001",
  "order": {"id": 42, "status": "open"}
}
What your web address receives. Inside quotes, the subject's quotes are escaped and the JSON stays valid. Outside quotes, {RESULT_1} (here the JSON an earlier webhook answered) goes in as JSON.
Run Webhook

Call any web address or API

Send the email's details, and its files if you want, to your own system, a Power Automate, Zapier or Make flow, a ticketing tool or any REST API.

Retries

A call is tried again when the address can't be reached, no answer comes within the timeout, or the answer is HTTP 408, 429 or a server error (5xx). It waits 2 seconds, then 4, 8 and so on, 30 at most, up to "Num retries" more times, and stops when the download is cancelled. Other answers, such as 400, 401 or 404, aren't retried: the same request would get the same answer.

Tip: a retried POST is sent again in full. If your endpoint creates records, have it ignore a repeat, for example by {MESSAGE_ID}.

When it fails

The status list shows the call as failed, with the answer it got:

Run webhook action failed: HTTP 500 (Internal Server Error) (after 4 attempts)

The rule's error actions run, and the actions under the webhook don't.

Test webhook

Sends one call with the settings on screen, with a sample email's values in the fields and no retries, and shows the answer.

Files in the request. One file and no payload is sent as the body itself, with the file's content type. Otherwise the request is multipart/form-data: the payload in a part named payload, and each file in a part named file.
Run AI prompt

Ask ChatGPT or Claude about each email

Summarize an invoice, sort a request, read the values a regular expression can't, or draft a reply.

From: {EMAIL_FROM}
Subject: {SUBJECT}
Read the attached invoice. Answer only with JSON:
{"supplier": "", "invoice": "", "total": 0, "due": "yyyy-mm-dd"}
A prompt that sends the invoice PDF ("Include files": from parent action) and asks for JSON, to use in a template or a webhook.

When it fails

A network error is tried again up to 3 times. Other errors, such as a wrong API key, end the action at once, so the prompt isn't sent, and paid for, again. The rule's error actions run.

Test Prompt

Sends the prompt as typed, without an email, to check the key and the model.

What leaves your computer. The prompt, with its fields filled in, and the files you include go to OpenAI or Anthropic under your account. Nothing goes through Gearmage.
Run Handlebars template

Turn JSON answers into the text you need

Webhooks and AI often answer with JSON. A Handlebars template picks out what you need and writes it your way: a line for an email, a file name, a value for a database.

Source variable
{"order": {RESULT_1}, "subject": "{SUBJECT}"}

Template
Order {{order.id}} for {{{order.customer}}}: {{order.total}} EUR ({{{subject}}})

Output variable {ORDER_LINE}
Order 42 for ACME Ltd: 129.90 EUR (Invoice "1001" for A&B)
An earlier webhook answered {"id": 42, "customer": "ACME Ltd", "total": 129.90} into {RESULT_1}. Handlebars templates also run in "Test this rule...", so you can check one before a download.
Chaining

When they run, and what runs after them

Per file or per email

"Run action when": Once per file saved (the default) runs it for each file the rule saves, with that file's fields. Once per email runs it once the email is processed, with the email's fields. Both once per email and once per file saved does both.

The actions under them

Actions added under a webhook, an AI prompt or a template run after it, with its answer in its field: for example AI prompt, then a Handlebars template, then Send email with {SUMMARY}. Once per email, they run once the email is processed too.

When an email fails

Once per email, these actions don't run for an email that couldn't be processed. To report such emails, add the action to the rule's error actions instead: there it runs because the email failed, and {ERROR_MESSAGE} says why.

1

The rule

PDF attachments from billing@supplier.com.

2

Run AI prompt

Reads the invoice and answers JSON into {INVOICE_JSON}.

3

Run Webhook

Posts {"invoice": {INVOICE_JSON}, "file": "{FILENAMEEXT}"} to your accounting system.

4

Template and email

Writes "Invoice 1001 from ACME booked" and emails it to the team.

Security and privacy

Your keys stay on your computer

Questions

Webhooks, AI prompts and templates

Which edition do I need?

Mail Attachment Downloader PRO Server. The actions run in the desktop app and in the Windows service. See plans and pricing.

Does the Windows service run them?

Yes, also when nobody is signed in. The service gets a copy of all your settings, rules included, when it's installed. After you change a rule, the Service tab shows "⚠ Reinstall to apply changes": reinstall the service there, and it runs the changed rule from then on.

How do I use one value from a JSON answer?

Save the answer in a field, then pick the value with a Handlebars template: Source variable {RESULT_1}, Template {{project.id}}, Output variable {PROJECT_ID}. To pass the whole answer on, put it in another webhook's JSON payload, outside quotes.

Can I post to Slack or Microsoft Teams?

Yes: Run Webhook with the channel's incoming webhook address and the JSON the app expects, for example {"text": "New invoice from {EMAIL_FROM}: {SUBJECT}"} for Slack.

What does the webhook receive when I include files?

One file and no payload: the file itself, with its content type. Otherwise a multipart/form-data request, with the payload in a part named payload and each file in a part named file.

How much does the AI cost?

You pay OpenAI or Anthropic for what you use, with your own key. Prompts with files cost more. When one answer per email is enough, run the prompt once per email rather than once per file.

What happens when a webhook is down?

It's tried again as "Num retries" says. Then the status list and Download History show it as failed, and the rule's error actions run, for example to move the email to a folder to look at later.

Pairs well with

Send what matters, about the emails that matter

These PRO features often go with webhooks and AI prompts.

✓ Rules and filters

Only call out for emails from a sender, with a subject, or with a type of attachment.

✓ Extract data

Send an invoice number or a total, not the whole email.

✓ Databases

Look up a customer before you call the API, or save the answer.

✓ Send email

Mail the AI's summary, or a template's text, to your team.

✓ Error actions

Move an email aside and tell someone when a call fails.

✓ Windows Service mode

Run 24/7, unattended, in the cloud or on-premises, even without a user signed in.

Let every email reach the systems that need it

Get Mail Attachment Downloader PRO Server and connect your mailbox to your APIs, ChatGPT or Claude, without writing a line of code.