Getting Started
LastPost is a self-hosted email client that runs as a single PHP file. You drop it on a web server, point it at your mail server, and it's ready — no database, no dependencies, no setup ceremony.
What you'll need
Before you download, make sure you have:
- A web server running PHP 8.1 or later with the
imapandopensslextensions enabled. Most shared hosts and VPS setups already have these. - An IMAP/SMTP mail server you have credentials for. LastPost works with any standard mail server — Mailu, Mailcow, iRedMail, Fastmail, or even Gmail with IMAP enabled.
- Your IMAP and SMTP hostnames and ports. Your mail provider or self-hosted stack documentation will have these. Common values: IMAP on port 993 (SSL) and SMTP on port 465 (SSL).
Shared hosting works fine. LastPost doesn't need root access, a database, or anything beyond standard PHP. If your host runs WordPress sites, it can run LastPost.
Installation
-
Download lastpost.php
Get the file from the download page. You'll receive a link by email — click it to download the single
lastpost.phpfile. -
Edit the four configuration constants
Open
lastpost.phpin any text editor. Near the top you'll find a configuration block:define('LP_IMAP_HOST', 'mail.example.com'); define('LP_IMAP_PORT', 993); define('LP_SMTP_HOST', 'mail.example.com'); define('LP_SMTP_PORT', 465);Replace
mail.example.comwith your mail server's hostname. The ports are the standard SSL values — only change them if your server uses non-standard ports. -
Upload the file
Upload
lastpost.phpto your web server using FTP, SFTP, or your host's file manager. Put it wherever you want to access it — the root of a subdomain likemail.example.comis typical, but a subdirectory likeexample.com/mail/works too. -
Open it in your browser
Navigate to the URL where you uploaded the file. You'll see the LastPost login screen.
Apache users: if you want clean URLs (e.g. /api/folders instead of lastpost.php?_api=folders), see the Apache configuration section of the self-hosting guide. It's optional — LastPost works without it.
First login
The login screen asks for your email address and password — the same credentials you'd use in Thunderbird, Apple Mail, or any other email client. LastPost uses these to authenticate against your IMAP server.
Your password is never stored on disk. It's held server-side in a PHP session for the duration of your visit and discarded when the session ends. The browser never sees it.
After logging in, LastPost fetches your folder list from IMAP and loads your inbox. First load takes a moment while it retrieves your recent messages.
Reading your mail
LastPost uses a three-pane layout:
- Left sidebar — your folder tree. INBOX, Sent, Drafts, Junk, Trash, and any custom folders on your server appear here. Click any folder to load its messages.
- Middle pane — the message list for the selected folder, sorted newest first. Unread messages are highlighted. Click a message to open it.
- Right pane — the full message. HTML and plain text emails are both supported. External images are blocked by default — a prompt appears if the sender included any.
To mark a message read or unread, use the button in the message detail toolbar. To delete a message, it moves to Trash. To flag it for follow-up, use the flag icon in the message list.
Composing a message
Click Compose in the sidebar to open the compose panel. Fill in the To, Subject, and body fields, then click Send.
A few things worth knowing:
- Reply and Forward are in the message detail toolbar. Reply pre-fills the To field with the sender; Forward leaves it blank for you to fill in.
- CC and BCC are always visible in the compose panel — not buried in a menu.
- Attachments — use the attachment button in the compose toolbar to add files.
- Drafts — LastPost auto-saves your draft as you type. The drafts panel slides open alongside compose so you can see and resume in-progress messages. If you close the compose panel without sending, your draft is waiting in the Drafts folder.
Personas — send as any address
Personas are LastPost's flagship feature. A persona is a named sending identity — a display name, a From address, an optional Reply-To, and a signature block. If you have multiple email addresses (aliases, business addresses, project inboxes) that all land in the same mailbox, personas let you reply from the right one every time.
To create a persona, open Settings → Personas and click Add persona. Give it a name, a From address, and optionally a Reply-To and signature. Save it, and it appears in the From dropdown in the compose panel.
When you reply to a message, LastPost automatically selects the persona whose From address matches the address the email was originally sent to. If you were emailed as [email protected], the reply goes out from your billing persona without you having to think about it.
Personas are stored locally in your browser. They're tied to this device and browser — if you use LastPost from a different machine, you'll set them up again there. This is by design: your identities never leave your browser or touch the server.
What's next
You're up and running. A few things to explore next:
- Themes — Settings → Themes. LastPost ships with several dark and light themes. You can also import a theme JSON file or build your own with the color picker.
- Keyboard shortcuts — coming soon. J/K to navigate messages, R to reply, C to compose.
- Advanced configuration — optional features like vacation auto-reply (Sieve) and contact sync (CardDAV) are documented in the Self-Hosting Guide.
- Questions or issues — post in the community repo.
Ready to get started?
Get LastPost — it's free