Connect an email mailbox (IMAP/SMTP)
This guide connects an existing email mailbox (e.g. support@yourcompany.com) to The-Y CRM. Afterwards, incoming mail lands automatically as tickets in the inbox, and your replies go back out from the same address.

Before you start — what you need
- The email address and password of the mailbox you want to connect.
- Your provider's server details: IMAP server (incoming) + SMTP server (outgoing), each with host, port and encryption. The most common ones are in the provider table below.
- For Gmail/Google: an app password (see Gmail with an app password); your normal login password will not work there. Microsoft 365 and Outlook.com are connected without a password (see Microsoft 365 or Outlook.com).
Step by step
- Open channel settings. In the app, click Settings → Channels on the left. If you have multiple brands (workspaces), first pick the brand this mailbox belongs to at the top.
- Add a mailbox. Under "Mailboxes & numbers" click "+ Add" and choose the type Email. The "Set up" panel opens automatically.
- Enter the sender address. Enter the email address you want to send/receive from (e.g.
support@yourcompany.com) and optionally a display name. -
Enter IMAP (incoming). This is the server The-Y fetches new mail from.
- Server/Host (e.g.
imap.yourcompany.com) - Port — usually
993(SSL/TLS) - Username (often the full email address) and password — stored encrypted (AES-256).
- Server/Host (e.g.
-
Enter SMTP (outgoing). The server The-Y sends your replies through.
- Server/Host (e.g.
smtp.yourcompany.com) - Port —
587(STARTTLS) or465(SSL). The-Y picks the encryption automatically from the port. - Username/password as for IMAP (identical with most providers).
- Server/Host (e.g.
- Test the connection. Click "Test connection". The-Y saves the entries and immediately opens a real test connection. Green "Connection OK" = all good. An error message (e.g.
535 Authentication failed) comes straight from the server — see Troubleshooting. -
Choose the import mode. Decide what happens on the first fetch:
- New mail only (recommended): only mail arriving from now on becomes tickets.
- Full history: the existing mailbox is imported gradually (in batches, de-duplicated).
- Add a signature (optional). Enter an HTML signature for this mailbox. Placeholders such as
{{user.firstname}}are filled per sending agent automatically; a live preview shows the result. - Save & activate. Save the mailbox. It is now active — incoming mail appears in the Inbox, replies go out from this address (with a quote + correct threading headers).
support@ and info@). Which mailbox sends system mail (password reset, invitations) is set under Settings → Email sender.Connect Microsoft 365 or Outlook.com
Microsoft no longer allows password sign-in for business mailboxes (Microsoft 365) or Outlook.com/Hotmail. Since version 1.1.50 you therefore connect these mailboxes directly with your Microsoft account. Your password stays with Microsoft; The-Y only gets permission to fetch and send email.
- Add the mailbox. Settings → Channels → Email: enter the address and click Add (or Configure on an existing mailbox).
- Choose the provider. Under Provider, choose “Microsoft 365 / Outlook.com”.
- Click “Connect with Microsoft”. You are briefly redirected to Microsoft (an ongoing call in this window will end).
- Sign in with exactly this address and confirm the access.
- Done. You come back automatically: “Connected!”. New emails appear in the inbox within a minute.
The-Y sets the servers itself (fetching outlook.office365.com, sending smtp.office365.com, or smtp-mail.outlook.com for Outlook.com).
“Your organisation only allows new apps with the approval of an admin”
Many organisations require admin consent once before a new app can be used. The-Y then shows an approval link:
- Copy the link and send it to your admin.
- The admin opens it (role Global Administrator, Cloud Application Administrator or Application Administrator), reviews the permissions (read email via IMAP, send via SMTP, stay signed in, profile) and clicks “Accept”. Alternatively: Microsoft Entra admin center → Enterprise apps → “The-Y CRM” → Permissions → “Grant admin consent”.
- Then click “Connect with Microsoft” again.
Common messages with Microsoft
- “Connected – but sending is blocked for this mailbox (Authenticated SMTP is off)”: Admin: Microsoft 365 admin center → Users → Active users → mailbox → Mail → Manage email apps → turn on “Authenticated SMTP”. Note: Microsoft “security defaults” turn it off.
- “Connected – but Microsoft refused fetching (IMAP)”: allow IMAP for the mailbox (same place, “IMAP”). Outlook.com: Settings → Mail → Forwarding and IMAP.
- “You signed in with a different Microsoft account …”: connect again and choose “Use another account”. Shared mailboxes work if your account has full access.
- “Reconnect needed”: the sign-in expired or was revoked (e.g. admin removed the consent, admin reset the password, unused for 90 days). Click “Reconnect”; conversations are kept.
- “Microsoft blocked the sign-in because of a rule in your organisation”: conditional access or app assignment: please contact your admin.
- “The sign-in took too long …”: finish within 10 minutes and connect again.
Disconnect: “Disconnect” removes the Microsoft sign-in from The-Y. Conversations and messages are kept. You can also remove the app at myapps.microsoft.com (work) or account.live.com/consent/Manage (personal).
Gmail with an app password
Google does not allow your normal password for Gmail in other programs. You need an app password (16 characters):
- Turn on 2-Step Verification in your Google account (Security → 2-Step Verification).
- Open myaccount.google.com/apppasswords, enter a name (e.g. “The-Y CRM”), click Create.
- In The-Y, choose provider “Gmail / Google Workspace” → “Fill in Gmail values” → paste the 16-character password (without spaces) into both password fields → Test connection.
Servers: fetching imap.gmail.com, port 993 (SSL) · sending smtp.gmail.com, port 465 (SSL) or 587 (STARTTLS) · user: full Gmail address. Google Workspace: if the “App passwords” page is missing, your admin has blocked it (or IMAP). Changing the Google password deletes all app passwords; then enter a new one.
MS_OAUTH_CLIENT_ID, MS_OAUTH_CLIENT_SECRET, redirect URI https://<your-domain>/api/channels/email/oauth/microsoft/callback), step by step in SELF-HOSTING.md (German). Without it the button is hidden; Gmail and all other providers keep working with server and password.Server details for common providers
If you don't know your server details, you'll usually find them in your provider's help under "set up IMAP/SMTP". The most common:
| Provider | IMAP (incoming) | SMTP (outgoing) | Login / note |
|---|---|---|---|
| Gmail / Google Workspace | imap.gmail.com : 993 (SSL) | smtp.gmail.com : 465 (SSL) or 587 (STARTTLS) | App password required (guide); enable IMAP in the Gmail account |
| Microsoft 365 / Outlook.com | outlook.office365.com : 993 | smtp.office365.com : 587 (Outlook.com: smtp-mail.outlook.com) | With one click via “Connect with Microsoft” (guide); The-Y fills in the servers itself |
| GMX | imap.gmx.net : 993 | mail.gmx.net : 587 | Enable "POP3/IMAP access" in the GMX account |
| web.de | imap.web.de : 993 | smtp.web.de : 587 | Enable IMAP in the account |
| Own server / host | imap.yourdomain.com : 993 | smtp.yourdomain.com : 587 | Details from your host (Virtualmin/Plesk/cPanel "Email accounts") |
Check that it works
- Incoming: Send a test mail from another account to the connected address. Within ~1 minute it appears as a new ticket in the Inbox.
- Outgoing: Open the ticket, write a reply, "Send". Check in the other account that the reply arrives (including your signature).
Troubleshooting
535 Authentication failed / "username or password wrong"
The server rejects the credentials. Most common causes: (1) With Gmail you need an app password instead of the normal password (guide). Microsoft 365 and Outlook.com are connected via “Connect with Microsoft” instead of a password (guide). (2) The username is not the full email address (some hosts want e.g. u12345). (3) IMAP/SMTP is not enabled on the mailbox.
wrong version number / SSL error when connecting
Port and encryption don't match. Use 993 for IMAP (SSL) and 587 (STARTTLS) or 465 (SSL) for SMTP. The-Y derives the encryption from the port — if you enter e.g. port 587 with forced SSL, this error appears.
Certificate/hostname error (own mail server)
If your server's TLS certificate is issued for a different hostname, The-Y retries the SMTP send once with relaxed certificate checking — so sending usually still works. Cleaner is a certificate that matches your mail hostname exactly.
The first fetch imported my whole history
That happens when "Full history" was selected on setup. For a clean start choose "New mail only". You can close already-imported old mail in the inbox.
Nothing arrives
Check: is the mailbox active (toggle in the channels table)? Is the IMAP host/port correct? The fetch runs in the background about once a minute — wait briefly. If "Test connection" is green but still nothing arrives, check the IMAP status in the email panel.
