IMAP / SMTP server setup (administrator)
This page explains how to set up the incoming (IMAP) and outgoing (SMTP) mail servers that a MailDesk mailbox account points to, using a username and password. It is the right path for any mailserver that speaks standard IMAP and SMTP — your own mailserver, Mailcow, FastMail, ProtonMail Bridge, and similar — and for Gmail or Outlook when you cannot use OAuth and connect with an app password instead.
This page explains how to set up the incoming (IMAP) and outgoing (SMTP) mail servers that a MailDesk mailbox account points to, using a username and password. It is the right path for any mailserver that speaks standard IMAP and SMTP — your own mailserver, Mailcow, FastMail, ProtonMail Bridge, and similar — and for Gmail or Outlook when you cannot use OAuth and connect with an app password instead.
Available in: Basic. The incoming and outgoing servers are standard Odoo mail server records that the MailDesk engine drives, so this works the same with or without Pro.
Prefer OAuth for Gmail and Outlook
For Gmail/Google Workspace and Outlook/Microsoft 365, the sign-in (OAuth) path is faster, stores no password, and can be revoked at any time. Use IMAP/SMTP for those providers only when OAuth is not possible — see Gmail OAuth setup. The IMAP path for Gmail requires an App Password (covered below).
How the pieces fit together
A working mailbox needs three records, and MailDesk links them:
flowchart LR
A[Mailbox Account] -->|Incoming Mail Server| B[Incoming server<br/>IMAP — fetchmail.server]
A -->|Outgoing SMTP Server| C[Outgoing server<br/>SMTP — ir.mail_server]
- The incoming server holds the IMAP host, port, encryption, username and password, and its Server Type decides how MailDesk authenticates (IMAP password, Gmail OAuth, or Outlook OAuth).
- The outgoing server holds the SMTP host, port, encryption, username and password.
- The mailbox account points to both. See Mailbox account setup for that record.
Requirements
- MailDesk Basic installed; works on Odoo 17, 18, or 19 — the steps below are the same on each.
- IMAP access enabled on the mailbox at your provider.
- The incoming (IMAP) host and port, and the outgoing (SMTP) host and port.
- The mailbox login and password — or an app password if the provider requires one.
- Your Odoo server allowed to make outbound connections to those hosts and ports.
Permissions required
- Configuring mail servers and mailbox accounts is a MailDesk Mailbox Admin task.
- The server menus live under MailDesk → Configuration → Mailboxes and are visible to administrators only.
Common provider settings
Use these as a starting point; always confirm against your provider's own documentation.
| Provider | Incoming (IMAP) | Outgoing (SMTP) | Notes |
|---|---|---|---|
| Your own / Mailcow / generic | host from provider, port 993 (SSL/TLS) or 143 (STARTTLS) | host from provider, port 465 (SSL/TLS) or 587 (STARTTLS) | Check your mailserver's documentation |
| Gmail (app password) | imap.gmail.com, port 993 |
smtp.gmail.com, port 465 or 587 |
Needs 2-Step Verification + an App Password; OAuth is recommended instead |
| Outlook / Microsoft 365 (app password) | outlook.office365.com, port 993 |
smtp.office365.com, port 587 |
OAuth is strongly recommended instead |
| FastMail | imap.fastmail.com, port 993 |
smtp.fastmail.com, port 465 |
— |
| ProtonMail Bridge | 127.0.0.1, port 1143 |
127.0.0.1, port 1025 |
Requires the ProtonMail Bridge app running locally |
Default ports follow your encryption choice
When you set the Server Type to IMAP on the incoming server, Odoo fills the port for you based on the SSL/TLS setting: 993 with SSL/TLS on, 143 with it off. You can override the port if your provider differs.
Step 1 — Create the incoming (IMAP) server
- Open the MailDesk app.
-
Go to Configuration → Mailboxes → Incoming Mail Servers and click New.
-
Fill in the form (titled Incoming Mail Server): - Name — a label for this server (for example Support IMAP). - Server Type — choose IMAP Server for a standard mailbox. (The list also offers Gmail OAuth Authentication and Outlook OAuth Authentication for the sign-in path.) - Under Server Information: Server Name (the IMAP host, for example
imap.example.com), Port, and SSL/TLS (turn on for an encrypted connection). - Under Login Information: Username (usually the full email address) and Password (the mailbox password or an app password). -
Click Test & Confirm to verify the connection and credentials.
Expected result: the server status changes from Not Confirmed to Confirmed, meaning the IMAP login succeeded.

