# 🧨 IMAP Trigger fails with "Connection closed unexpectedly" on IONOS email – works in Outlook but not in n8n (cloud & VPS)

**URL:** <https://community.n8n.io/t/imap-trigger-fails-with-connection-closed-unexpectedly-on-ionos-email-works-in-outlook-but-not-in-n8n-cloud-vps/172990>\
**Category:** Questions\
**Created:** [August 21, 2025, 10:21am UTC](https://community.n8n.io/t/imap-trigger-fails-with-connection-closed-unexpectedly-on-ionos-email-works-in-outlook-but-not-in-n8n-cloud-vps/172990 "2025-08-21T10:21:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julio\_Valderrama](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/julio_valderrama/32/56020_2.png) [@Julio\_Valderrama](https://community.n8n.io/u/Julio_Valderrama)\
**Post date:** [August 21, 2025, 10:21am UTC](https://community.n8n.io/t/imap-trigger-fails-with-connection-closed-unexpectedly-on-ionos-email-works-in-outlook-but-not-in-n8n-cloud-vps/172990/1 "2025-08-21T10:21:43Z")

</div>

### 🧨 IMAP Trigger fails with “Connection closed unexpectedly” on IONOS email – works in Outlook but not in n8n (cloud & VPS)

## Hey everyone,

I’ve been banging my head against this for hours, and after multiple attempts, I’m turning to the community for help.

## 🔧 Setup

I’m trying to use the **IMAP Trigger node in n8n** to listen for new emails from an IONOS-hosted inbox. These are the connection details:

- **Email** : `infoalquileres@barcelonetapremium.com`
- **IMAP host** : `imap.ionos.es` _(also tried `imap.1und1.de`, which is what Outlook autodetects)_
- **Port** : `993`
- **SSL/TLS** : ✅ Enabled
- **Credentials** : correct (tested)  
n8n runs in two environments:
- 🌩 **n8n cloud** (official)
- 💻 **Self-hosted VPS via Docker Compose**

* * *

## ✅ What I’ve confirmed

- Works perfectly in **Outlook (IMAP)** using these same credentials, port, and host.
- Ports are **not blocked** on the VPS or by my ISP.
- I even tested from **Windows PowerShell using `openssl s_client`** and can establish the connection manually:

```powershell
openssl s_client -connect imap.ionos.es:993

```

## So the connection is **definitely possible from outside**.

## ❌ Problem in n8n

When I try to activate the IMAP Trigger node, I consistently get:

> “Connection closed unexpectedly”  
> _(in the UI and logs)_  
> This happens in **both** environments (cloud and VPS). I’ve tried:

- Recreating the IMAP node from scratch
- Switching between `imap.ionos.es` and `imap.1und1.de`
- Removing and re-adding credentials
- Restarting containers, clearing volumes, forcing reconnect
- Using alternative ports (587, 143 just to test) → rejected by server  
Still always the same result.

* * *

## 🧪 Additional clues

- Outlook says the IMAP connection is **SSL/TLS (recommended)** over `imap.1und1.de:993` — which works.
- However, n8n can’t maintain or even establish the connection.
- The same config works on Thunderbird as well. So it’s NOT 2FA, not wrong credentials, not IP block, and not port filtering.

* * *

## 🧵 Related posts checked

I’ve already read through:

- [n8n forum post 1](http://community.n8n.io/t/n8n-bug-report-imap-trigger-not-working-after-a-period-of-time/47796)
- [IMAP broken after period](http://community.n8n.io/t/error-imap-trigger/32544)
- [IMAP Zoho bug](http://community.n8n.io/t/trying-to-connect-to-zoho-mail-through-imap/110036)
- GitHub issues on reconnect bugs

* * *

## 🧠 Hypotheses

1. **n8n’s IMAP client library is unable to complete SSL handshake** with this specific provider.
2. The IMAP node internally crashes or mismanages reconnect events and dies silently.
3. IONOS enforces a specific TLS version that n8n’s library isn’t defaulting to.
4. There’s a quirk in how n8n handles certificate validation for IONOS — or something incompatible with their STARTTLS/SSL implementation.

* * *

## ❓What I need help with

- Is this a known issue with `imap.ionos.es` or 1&1 IMAP in general?
- Can I force n8n to log the full raw error? Or debug the SSL negotiation?
- Would it make sense to try setting up a proxy IMAP forwarder to test in-between?  
I’d love any ideas — or if someone has IMAP working with an IONOS email, please share your exact config.  
Thanks in advance 🙏  
Julio

## Describe the problem/error/question

## What is the error message (if any)?

## Please share your workflow

```auto
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

```

## Share the output returned by the last node

## Information on your n8n setup

- **n8n version:** n8n@1.107.4
- **Database (default: SQLite): Cloud and Sqlite for self hosted**
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app):**
- **Operating system:**

---

<div class="post-metadata">

**Author:** ![hubschrauber](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/hubschrauber/32/46788_2.png) [@hubschrauber](https://community.n8n.io/u/hubschrauber)\
**Post date:** [August 21, 2025, 10:41pm UTC](https://community.n8n.io/t/imap-trigger-fails-with-connection-closed-unexpectedly-on-ionos-email-works-in-outlook-but-not-in-n8n-cloud-vps/172990/2 "2025-08-21T22:41:36Z")

</div>

Even if this doesn’t help you resolve your issues, maybe it will be context to help narrow it. I just tried the IMAP Trigger from n8n cloud to [imap.ionos.com](http://imap.ionos.com) (per [docs](https://www.ionos.com/help/email/general-topics/settings-for-your-email-programs-imap-pop3/)). It worked (authenticated and fetched a test message) using the account/mailbox id (like m111222333-3), **and** using the associated default email address as a user name.

The issue you have **might** be limited to accessing the `imap.ionos.es` domain/servers.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [November 19, 2025, 10:41pm UTC](https://community.n8n.io/t/imap-trigger-fails-with-connection-closed-unexpectedly-on-ionos-email-works-in-outlook-but-not-in-n8n-cloud-vps/172990/3 "2025-11-19T22:41:59Z")

</div>

Closed on November 19, 2025, 10:41pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
