Back to Login
繁體中文(香港)English日本語한국어ไทยTiếng ViệtFilipinoDeutschFrançaisРусский

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

ServicePortBackup portAuthNotes
SMTP inbound258025No authExternal mail servers deliver mail to your E-TOM Mail address (MX server role)
SMTP outbound5878587AUTH requiredThe client "outgoing server". Log in to send: local addresses are delivered directly, external addresses go through the relay. STARTTLS supported
IMAP1431143Login passwordIMAP4rev1: four-folder sync, APPEND upload, SEARCH, IDLE live push. STARTTLS supported
POP31101110Login passwordDownload INBOX mail (UIDL / RETR / TOP / DELE). STLS supported
HTTP / Web8000—Bearer TokenWeb 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.

ItemIncoming server (IMAP)Outgoing server (SMTP)
Server addressIP / domain of the deployed serverSame
Port143 (IMAP) or 110 (POP3)587
UsernameFull email address [email protected]Full email address [email protected]
PasswordWeb login password (IMAP/POP3/SMTP always use the login password — 2FA and API keys are not involved)
FoldersFour 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:

ClientEndpointUsage
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/mobileconfigOpen 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-configAll 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)

# 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

CategorySupportedNotes
SessionCAPABILITY / LOGIN / SELECT / EXAMINE / LIST / STATUS / NOOP / ID / LOGOUT / STARTTLSStandard IMAP4rev1 session flow
ReadingFETCH (FLAGS / UID / RFC822.SIZE / INTERNALDATE / BODY[] / BODY[HEADER] / RFC822)Sequence and UID modes; ranges like 1:* and 1,3,5:8
SearchSEARCH / 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 pushIDLEThe client waits; the server pushes "* n EXISTS" within 2 seconds of new mail. Thunderbird enables it automatically
FlagsSTORE +FLAGS/-FLAGS (\Seen, \Flagged)Syncs with read / starred in the web app
UploadAPPEND (incl. LITERAL+)Upload local mail (.eml) to any folder with optional (FLAGS) and date-time; over 10MB is rejected
POP3USER / PASS / STAT / LIST / UIDL / RETR / TOP / DELE / RSET / NOOP / CAPA / STLS / QUITDELE 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)

# 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.