Site Logotype
Post

Mail Server Configuration Checklist: TLS, Access, Sessions

Most “connection refused” tickets in email automation trace back to something duller than a firewall: a TLS mode pointed at the wrong port, an app password that was never generated, or a fifth parallel session hitting a server that allows four. The IMAP vs POP3 decision gets all the attention, yet the protocol choice is only the first of four checks that decide whether a mailbox connection survives past the first poll.

That is the short version of this checklist. IMAP keeps mail on the server and syncs folders and read states across devices, POP3 downloads mail to a single client, and SMTP handles sending mail on a separate connection entirely. Each of those paths has its own port, its own encryption handshake, and its own session budget. Get one wrong and the tool usually fails quietly or retries until the provider throttles the account.

The items below run in order: protocol fit, TLS mode against port, account access and concurrency, then the whole stack applied to a high-volume workflow. No single step is hard. Skipping any one of them is what turns a working setup into a support thread.

IMAP vs POP3: Which Email Protocol to Use for Automation Tools

Picking a protocol is the first decision that shapes everything downstream: how often the tool polls, what it sees in the mailbox, and whether a second process can read the same inbox without stepping on the first. The IMAP vs POP3 differences matter here more than they do for a human reading mail in a desktop client.

IMAP keeps mail on the server. The client fetches headers and bodies on demand, and the server holds the read/unread state, folder structure, and flags. IMAP synchronizes folders and read states across devices, which is why a message marked read in one client shows as read in another. IMAP4rev2 is defined by RFC 9051 and adds IDLE, so the server pushes new-mail notifications instead of forcing the client to poll on a timer. That cuts latency and connection churn on busy inboxes.

POP3 downloads mail to a single client. Post Office Protocol version 3, RFC 1939, is a simple retrieval protocol with no folder model: POP3 supports inbox only. The client issues UIDL to list message IDs, RETR to pull a message, and DELE to remove it. Whether the message survives on the server depends on the “leave messages on server” setting, and most clients that leave messages behind end up re-reading the same mail on every session unless the tool tracks UIDLs itself. A second client on the same POP3 account sees a different, often incomplete picture.

Both protocols sit behind SMTP, which handles sending mail on the outgoing mail server. Neither IMAP nor POP3 sends anything, so a tool that replies or forwards needs SMTP configured separately, usually on port 587 with STARTTLS.

Criteria for choosing:

  • Polling needs. If the tool needs near-real-time pickup, IMAP with IDLE beats a POP3 poll loop. If a 1 to 5 minute interval is fine, POP3 is cheaper per connection.
  • Mailbox sharing. Two or more processes reading the same inbox means IMAP, full stop. POP3 with deletion enabled will hand the message to whichever client connects first.
  • Message retention. Need a server-side archive or a folders-based workflow for sorting verification mail, invoices, and alerts? IMAP. A flat fetch-and-delete pipeline fits POP3.
  • Server-side state. Tools that rely on read flags or folder moves need IMAP. POP3 tools have to maintain that state in their own database.

One practical wrinkle: many SEO automation tools default to POP3 because the retrieval model is trivial to implement and the mailbox is a throwaway catch-all. AllMail, for example, provides catch-all domains for projects, and a POP3 fetch-and-purge loop over one of those inboxes is a clean, low-overhead pattern. If the workflow needs folder routing or shared access, switch to IMAP before scaling, not after.

TLS Mode and Port Matching: Implicit TLS vs STARTTLS Verification

Most connection failures in automation setups are not credential problems. They are port and TLS mode mismatches, and they often surface as timeouts or generic “connection refused” errors that send you hunting in the wrong place. Work through this pairing check before you touch anything else.

Match the TLS mode to the port, every time. The rules are short and have not changed in years:

  • IMAP port 993: implicit TLS. The client connects over TLS from the first byte. No negotiation, no upgrade step.
  • POP3 port 995: implicit TLS, same model.
  • IMAP port 143 / POP3 port 110: plaintext start, then STARTTLS upgrade. Plain 143 and 110 without STARTTLS should never be used for automation.
  • SMTP port 587: STARTTLS submission. SMTP port 465: implicit TLS. The outgoing mail server is a separate setting, so check it separately from the incoming mail server.