Step 2 — Create the outgoing (SMTP) server
-
In the MailDesk app, go to Configuration → Mailboxes → Outgoing Mail Servers and click New.
-
Fill in the form (titled Outgoing Mail Servers): - Name — a label for this server. - Connection Encryption — choose SSL/TLS or TLS (STARTTLS) to match your provider. - SMTP Server — the SMTP host (for example
smtp.example.com). - SMTP Port — for example 465 (SSL/TLS) or 587 (STARTTLS). - Username and Password — the SMTP login (often the same as the IMAP credentials). -
Click Test Connection to verify the server accepts the connection.
Expected result: a success notification confirms the SMTP server is reachable and the credentials work.

Step 3 — Attach the servers to a mailbox account
- Open or create the mailbox account (see Mailbox account setup).
- Set Incoming Mail Server to the IMAP server from Step 1 and Outgoing SMTP Server to the SMTP server from Step 2.
- Save, then use Test Incoming Server and Test Outgoing Server in the form header, and finally Fetch folders.
Expected result: both tests show Connection Test Successful!, the folders appear on the Folders tab, and MailDesk begins filling the mailbox.
One server, one mailbox
Each incoming server and each outgoing server can be linked to only one mailbox account. Create separate server records if you need several mailboxes.
Gmail over IMAP (App Password)
Use this only when you cannot use the Gmail OAuth sign-in path.
- In your Google Account, turn on 2-Step Verification.
- Create a Google App Password for Mail and copy the 16-character code.
- Create the incoming server with Server Name
imap.gmail.com, Port993, SSL/TLS on, Username = your full Gmail address, Password = the app password. - Create the outgoing server with SMTP Server
smtp.gmail.com, SMTP Port465or587, the matching encryption, and the same username and app password.
Some Google Workspace accounts block app passwords
A Workspace administrator may disable app passwords or restrict which clients can connect by IMAP. If app passwords are unavailable, use Gmail OAuth setup instead.
How the mailbox stays in sync
Once a server is attached and confirmed, MailDesk fetches mail with automatic background jobs — there is nothing to schedule by hand. New mail surfaces within the relevant polling interval, and the open MailDesk view refreshes itself as messages arrive. For the full picture (including the near-realtime push options), see Realtime & synchronization architecture.
Sent mail with IMAP
By default MailDesk copies each sent message into the server's Sent folder (the Append Sent to IMAP option on the mailbox account). If your mailserver already stores sent mail itself, turn that option off to avoid duplicates.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Cannot connect to the incoming server | Wrong host or port, encryption mismatch, or firewall | Re-check Server Name, Port, and SSL/TLS; confirm the Odoo server can reach the host |
| Login fails on Test & Confirm | Wrong username/password, or the provider needs an app password | Verify the credentials in webmail; create an app password if 2-step verification is on |
| Test Connection fails on the outgoing server | Wrong SMTP host/port or encryption | Match SMTP Server, SMTP Port, and Connection Encryption to the provider; try 465 (SSL/TLS) or 587 (STARTTLS) |
| Sent mail does not appear in Sent | Sent folder not synced, or non-standard folder name | Click Fetch folders and make sure the Sent folder is selected; its name varies (Sent, Sent Items, Sent Messages) |
| The same email appears more than once | The message exists in several server folders | This is normal IMAP behaviour — one entry per folder |
| Initial sync seems slow | Large mailbox | The newest messages load first; older mail fills in afterwards in the background |
Related
- Mailbox account setup — the account that points to these servers, plus shared mailboxes and access control.
- Gmail OAuth setup — connect Gmail/Google Workspace by sign-in instead of a password.
- Realtime & synchronization architecture — how new mail is fetched and the view kept fresh.