Module 4 · 4.1
English
How your email travels: MX, IMAP and SMTP
Module 4: Moving email · Reading time: 10 minutes
Learning objective: After this lesson, you can explain the route an email takes, name the parts that change when you move your mail, and point out what needs to move along besides the messages themselves.
Key concepts: MX record, mail server, mailbox, IMAP, POP3, SMTP, submission (port 587 and 465), webmail, mail program, alias, shared mailbox, rules
Why you need to understand the route first
Email feels like one single thing: you type, you press Send, and someone else reads it. In reality, at least four parts work together. When you move house, you change a few of them, and if you don't know which ones, you may flip the wrong switch. The result is mail that keeps arriving at the old provider for a day, or phones that quietly keep sending through the old server.
Bakkerij De Korrel owns the domain example.com. All twelve staff currently use Microsoft 365 for mail. The bakery wants to move to a European mail provider. Before they move anything, they map out the route.
The journey of a mail to info@example.com
A customer sends an order to info@example.com. Here's what happens:
- The customer's mail program hands the mail to its own outgoing server. This happens using SMTP (Simple Mail Transfer Protocol), via the port for submitting mail: submission, port 587 with STARTTLS or port 465 with TLS.
- That server wants to deliver the mail to
example.com. It asks the DNS: "what are the MX records for example.com?" The MX record points to the server that accepts mail for the domain. - The sending server connects to that server, again using SMTP (this time between servers, port 25), and delivers the mail.
- The receiving server places the mail in the mailbox for info@.
- Staff read the mailbox using a mail program or webmail. This usually happens using IMAP, port 993 with TLS.
klant --SMTP 587--> server klant --DNS: MX example.com?--> antwoord: mx.mailaanbieder.example
server klant --SMTP 25--> mx.mailaanbieder.example --> mailbox info@example.com
laptop, telefoon, webmail <--IMAP 993-- mailboxThe MX record lives in your domain's DNS, not with your mail provider. So whoever manages the DNS decides where mail for your domain goes. You can read exactly how MX records and priorities work in the DNS course, lesson 4.1.
IMAP or POP3: where does your mail actually live?
With IMAP, mail stays on the server. Your laptop, your phone and webmail all show the same mailbox. If you move a message into a folder on your phone, it's in that folder on your laptop too.
With POP3, the mail program fetches the mail and often then deletes it from the server. The mail then only lives on that one computer.
For a move, that makes a big difference. An IMAP mailbox can be copied from server to server: everything lives on the server. With POP3, part of your history may only exist on an old PC. You'll need to bring that mail across separately, for example by dragging the old folders in your mail program into your new IMAP mailbox.
Ask yourself: does anyone in your organisation still use POP3? You can check this in the account settings of the mail program: if it says POP or port 995, it's POP3.
Microsoft 365 and Google Workspace also use their own protocols for their own apps, such as Exchange ActiveSync and the Gmail app. You won't notice much of this, but it means not every setting automatically carries over to IMAP. After the move, every device needs to be set up again (lesson 4.4).
What changes when you move?
| Part | Before | After |
|---|---|---|
| MX record | points to Microsoft 365 | points to the new provider |
| Mailbox | at Microsoft | at the new provider (old mail copied) |
| IMAP and SMTP server in apps | Microsoft | the new provider's server name |
| SPF, DKIM, DMARC | set up for Microsoft | adjusted for the new provider |
| Your email address | info@example.com | stays info@example.com |
The most important good news is in the last row: because you have your own domain, your email address stays the same. Customers won't notice a thing. This is exactly why having your own domain is so valuable for your independence (lesson 8.2). If you currently have an address like bakkerij.dekorrel@gmail.com, you can copy the mail, but the address itself remains Google's. In that case, you'll need to let everyone know your new address.
What else belongs with your mail besides the messages
A mailbox is more than a stack of messages. With an IMAP copy, the messages and folders come along, but many other things don't. Make a list of these in advance:
- Aliases: extra addresses that end up in the same mailbox, such as
bestellingen@andfacturen@that arrive at info@. - Shared mailboxes and groups: in Microsoft 365, De Korrel has a shared mailbox
bestellingen@that four people read, and a groupteam@that goes to everyone. With the new provider, this becomes a regular mailbox with multiple users, a forward, or a mailing list. - Rules and filters: "mail from the wholesaler to the Purchasing folder". These live on the server or in the mail program and don't come along with an IMAP copy.
- Signatures: often live in the mail program or in the webmail settings.
- Automatic replies (out-of-office messages).
- Forwards to an external address.
- Senders that aren't a mailbox: the website that mails order forms, the till that mails receipts, the scanner that sends PDFs, the accounting software that sends invoices. These send on behalf of
example.comthrough a server. You need to include these in your SPF record too (lesson 4.3). - Calendar and contacts folders in Exchange. These don't come along with a mail copy. You move these separately (module 5).
This list turns "moving email" into a clear, manageable project. In the inventory from module 3 you already had a line for "email"; now you split that line up.
In practice: what it looks like at a provider
At WebOké, the settings for a mail program are listed together in the DirectAdmin guide: IMAP port 993 with SSL/TLS, SMTP port 587 with STARTTLS or 465 with SSL/TLS, and your full email address as the username. As the server name, use your domain name (if your website is also hosted with WebOké and has a valid certificate) or your package's server name. With other European mail providers, the ports are the same; only the server name differs, and some providers have you log in with a separate username instead of your email address. Always check your new provider's help pages.
Summary
- Mail is sent using SMTP, the MX record in the DNS determines where it arrives, and you usually read it with IMAP.
- The MX record lives in your domain's DNS: whoever manages the DNS directs the mail.
- With your own domain, your email address stays the same when you move; with a free address from a large company, it doesn't.
- IMAP mailboxes copy well; mail that only exists on a PC via POP3 needs to be brought across separately.
- Aliases, shared mailboxes, rules, signatures, autoresponders and devices that mail on behalf of your domain don't come along automatically. Put them on a list beforehand.
Quiz
Exercise
Exercise A4.1: Where does your mail currently arrive? Enter your own domain. The program looks up the MX records and the IP address of the mail server, and queries the IP address registry to find out which organisation manages that network and in which country it's registered. You enter in advance which mail provider you think you have. Then you'll see whether that's correct.
Exercise E4.1: Your mail checklist. Create the list from this lesson for your own organisation: mailboxes, aliases, shared mailboxes and groups, rules, signatures, autoresponders, forwards, devices and programs that mail on behalf of your domain, and who still uses POP3.
Exercise E4.1: Your mail checklist
Map out everything that belongs to your mail, not just the messages.
Your ticks and notes only stay in this browser; we don't send them anywhere. If you're signed in, we only save in My courses that you've done the exercise.
Further reading
The steps in these articles apply to WebOké's services; with other providers it works in a similar way.
- DirectAdmin guide 8.7: IMAP or POP3: what's the difference?
- DirectAdmin guide 8.1: All settings at a glance: servers, ports and security
- What is IMAP or POP3 and how does it work?
- Free DNS course 4.1: MX records and priority
- RFC 5321 (SMTP), RFC 6409 (submission, port 587), RFC 8314 (TLS for submission and IMAP, port 465 and 993), RFC 9051 (IMAP4rev2)