How mismatches fail. If your tool is set to STARTTLS but pointed at 993, the client sends a plaintext greeting to a port that expects a TLS handshake. The server drops the connection or returns garbage, and the tool reports a timeout. Reverse it, implicit TLS against port 143, and the handshake stalls because the server is waiting for a plaintext command. Neither case returns “wrong TLS mode.” You get a silent failure and a log line that blames the network.

Verify the pairing during setup, not after. A four-step check catches nearly all of it:

  1. Write down the port numbers for the incoming and outgoing servers, then write the TLS mode next to each. If you cannot state the pair in one line, stop and fix it.
  2. Run a raw connection test from the automation host, not your laptop. On Linux, openssl s_client -connect mail.example.com:993 -servername mail.example.com should return a certificate chain immediately. If it hangs, the port is not doing implicit TLS.
  3. For STARTTLS ports, confirm the tool actually issues the STARTTLS command and validates the certificate. Some lightweight libraries accept any certificate by default. Check for a verify setting and turn it on.
  4. Check the certificate hostname against the hostname in your config. A certificate for mail.example.com will fail validation if the tool connects to the bare IP or to a different subdomain.

Do not trust autodetect. Many tools guess the port from the protocol name and the TLS mode from a dropdown, and the two can disagree. If the tool offers a single “SSL/TLS” toggle alongside a port field, set both manually and confirm the saved config after the first successful poll. A connection that works once with a fallback downgrade is worse than one that fails loudly, because it will keep working until the day the server disables the weaker cipher.

Account Access and Concurrent Session Limits Checklist

Port and TLS pairing gets the transport right. It does not get you logged in. The next two checklist items are where most automation setups stall: the account itself may not be allowed to speak IMAP or POP3, and the server may refuse the number of connections your tool opens in parallel.

Start with protocol access. Many providers ship with IMAP and POP3 disabled by default, or restrict them to paid plans. Log into the webmail settings and confirm the IMAP toggle is on. If the automation only reads a single inbox, confirm the POP3 toggle too, since some hosts enable one and not the other. Then check the authentication method:

  • App passwords: if the account has two-factor authentication, the normal password will fail on IMAP port 993 and POP3 port 995. Generate a dedicated app password and store it in the tool’s credential field, not in a config file committed to a repo.
  • OAuth scopes: for Gmail and Microsoft 365, the token must include the right scope. Gmail needs https://mail.google.com/ for full IMAP access; narrower scopes such as gmail.readonly will not let the tool mark messages read or move them between folders.
  • Account-level locks: some hosts require you to allow “less secure apps” or explicitly authorize the connecting IP. Check the provider’s security log after the first connection attempt.

Session limits are the quieter failure. An automation tool rarely opens one connection; it typically opens a pool, one per worker thread, to parallelize fetching. Gmail caps IMAP at 15 simultaneous connections per account. Dovecot’s default is 10 per user unless the admin raised it. Exchange Online throttles aggressively and can return “User is authenticated but not connected” when you exceed the cap. The symptom looks like a random timeout, so people chase TLS when the real problem is connection count.

Cap the pool deliberately. Set the tool’s concurrency to half the server limit and leave headroom for the webmail session a human might open. If you run several projects against a catch-all domain, count sessions per mailbox, not per domain, because limits are enforced on the account. Add a reconnect backoff so a throttled connection waits instead of retrying in a tight loop.

Two more checks worth running before you walk away:

Check Where to verify Pass condition
IMAP/POP3 enabled Webmail settings, provider docs Toggle on, plan allows it
Auth method App password list or OAuth consent Token or password accepted on first connect
Concurrent sessions Server logs, tool concurrency setting Peak sessions under the server cap
Folder state writes Test run with \Seen flag Read state persists server-side

If the tool only needs to pull mail and delete it, POP3 sidesteps most of this: no folder sync, no read-state writes, no IDLE. But the session cap still applies, and POP3 port 995 with the wrong auth method fails just as silently as IMAP. Verify access and connection count on a small mailbox first, then scale the worker pool once the logs show clean, single-session handshakes.

POP3 for SEO Automation: Applying the Checklist to High-Volume Workflows

