---
title: "open connection · RUAL Documentation"
description: "Opens an IMAP connection to a mailbox server. Nothing is read until another imap block runs; with verify on, the block signs in once and reports the res…"
canonical: https://docs.rual.nl/block-types/imap/imapconnection_open
language: en
---

[Cluster](https://docs.rual.nl/cluster)

[Blocks](https://docs.rual.nl/block-types)

[Interfaces](https://docs.rual.nl/interfaces)

[Blueprints](https://docs.rual.nl/blueprints)

[Blueprint Language](https://docs.rual.nl/engine)

[Tutorials](https://docs.rual.nl/tutorials)

[Home automation](https://docs.rual.nl/home-automation)

[Examples](https://docs.rual.nl/examples)

[Reference](https://docs.rual.nl/reference)

[Architecture](https://docs.rual.nl/architecture)

[Troubleshooting](https://docs.rual.nl/troubleshooting)

Other

# open connection

This block is part of the [`imap`](https://docs.rual.nl/block-types/imap) group and was last modified in core [`v15.0.1`](https://docs.rual.nl/core-versions/150001).

Opens an IMAP connection to a mailbox server. Nothing is read until another `imap` block runs; with `verify` on, the block signs in once and reports the result on `success` so a flow can branch before it polls.

- flow `flow`

- host required `value` Hostname or IP of the IMAP server, e.g. `imap.example.com`.

- port `number` TCP port. 993 for implicit TLS, 143 for STARTTLS.

Default `993`

- username required `value` Sign-in name : usually the full address.

- password required `value` Password or app password. Stored on the connection and never logged.

- security `value` `tls` (default, port 993), `starttls` (port 143), or `none` for an unencrypted connection (loopback / private addresses only). • Suggestions: `tls` `starttls` `none`

Default `tls`

- timeout seconds `number` Dial and per-command timeout, in seconds.

Default `30`

- verify `condition` When on, sign in once and report the result on `success`. Off by default : opening a connection otherwise makes no network call.

Default `false`

- flow `flow`

- success `condition`

- error `value`

- connection `imapconnection`

Builds an IMAP connection object from host/port/credentials and outputs it on the connection pin; every other imapconnection_* block takes it and opens its own short session (dial, sign in, work, logout). security: 'tls' (default, implicit TLS on port 993), 'starttls' (plain port 143 upgraded with STARTTLS, and the upgrade is REQUIRED), or 'none' (unencrypted; a password is refused for any host that is not loopback or a private address). verify=false (the default) makes NO network call : it only assembles the object, so success is true whenever host is set. verify=true signs in and logs out once and reports reachability plus authentication on success/error. The connection carries the password and must never be logged or written to a document. In a simulation the verify probe is skipped and no packet leaves the node.

| `imap` |
| --- |
| `mailbox` |
| `inbox` |
| `mail server` |

A typical wiring for [open connection](https://docs.rual.nl/block-types/imap/imapconnection_open): a [function trigger](https://docs.rual.nl/block-types/globals/trigger_custom_function) starts the flow; [value](https://docs.rual.nl/block-types/value/value_default) feeds the `host` pin; [value](https://docs.rual.nl/block-types/value/value_default) feeds the `username` pin; [value](https://docs.rual.nl/block-types/value/value_default) feeds the `password` pin; the `flow` out pin feeds [debug](https://docs.rual.nl/block-types/state%2520ui/state_debug).

[![Studio canvas example for the open connection block: typical wiring for open connection.](https://docs.rual.nl/canvas-examples/imapconnection_open.png)](https://docs.rual.nl/canvas-examples/imapconnection_open.png?v=3)

## Version history

Introduced in [`v15.0.1`](https://docs.rual.nl/core-versions/150001).

- [Back to `imap`](https://docs.rual.nl/block-types/imap): Return to the main group to view all sub-groups

- [Back to `imap`](https://docs.rual.nl/block-types/imap?group=imap): Return to the group to view all blocks within this group

Was this page helpful? [Tell us what to improve](https://docs.rual.nl/support) · RUAL Docs is an integral component of the [RUAL ecosystem](https://rual.nl)
