Client Setup Guide
E-TOM Mail fully supports standard email protocols — mail clients on any device, built-in phone apps, and any programming language can send and receive mail directly.
1Service Ports Overview
| Service | Port | Backup port | Auth | Notes |
|---|---|---|---|---|
| SMTP inbound | 25 | 8025 | No auth | External mail servers deliver mail to your E-TOM Mail address (MX server role) |
| SMTP outbound | 587 | 8587 | AUTH required | The client "outgoing server". Log in to send: local addresses are delivered directly, external addresses go through the relay. STARTTLS supported |
| IMAP | 143 | 1143 | Login password | IMAP4rev1: four-folder sync, APPEND upload, SEARCH, IDLE live push. STARTTLS supported |
| POP3 | 110 | 1110 | Login password | Download INBOX mail (UIDL / RETR / TOP / DELE). STLS supported |
| HTTP / Web | 8000 | — | Bearer Token | Web app + REST API (API keys, rate limit 60 req/min) |
💡 On port conflicts the service automatically falls back to the backup port; actual ports are printed in the startup log. Always log in with the full email address (e.g. [email protected]) and your web login password.
2Common Mail Client Setup
All clients work the same way: pick IMAP (recommended) or POP3 for the incoming server, and set the outgoing server to SMTP port 587 with "My server requires authentication" enabled.
🦊 Thunderbird
Account Settings → Account Actions → Add Mail Account. Manual config: incoming IMAP, host server IP, port 143, authentication "Normal password"; outgoing SMTP port 587 with authentication.
🪟 Outlook
File → Add Account → Advanced "Let me set up my account manually" → POP/IMAP. IMAP port 143 (no encryption), SMTP port 587; both use username + password.
📧 Foxmail
New Account → Manual settings. Incoming IMAP port 143, outgoing SMTP port 587; account = full email address, password = login password.
🍎 macOS Mail / iPhone / iPad
Settings → Mail → Accounts → Add Other Mail Account. Incoming port 143, outgoing port 587. If the app forces SSL, temporarily disable the SSL option while adding.
🤖 Android (Gmail / built-in Mail)
Add account → Other → Manual setup → IMAP. Incoming port 143, outgoing SMTP 587, both set to "require sign-in".
💻 CLI (mutt / neomutt)
mutt -f imap://[email protected]@SERVER/INBOX opens the IMAP inbox directly; for sending configure set smtp_url="smtp://[email protected]@SERVER:587/" in .muttrc.
| Item | Incoming server (IMAP) | Outgoing server (SMTP) |
|---|---|---|
| Server address | IP / domain of the deployed server | Same |
| Port | 143 (IMAP) or 110 (POP3) | 587 |
| Username | Full email address [email protected] | Full email address [email protected] |
| Password | Web login password (IMAP/POP3/SMTP always use the login password — 2FA and API keys are not involved) | |
| Folders | Four folders visible via IMAP: INBOX / Sent / Drafts / Trash | |
3Client Auto-Discovery (zero manual setup)
Standard auto-discovery endpoints let clients fetch the full 143/110/587 configuration from just the email address and password:
| Client | Endpoint | Usage |
|---|---|---|
| Thunderbird / Evolution | /.well-known/autoconfig/mail/[email protected] | Requested automatically by Thunderbird when adding an account; you can also verify it in the "Manual config" screen. |
| Apple macOS / iOS / iPadOS | /mail/mobileconfig | Open this URL in Safari to download the .mobileconfig profile and install it as prompted (unsigned profiles must be trusted under "Settings → General → VPN & Device Management"). |
| Web apps / integration | /api/mail-config | All ports and encryption settings as JSON, ready for programmatic use. |
🌐 DNS SRV records (RFC 6186, for your own domain zone):
_imap._tcp.e-tom.cloud IN SRV 0 1 143 mail.e-tom.cloud.
_pop3._tcp.e-tom.cloud IN SRV 0 1 110 mail.e-tom.cloud.
_submission._tcp.e-tom.cloud IN SRV 0 1 587 mail.e-tom.cloud.
Admins can set the environment variable MAIL_PUBLIC_HOST to control the server domain returned by auto-discovery (defaults to the request Host).
4Encrypted Connections (STARTTLS)
- If no certificate exists at startup, a self-signed certificate is auto-generated at
backend/certs/server.pem(set the CN viaTLS_CERT_CN; replace with a CA certificate in production). - IMAP: connect to port 143 and send the STARTTLS command; after the handshake all traffic (LOGIN/APPEND/FETCH...) is encrypted.
- POP3: connect to port 110 and send the STLS command to upgrade.
- SMTP 587: the EHLO response contains 250-STARTTLS; the client sends STARTTLS before AUTH.
- Clients should choose STARTTLS as the encryption method (not implicit SSL/TLS — different ports).
# Log in over STARTTLS encryption with Python imaplib
import imaplib, ssl
ctx = ssl.create_default_context()
ctx.check_hostname = False # disable verification for the self-signed cert; keep it on for real certs
ctx.verify_mode = ssl.CERT_NONE
imap = imaplib.IMAP4("SERVER_IP", 143)
imap.starttls(ssl_context=ctx)
imap.login("[email protected]", "PASSWORD")
5Supported IMAP / POP3 Commands
| Category | Supported | Notes |
|---|---|---|
| Session | CAPABILITY / LOGIN / SELECT / EXAMINE / LIST / STATUS / NOOP / ID / LOGOUT / STARTTLS | Standard IMAP4rev1 session flow |
| Reading | FETCH (FLAGS / UID / RFC822.SIZE / INTERNALDATE / BODY[] / BODY[HEADER] / RFC822) | Sequence and UID modes; ranges like 1:* and 1,3,5:8 |
| Search | SEARCH / UID SEARCH (ALL, UNSEEN, SEEN, FLAGGED, FROM, TO, SUBJECT, BODY, TEXT, HEADER, SINCE/BEFORE/ON, LARGER/SMALLER, NOT, OR, grouped parentheses) | Works with the built-in client search, e.g. the Thunderbird search bar |
| Live push | IDLE | The client waits; the server pushes "* n EXISTS" within 2 seconds of new mail. Thunderbird enables it automatically |
| Flags | STORE +FLAGS/-FLAGS (\Seen, \Flagged) | Syncs with read / starred in the web app |
| Upload | APPEND (incl. LITERAL+) | Upload local mail (.eml) to any folder with optional (FLAGS) and date-time; over 10MB is rejected |
| POP3 | USER / PASS / STAT / LIST / UIDL / RETR / TOP / DELE / RSET / NOOP / CAPA / STLS / QUIT | DELE moves mail to the web Trash on QUIT |
📌 Typical APPEND uses: migrating history from another provider, client backups/restores, importing .eml archives to the cloud. Messages appended to Drafts appear in the web Drafts; INBOX goes to the inbox.
# Upload a message to the Sent folder via IMAP APPEND (Python imaplib)
from email.message import EmailMessage
import imaplib
msg = EmailMessage()
msg["From"] = "[email protected]"
msg["To"] = "[email protected]"
msg["Subject"] = "Migrated historical mail"
msg.set_content("Uploaded via IMAP APPEND.")
imap = imaplib.IMAP4("SERVER_IP", 143)
imap.login("[email protected]", "Passw0rd123")
imap.append("Sent", r"(\Seen)", None, msg.as_bytes()) # (folder, flags, date, message)
imap.logout()
6SMTP Outgoing Port (587)
- Authentication: AUTH PLAIN or AUTH LOGIN with the full email address and login password. Unauthenticated sends are rejected (530 Authentication required).
- Local delivery: recipients on hosted domains (@e-tom.cloud) are delivered straight to their inbox (spam rules apply) and archived in your Sent folder.
- External delivery: external recipients (QQ, 163, Gmail...) go through the SMTP relay. Configure SMTP_HOST / SMTP_PORT / SMTP_USER / SMTP_PASS on the server (plus DKIM for deliverability); without a relay the mail is recorded as failed, nothing is lost.
- Attachments: standard MIME attachments are delivered and archived just like the web app.
# Send mail through the 587 submission port with Python smtplib
import smtplib
from email.message import EmailMessage
msg = EmailMessage()
msg["From"] = "[email protected]"
msg["To"] = "[email protected]"
msg["Subject"] = "Mail from Outlook/scripts"
msg.set_content("Body text...")
with smtplib.SMTP("SERVER_IP", 587) as s:
s.login("[email protected]", "Passw0rd123") # AUTH LOGIN
s.send_message(msg)
# Quick command-line check (swaks, optional)
swaks --to [email protected] --from [email protected] \
--server SERVER_IP:587 --auth LOGIN --auth-user [email protected] --auth-password PASSWORD
7HTTP API Quick Start
Everything in the web app is available through the REST API — ideal for automation, bots and third-party integration. Interactive docs at http://SERVER_IP:8000/docs.
# 1) Log in to get a token (or use X-API-Key from the open platform)
curl -s -X POST http://SERVER_IP:8000/api/login \
-H "Content-Type: application/json" \
-d '{"account":"[email protected]","password":"Passw0rd123"}'
# 2) Read inbox / search mail
curl -s "http://SERVER_IP:8000/api/mails?box=in&q=order" -H "Authorization: Bearer <token>"
# 3) Send mail (base64 attachment array supported)
curl -s -X POST http://SERVER_IP:8000/api/send \
-H "Authorization: Bearer <token>" -H "Content-Type: application/json" \
-d '{"to":"[email protected]","subject":"Hello","body":"Body"}'
# 4) Open API (server-side integration): create a key under "Settings - API keys" in the web app
curl -s "http://SERVER_IP:8000/open/mails?box=in" -H "X-API-Key: tom_xxxxxxxx"
8FAQ
- Q: Login says authentication failed?
- Use the full email address (including the @domain) as the username and the web login password as the password. API keys apply only to the HTTP API; IMAP/POP3/SMTP always use the login password.
- Q: The client receives nothing, but the web app shows mail?
- Check the folder (POP3 clients only see INBOX) and the ports: 143 for IMAP / 110 for POP3, not the encrypted ports.
- Q: Sending says relay failed / status failed?
- External delivery requires the server-side relay (SMTP_HOST etc.). Admins should check the environment variables; mail between local accounts is unaffected.
- Q: Do APPENDed messages keep attachments?
- Yes — build a standard MIME (multipart) message and attachments are stored and downloadable in the web app.
- Q: Does 2FA affect client login?
- No. The one-time code is only for web login; IMAP/POP3/SMTP use the login password.
- Q: Forgot the password?
- Click "Forgot password" on the login page and reset via the SMS code; admins can also reset it in the admin console.
- Q: The client warns "certificate not trusted"?
- The server auto-generates a self-signed certificate; accept the prompt to continue. In production replace backend/certs/server.pem with a CA certificate and restart.
- Q: SSL/TLS or STARTTLS?
- Choose STARTTLS (ports 143/110/587). Implicit SSL/TLS uses 993/995/465, which this server does not open yet.
- Q: Can Thunderbird auto-discover the config?
- Yes, via the standard autoconfig endpoint. If your domain cannot resolve to it, fill in the manual settings from section 2.