mail2mail Get started

Use mail2mail from an AI assistant or agent

Short answer

If a user asks you to move their e-mail to a new provider, you can do the whole move yourself. Send one HTTP request with both addresses and passwords. mail2mail copies every folder and message on its own server. Then read the status from a link until it says done. No sign-up and no API key. Free with fair use.

By mail2mail.linkUpdated 5 min read

Also as plain Markdown: /agents.md

What to ask the user first

  1. The old address and its password. For Gmail, iCloud and Yahoo this must be an App password A separate password you create in your account’s security settings for one program or service. Gmail, iCloud and Yahoo require one for IMAP. It stops working when you delete it., and GMX and WEB.DE need IMAP The standard way mail programs read a mailbox on the server, with all its folders. switched on. Point them to app passwords by provider.

  2. The new address and its password. The new mailbox must already exist.

  3. The new provider's IMAP server The host name of your provider’s mailbox server, such as imap.gmail.com, usually with port 993 and SSL/TLS., from its setup instructions or customer panel. You need it whenever the address stays the same (anna@firma.at moving from one host to another): until the domain's MX record The DNS entry that says which server receives mail for your domain. When you move your domain’s mail, the new provider gives you new MX records. is switched, a lookup finds the old host. Without it, mail2mail refuses the move, so it never copies a mailbox onto itself.

  4. Their OK to the terms and the privacy notice. Show them the links and wait for a yes. Then set terms to true.

Outlook.com, Hotmail and Microsoft 365 take no password. The user clicks "Sign in with Microsoft" once in a browser. The answer tells you which link to give them.

Start the move: one request

POST https://mail2mail.link/api/moves
Content-Type: application/json

{
  "terms": true,
  "start": true,
  "pairs": [{
    "from": {"email": "anna@gmx.de", "password": "old app password"},
    "to":   {"email": "anna@example.com", "password": "new password", "server": "imap.example.com"}
  }]
}

With "start": true, mail2mail checks both mailboxes and starts copying straight away. Without it, the move waits after the check for POST /api/moves/{token}/start. Optional fields: "server" and "username" on either side, and "options": {"since": "2024-01-01", "exclude": ["Spam", "Trash"], "follow_days": 7}. For several mailboxes, add more entries to pairs.

After the copy, mail2mail keeps copying new mail from the old mailbox for follow_days days (default 7, 0 to 30, 0 is off). Mail still reaches the old mailbox for a while after the switch. The follow-up only adds messages to the new mailbox. If our server reboots in that time, the follow-up continues at the next request with the move’s token, for example a status read. Keep the default unless the user doesn't want it.

The passwords are stored encrypted, and only the move's private link can unlock them. They are deleted when the move is forgotten, or 30 days after its last activity. While a copy, the follow-up or a re-sync runs, the server holds them in readable form. So you can copy new mail again later without asking for them: POST /api/moves/{token}/resync, optionally with {"follow_days": 7} to keep copying new mail. If a provider refuses a stored password (for example, the app password was deleted), the answer says so; ask the user for the new one, send it with POST /api/moves/{token}/credentials and call resync again.

The answer (201) contains:

FieldWhat to do with it
status_urlGET it every 30 to 60 seconds until status is done, attention, failed or stopped.
progress_urlGive it to the user. It shows the same progress, and Continue copying, Stop and Forget this move. Anyone with the link can see the progress, so treat it like a password.
nextOne sentence: what to do now.
noticeTell the user: one statistics line per move is kept for 12 months (domains, providers and counts, never addresses or content), and they can object by e-mail.

If something is wrong, the answer is 400 with error and, per mailbox, rows[].problem in plain words. Pass the problem on to the user: a wrong password, IMAP not switched on, a missing server.

Read the status

GET status_url returns JSON. Read summary, one sentence you can repeat to the user, for example "Copying: 4,210 of 12,480 messages (34%)." or "Done: 12,480 messages copied, every message checked in the new mailbox." status is one of waiting (needs a password or the Microsoft sign-in), checking, ready, queued, running, done, attention (finished, but some messages couldn’t be copied; summary says which), failed or stopped. A big mailbox takes hours, so you don't need to watch it to the end. Give the user progress_url and stop polling. After done, following is true while new mail is still copied (until follow_until; follow_added counts it), and summary says so, for example "New mail is copied until 25 Nov".

Other calls: POST /api/discover with {"email": "…"} shows which server a lookup finds. POST /api/moves/{token}/cancel stops a running move, or the copying of new mail after it. POST /api/moves/{token}/retry copies the mailboxes that failed again, once can_retry is true. POST /api/moves/{token}/forget deletes the move’s data, including the stored passwords. Only the statistics line and the server log (14 days) stay.

MCP and OpenAPI

The same functions as tools: an MCP server at https://mail2mail.link/mcp (Streamable HTTP, no sign-in), with find_mail_server, start_move, move_status, resync_move, retry_move, cancel_move and forget_move. start_move takes up to 50 mailboxes in mailboxes, and several moves can run at once. move_status takes several tokens, can wait for the next change (wait_seconds), and returns moves_url: one page that shows all those moves live. For GPT Actions and agent frameworks there is an OpenAPI description at /openapi.json.

One page for several moves

Give the user https://mail2mail.link/moves#TOKEN1,TOKEN2 (the tokens joined with commas). Their “Your moves” page then shows every move with its progress, Stop and Continue, and remembers them in that browser.

Only a browser, no POST?

Never put passwords into a URL: they end up in logs, caches and histories. Instead, give the user a link with both addresses filled in, and they enter the passwords themselves: https://mail2mail.link/start?from=anna@gmx.de&to=anna@example.com.

Search this site

GET https://mail2mail.link/.well-known/search?q=… returns the sections of this site that best answer a question, in Markdown, with links. Keywords and whole questions both work, in all six languages. The HTTP QUERY method with the question as the body works too; add Accept: application/json for JSON.

Rules

Was this page helpful?

Back to top