Temp Mail
Temp Mail (Temporary Email) is a plugin for Premium URL Shortener that lets your users generate disposable email addresses and receive incoming mail live in the dashboard. Inbound messages are delivered through webhooks from Mailgun, SendGrid, Postmark, or Cloudflare Email Routing (via an Email Worker).
Logged-in users with the feature on their plan see a Temporary Email menu. You can also enable a public page so visitors can generate an inbox without creating an account.
Features
- One-click disposable address generation on your configured domains
- Live inbox with auto-refresh, HTML/text rendering, and attachment downloads
- Per-plan limits for number of addresses and attachment storage (MB)
- Optional public (guest) access with IP-based address limits and captcha
- Inbound providers: Mailgun, SendGrid, Postmark, and Cloudflare Email Routing
- Configurable address duration and message retention with cleanup cron
- Attachment store/discard controls (separate for logged-in users and public guests)
- Admin overview of all addresses with search and delete
- Marketing feature page at
/feature/tempmail
Requirements
| Premium URL Shortener | Version 8.0 or higher |
| PHP | Version 8.2+ |
| Domain(s) | One or more domains dedicated to temporary mail (catch-all inbound) |
| Inbound provider | Mailgun, SendGrid, Postmark, or Cloudflare Email Routing + Worker |
| Writable storage | storage/app/tempmail must be writable for attachments |
Installation
- Extract the zip file downloaded after purchase
- Go to your site Admin Plugins All Plugins
- Click on Upload and upload the file named tempmail.zip
- Click on the three dots then Activate
- Go to Admin Temporary Email Settings to configure it
If the uploader does not work, extract tempmail.zip into storage/plugins/. The folder must be named tempmail. Then activate it in the admin panel.
storage/app/tempmail folder, and copies CSS/JS assets automatically.Membership Plans
The plugin registers two plan features. Enable them under Admin Memberships Plans for each plan that should offer temporary email:
Temporary Email Addresses
Maximum number of active disposable addresses a user on that plan may create. Set to 0 for unlimited.
Temp Email Attachment Storage (MB)
Maximum total attachment storage (in megabytes) for that user’s received files. Guest/public addresses are not tied to a plan and are not limited by this setting.
Users only see the Temporary Email menu when their plan includes the Temporary Email Addresses feature.
Plugin Configuration
Go to Admin Temporary Email Settings:
Domains
One domain per line (e.g. temp.example.com). Each domain must be set up as a catch-all with an inbound provider that POSTs to the plugin webhook.
Address Duration (minutes)
How long a generated address stays active. Default is 60. Set to 0 so addresses never expire automatically.
Message Retention (days)
Messages older than this are deleted by the cleanup cron. Default is 7. Set to 0 to keep messages forever.
Store Attachments
When disabled for logged-in users, only the message body is stored and file attachments are discarded.
Max Attachment Size (MB)
Individual attachments larger than this are silently dropped; the message body is still kept. Default is 5.
Public Access
Let anyone generate a temporary address without an account. Configure max addresses per visitor IP and whether public inboxes store attachments (independent of the logged-in setting). When enabled, the settings page shows the public page URL.
Inbound Providers
Enable at least one provider in Temporary Email Settings. Each provider section shows a unique Webhook URL — copy it into the provider dashboard. You can enable more than one provider if different domains use different services.
Mailgun
Create a Route that matches mail to your temp domain(s) and forwards to the Mailgun webhook URL. Optionally paste the HTTP Webhook Signing Key (Sending Webhooks) so inbound requests are verified.
SendGrid
Go to Settings Inbound Parse, add your domain(s), and point them at the SendGrid webhook URL.
Postmark
Create an Inbound server/stream for your domain(s) and set its webhook URL to the Postmark webhook shown in settings.
Cloudflare Email Routing
Cloudflare cannot call a webhook directly. Enable Email Routing on the domain, create an Email Worker that parses the message with postal-mime, and POST JSON to the Cloudflare webhook URL. Full Worker instructions are in the next section.
Cloudflare Email Worker
Use this path when you want Cloudflare Email Routing to deliver mail into Temp Mail. The domain must use Cloudflare DNS. Official references: Enable Email Routing and Email Workers.
1. Onboard the domain
- In the Cloudflare dashboard, go to Compute Email Service Email Routing.
- Select Onboard Domain and choose the domain you will use for temporary addresses (or a subdomain zone dedicated to temp mail).
- Confirm the DNS records Cloudflare adds: MX (inbound), plus TXT for SPF and DKIM.
- Wait for DNS to propagate (often 5–15 minutes; up to 24 hours).
2. Create the Worker project
On your computer (Node.js required):
npm create cloudflare@latest tempmail-email-worker cd tempmail-email-worker npm install postal-mime
When prompted, choose a Hello World / Worker starter so Wrangler scaffolds the project. You only need the email() handler — no HTTP fetch handler is required for inbound routing.
wrangler.toml (or wrangler.jsonc)
Set a current compatibility_date and point main at your entry file:
name = "tempmail-email-worker" main = "src/index.js" compatibility_date = "2026-09-11"
3. Worker code
Replace the Worker entry file with the script below. Copy the Cloudflare Webhook URL from Admin Temporary Email Settings (enable Cloudflare Email Routing first) and paste it into the fetch(...) URL.
subject / text / html. Never forward message.raw as-is — raw MIME (headers and boundaries) will be rejected rather than displayed in the inbox.// npm install postal-mime
import PostalMime from "postal-mime";
function toBase64(bytes) {
let binary = "";
const chunkSize = 0x8000;
for (let i = 0; i < bytes.length; i += chunkSize) {
binary += String.fromCharCode.apply(null, bytes.subarray(i, i + chunkSize));
}
return btoa(binary);
}
export default {
async email(message, env, ctx) {
const email = await PostalMime.parse(message.raw);
const attachments = (email.attachments || []).map((a) => ({
filename: a.filename || "attachment",
contentType: a.mimeType || "application/octet-stream",
contentBase64: toBase64(new Uint8Array(a.content))
}));
// Paste your Cloudflare webhook URL from Temp Mail settings
const res = await fetch("https://YOUR-SITE.com/tempmail/webhook/cloudflare/YOUR-TOKEN", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
to: message.to,
from: message.from,
subject: email.subject || "",
text: email.text || "",
html: email.html || "",
attachments
})
});
// Log HTTP status/body so silent drops appear in Worker logs
console.log("tempmail webhook status:", res.status, await res.text());
}
};
postal-mime decodes the MIME structure so text/html contain only the message body.
4. Deploy the Worker
- Log in if needed:
npx wrangler login - Deploy:
npx wrangler deploy(ornpm run deploy) - Confirm the Worker appears under Workers & Pages in your Cloudflare account
Optional local test: npx wrangler dev exposes a local email endpoint so you can POST sample MIME and inspect Worker logs before going live.
5. Route Email Routing to the Worker
- Return to Email Routing for your temp domain
- Open the Routing Rules tab
- Create a Catch-all rule (required so random local parts like
[email protected]are accepted) - Set Action to Send to a Worker and select
tempmail-email-worker - Save the rule
Add the same domain to the Domains list in Temp Mail settings, enable Cloudflare Email Routing, and save.
6. Test end-to-end
- Generate a temporary address in the user dashboard (or public page)
- Send a test email from another mailbox to that address
- Confirm the message appears in the Temp Mail inbox
- If nothing appears, open the Worker’s logs in Cloudflare and check the webhook response:
{"matched": true}— delivered successfully{"matched": false}— webhook ran but no active address matched (expired, deleted, or wrong domain){"error": true}— bad token in the URL, or Cloudflare inbound is disabled in settings
Cleanup Cron
The settings sidebar shows a unique cleanup URL. Call it periodically (e.g. hourly) to expire old addresses and purge messages past the retention window.
0 * * * * wget -q -O - "https://YOUR-SITE.com/cron/tempmail/YOUR-TOKEN" >/dev/null 2>&1
Copy the exact URL from Admin Temporary Email Settings. Without the cron, expired addresses and old messages will not be cleaned up automatically.
User Inboxes
Users whose plan includes Temporary Email Addresses see Temporary Email My Addresses in the dashboard.
- Choose a domain (if more than one is configured) and click Generate New Address
- Copy the address and use it for sign-ups or one-time messages
- Open the address to view the live inbox — new messages appear automatically
- Open a message to read HTML/text content and download attachments (when stored)
- Delete individual messages, bulk-delete, or delete the address when finished
The addresses list shows message count, expiry time, and Active/Expired status. Address creation stops when the plan limit is reached.
Public Access
When Public Access is enabled, visitors can open the public Temp Mail page (URL shown in settings), generate an address (captcha protected), and bookmark the unique inbox link. Limits are per visitor IP. Public attachment storage is controlled separately from logged-in users.
A marketing page is also available at /feature/tempmail and is linked from the Solutions menu.
Admin Addresses
Go to Admin Temporary Email Addresses to review all generated addresses (user and public), search, and delete them when needed.
Notes
- Use a dedicated domain or subdomain for temporary mail — do not mix it with your primary transactional mail domain.
- Ensure
storage/app/tempmailis writable if you store attachments (settings shows Attachments Writable: Yes/No). - Webhook URLs include a secret token — treat them like passwords and rotate by regenerating settings if leaked.
- Inbound webhooks are CSRF-exempt by design; security relies on the token in the URL (and Mailgun signing when configured).
- Schedule the cleanup cron so expired addresses and old messages do not accumulate.
Upgrading
To update the plugin, upload the new version via Admin Plugins All Plugins. Settings and address/message data are preserved. The plugin runs its database schema update on activate/update when needed. If a migration notice appears on the settings page, click Update.
© 2026 GemPixel. All Rights Reserved.