POP3 for SEO automation looks simple on paper: one account, one client, download and delete. At volume, the four checklist items stop being independent. Change the protocol and the port changes with it. Change the session cap and the retrieval window shifts. Get the order wrong and you find out at 2 a.m. when a batch job hangs on a handshake, which is why https://allmail.one/blog/pop3-vs-imap-for-seo-automation/ is worth reading before you commit.

Confirm the retrieval model before you touch the port

POP3 downloads mail to a single client, and RFC 1939 defines no folder concept beyond the inbox. If your workflow needs sent mail, reply threads, or read-state tracking, POP3 will not give it to you. If your workflow needs to pull verification links, contact-form replies, or ranking reports into a parser and then clear them, POP3 is the cheaper path: fewer round trips, no state negotiation, less bandwidth per message.

Decide this first. A tool misconfigured for POP3 against an IMAP-only mailbox fails at login, which is loud. A tool configured for IMAP when the workflow only needs inbox pulls fails quietly, by syncing folders you never read and burning session slots you needed for parallel workers.

Pair TLS mode with POP3 port 995, then enable access

POP3 uses encrypted port 995 for implicit TLS. Port 110 is plaintext or STARTTLS, and automation tools that hardcode 110 as “POP3” will negotiate in the clear unless you explicitly turn STARTTLS on. Check the pairing in the tool’s connection settings, not in the documentation, because defaults drift between versions.

Access enablement comes next. Confirm the protocol toggle is on for the specific mailbox, generate an app password if the provider requires one, and verify OAuth scopes cover mail retrieval rather than just identity. On catch-all email domains, test a real alias, not the primary address, since some servers scope protocol access per mailbox rather than per domain.

Checklist item POP3 setting for high volume What breaks if wrong Verify with
Protocol fit Inbox-only retrieval, delete after parse Missing sent mail and folder context One test message per workflow type
TLS and port Implicit TLS on 995 Silent plaintext or handshake timeout Connection log showing TLS version
Access POP3 toggle on, app password issued Login rejection on alias mailboxes Manual login from a second client
Sessions Cap workers below server limit Locked mailbox, refused connections Peak concurrent connection count
Retention “Leave messages on server” off or timed Mailbox quota exhaustion mid-run Quota graph over 24 hours

Cap concurrent sessions and verify retention before scaling

POP3 servers typically allow one active session per mailbox, sometimes two. Automation tools open parallel connections per worker by default, so a ten-worker pool against a single mailbox produces nine refusals and one slow crawl. Cap workers at the server limit, or shard across catch-all aliases so each mailbox gets its own connection budget.

Run this sequence before scaling:

  • Test one message through the full pipeline on port 995 with implicit TLS and confirm the connection log shows the expected TLS version.
  • Log in from a second client while the worker runs to expose the real session cap.
  • Send 50 messages at once and watch retrieval order and timing.
  • Confirm “leave messages on server” is off or time-limited, so quota does not fill mid-batch.
  • Check the outgoing mail server path separately; SMTP handles sending and has its own port and auth rules.

If any step needs more than one connection per mailbox, that is your signal to reconsider the protocol rather than tune around it.

Run the checklist once on a single low-volume mailbox before you point the tool at anything that matters. Connect with implicit TLS on port 993 for IMAP or 995 for POP3, confirm the handshake completes without falling back to plaintext, and check the server log for the exact protocol version and cipher in use. If the tool exposes a debug or verbose mode, read the raw session transcript: a clean OK after login plus a successful SELECT INBOX tells you more than any green status badge in the UI.

Then verify what the automation actually needs. If it only reads incoming alerts, POP3 with leave messages on server enabled and a sensible retention window does the job, and the inbox-only limitation of POP3 (RFC 1939) keeps retrieval predictable. If it must track read states, sort mail into folders, or share a mailbox with a human team, IMAP is the only sane choice, and you should cap concurrent connections at the server’s documented limit, often 5 to 15 per account, before adding workers. Test with a catch-all domain on a throwaway project first: send 50 messages, let the tool poll, and count what arrives. Mismatches in port, TLS mode, or session caps surface within minutes at that scale rather than after a week of silent message loss. Once the numbers line up, clone the working configuration to production and leave it alone.

Share