Spoof a local mail server to bypass Outlook for Mac's mandatory sign‑in

Classic Outlook for Windows can be started without an email account via Outlook.exe /PIM <new-profile-name>.

Outlook for Mac does not offer an equivalent option, but this can be worked around by pointing Outlook at a local dummy mail server so it accepts account setup without real credentials.

1. Run a local dummy mail server

Save and run the following script:

import socket
import threading

RESPONSES = {
    'POP3': {
        'greeting': b"+OK POP3 server ready\r\n",
        'bye': b"+OK Bye\r\n",
        'default': b"+OK\r\n",
        'commands': {
            'CAPA': b"+OK Capability list follows\r\nUSER\r\nUIDL\r\n.\r\n",
            'AUTH': b"-ERR Authentication failed, try USER/PASS\r\n",
            'STLS': b"-ERR TLS not available\r\n",
            'STAT': b"+OK 0 0\r\n",
            'UIDL': b"+OK\r\n.\r\n",
            'LIST': b"+OK 0 messages\r\n.\r\n",
        }
    },
    'SMTP': {
        'greeting': b"220 localhost ESMTP\r\n",
        'bye': b"221 Bye\r\n",
        'default': b"250 OK\r\n",
        'commands': {
            'EHLO': b"250-localhost\r\n250-SIZE 1000000\r\n250 8BITMIME\r\n",
            'HELO': b"250-localhost\r\n250-SIZE 1000000\r\n250 8BITMIME\r\n",
            'DATA': b"354 Go ahead\r\n",
            'AUTH': b"235 2.7.0 Authentication successful\r\n",
        }
    }
}

def handle_connection(conn, protocol):
    cfg = RESPONSES[protocol]
    conn.send(cfg['greeting'])

    with conn:
        while True:
            try:
                data = conn.recv(1024)
                if not data:
                    break

                command = data.decode('utf-8', errors='ignore').strip().upper()
                print(f"[{protocol}] Received: {command}")

                if command.startswith("QUIT"):
                    conn.send(cfg['bye'])
                    break

                # Find matching command
                response = cfg['default']
                for cmd, resp in cfg['commands'].items():
                    if command.startswith(cmd):
                        response = resp
                        break

                conn.send(response)
            except (ConnectionResetError, BrokenPipeError):
                break

def start_server(port, protocol):
    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
        s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
        try:
            s.bind(('127.0.0.1', port))
            s.listen(5)
            print(f"Listening on port {port} for {protocol}...")
            while True:
                conn, addr = s.accept()
                print(f"Connection from {addr} on {protocol}")
                threading.Thread(target=handle_connection, args=(conn, protocol), daemon=True).start()
        except OSError as e:
            print(f"FAIL: Could not bind port {port}. Error: {e}")

if __name__ == "__main__":
    servers = [
        threading.Thread(target=start_server, args=(1100, 'POP3'), daemon=True),
        threading.Thread(target=start_server, args=(2525, 'SMTP'), daemon=True),
    ]

    for t in servers:
        t.start()

    try:
        for t in servers:
            t.join()
    except KeyboardInterrupt:
        print("\nShutting down...")

2. Configure Outlook for Mac

In Outlook for Mac, create a new account with these settings:

Notes

❧ 2025-12-07