PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteYes. A Cloudflare Worker with an email handler receives each message routed to it, exposes the unparsed MIME stream as message.raw, and can write that stream into a D1 table through an environment binding. The handler below is about 25 lines of JavaScript. Around it you need a D1 table, a Wrangler binding, and an Email Routing rule that sends the address to the Worker.
“Every message” needs one qualification up front. The archive stores every message that reaches the handler and fits the documented storage limits. It is not a guarantee of permanent retention, backups, or delivery in every failure case. The sections below explain where those boundaries sit.
As an Amazon Associate I earn from qualifying purchases.
What you need before you start
- A domain whose DNS is hosted on Cloudflare. Email Routing requires Cloudflare DNS for the domain.
- A Cloudflare account with Workers and D1 available, and Node.js with Wrangler installed.
- An address on that domain, such as
[email protected], that you want to route to the Worker.
How mail reaches the Worker
Mail only reaches your code after Email Routing is configured to send an address pattern to the Worker. In the Cloudflare dashboard, open Email Routing for the domain, go to Routing rules, create a custom address, and set the action to send to a Worker, selecting the Worker you deploy below. Dashboard labels change from time to time, so treat these names as a guide. The rule has to be enabled. A disabled or missing rule means messages never enter the handler, and nothing in the Worker will show a failure.
The official Email Service overview describes two routing paths. The comparison below explains why this article uses the Worker path.
#1 Best Overall
- 【AMD Ryzen 5 3501U Mini PC For Enhanced Daily Performance】Powered by AMD Ryzen 5 3501U processor with 4 cores and 8 threads, this mini pc provides responsive performance for office applications, home entertainment, online learning, media playback, and everyday computing.
- 【16GB Memory & 512GB Storage With Expansion Options】Built with 16GB DDR4 RAM and 512GB PCIe 3.0 NVMe SSD, this mini computer provides more space for applications, files, videos, and daily content. Upgrade memory up to 32GB, expand SSD storage up to 2TB, or add a 2.5-inch HDD.
- 【Flexible Small Desktop Computer For Home Applications】This small desktop computer is designed for home office, streaming, personal server setups, digital entertainment, and light gaming. The upgraded memory helps support smoother operation when using more applications.
- 【Triple Display Setup & Flexible Connectivity】Dual HDMI ports and a full-function USB-C port support up to three displays. This micro pc offers convenient connectivity with WiFi 6, Bluetooth 5.3, Gigabit Ethernet, and multiple USB ports.
- 【Compact Mini Desktop With Space-Saving Design】Measuring only 5.0 × 4.4 × 1.6 inches, this small pc saves valuable desk space. VESA mount support allows installation behind compatible monitors, making it suitable for home offices and compact workspaces.
| Option | What happens to the message | Custom code | Persistent archive in D1 | Setup effort |
|---|---|---|---|---|
| Forward to an existing address | Delivered to a mailbox you already use | Not required | No; you would need a separate archive | Lowest |
| Send to a Worker | Passed to the email handler, which can read the raw MIME and write to D1 |
Required | Yes, through a D1 binding | Moderate: Worker, D1 database, and routing rule |
Create the D1 table
The schema below is one reasonable layout, not a Cloudflare requirement. It keeps a few searchable metadata columns next to the raw message. The raw message is stored as a BLOB, so no Base64 encoding is needed and the stored size is the size of the original bytes.
CREATE TABLE IF NOT EXISTS emails (
id INTEGER PRIMARY KEY AUTOINCREMENT,
received_at TEXT NOT NULL,
sender TEXT NOT NULL,
recipient TEXT NOT NULL,
subject TEXT,
message_id TEXT,
raw_size INTEGER NOT NULL,
raw BLOB NOT NULL
);
The handler
Save this as src/index.js. It reads the stream, rejects messages that are too large for a single row, and inserts the rest with a prepared statement whose values are bound as parameters.
Rank #2
- This Certified Refurbished product is tested and certified to look and work like new. The refurbishing process includes functionality testing, basic cleaning, inspection, and repackaging. The product ships with all relevant accessories, a minimum 90-day warranty, and may arrive in a generic box. Only select sellers who maintain a high performance bar may offer Certified Refurbished products on Amazon.com
- Intel Quad-core i5-6500T up to 3.1G,16G DDR4 memory(2 slots,supports up to 32GB),240G SSD
- Includes USB Keyboard(English Keyboard & Mouse Included)
- I/O ports:Front:2 USB 3.0 ,microphone,headphone ,USB Type-C port Rear:4USB 3.0 ,VGA DP port,RJ-45
- Operating System:Win10Pro64bit
const MAX_RAW_BYTES = 1_900_000; // below the 2,000,000-byte row/BLOB limit, leaving room for the other columns
export default {
async email(message, env) {
if (message.rawSize > MAX_RAW_BYTES) {
message.setReject('Message too large to archive');
return;
}
const raw = await new Response(message.raw).arrayBuffer();
if (raw.byteLength > MAX_RAW_BYTES) {
message.setReject('Message too large to archive');
return;
}
await env.DB.prepare(
'INSERT INTO emails (received_at, sender, recipient, subject, message_id, raw_size, raw) VALUES (?, ?, ?, ?, ?, ?, ?)'
)
.bind(
new Date().toISOString(),
message.from,
message.to,
message.headers.get('subject') ?? '',
message.headers.get('message-id') ?? '',
raw.byteLength,
raw
)
.run();
},
};
The listing is the handler only. Wrangler configuration and the schema file sit beside it, as shown in the deployment steps.
How the handler works
Reading the raw stream
message.raw is a ReadableStream, and a stream can be consumed only once. Wrapping it in a Response and calling arrayBuffer() reads the whole message into memory as bytes. Cloudflare’s local routing documentation uses the same wrapping idiom. The pre-check on message.rawSize runs first so oversized messages are refused before the stream is read at all.
Rank #3
- Powerful AMD Ryzen 5 5500U Processor: Beelink SER5 Mini PC is powered by AMD Ryzen 5 5500U (2.1GHz-4.0GHz, 6C/12T, 8MB L3 cache), built by the latest breakthrough 7nm architecture, processing performance is 89% increased compared to the Ryzen 5 3500U. This Mini PC delivers smooth performance for business office tasks, creative design, and daily multitasking
- High-Speed DDR4 RAM & Expandable Storage: Beelink 5500U mini pc Equipped with 16GB DDR4 RAM (dual-channel, supports up to 64GB) and a 480GB M.2 NVMe SSD. The SER5 supports storage expansion up to 4TB via the M.2 slot and includes a 2.5-inch 7mm SATA HDD slot for massive internal capacity (max 2TB, not included). Quicker load times of programs and apps for smoother using experience
- Stunning Triple 4K@60Hz Display: Beelink SER5 Pro boosts your efficiency by connecting up to three monitors simultaneously. With HDMI, DisplayPort, and a Type-C (Data & Video) port, you can enjoy a seamless 4K ultra-high-definition setup at 60Hz for complex workflows and immersive entertainment
- Ultra-Stable WiFi 6 & Bluetooth 5.2: Experience next-generation connectivity with WiFi 6 for faster speeds and lower latency, even in congested networks. The upgraded Bluetooth 5.2 ensures a more stable and efficient connection for all your wireless peripherals like mice, keyboards, and headsets
- Compact Design & Efficient Cooling: Measuring only 4.96 x 4.44 x 1.65 inches, Beelink Ryzen 5 Mini PC is 1/40th the size of a standard desktop. The premium ABS body and full metal mesh design, combined with Beelink's advanced thermal engineering, ensure quiet and stable operation even under heavy workloads
Choosing the size threshold
The D1 limits documentation lists a maximum string, BLOB, or row size of 2,000,000 bytes. The raw message is one BLOB inside one row, and the metadata columns share that row. The handler therefore uses 1,900,000 bytes as its threshold. That margin is a design choice, not a Cloudflare figure. Adjust it if your metadata is larger.
Binding values safely
Every value enters the statement through .bind(...) and a ? placeholder. Sender, recipient, and subject come from the message, so none of them should be concatenated into SQL text. An ArrayBuffer bound to a BLOB column is stored as bytes.
Rank #4
- [Powerful Processor] Mini Gaming PC equipped with Core i9-14900F, 24 Cores 32 Threads, 36M Cache, Max Turbo Frequency: 5.8GHz, Windows 11 pro (64 Bit).64G DDR5-5600 RAM| 4T M.2 NVME PCIE4.0 SSD| 4T SATA SSD. With GeForce RTX 50 Series GPUs. supporting ray tracing and AI cores. Delivering AI-acceleration in top creative apps. Whether you’re rendering complex 3D scenes, editing 4K video, or Gaming livestreaming with the best encoding and image quality.
- [Powerful Capacity & Storage Expansion] The mini desktop computer is equipped with Dual-DDR5 RAM (dual channel DDR5 high-speed memory, which can support up to 96G RAM), 1 x M.2 2280 PCIE4.0 high-speed SSD, and support add 1 x 2.5-inch SATA HDD/SSD is enough to accommodate system files and massive games, Excellent reading and writing speed greatly shortening your boot time.
- [8K@60Hz Four-Display] Mini PC equipped with GeForce RTX5060Ti 16GB GDDR7 discrete graphics card, supporting ray tracing and AI cores. easy connect 4 monitors, 1×HDMI 2.1b and 3×DisplayPort 2.1b(All Support 8K@60Hz display), It can provide you with a first-class TV experience and realistic picture quality, for your visual home entertainment, streaming video, web browsing, work design and 3D games create a very smooth experience.
- [Functional Interfaces] Mini computer is equipped with 4 x USB 3.2, 4 x USB2.0, 1 x HDMI2.1 port, 3 x DP2.1 ports, 2xRJ-45 Gigabit Network Ethernet, 1 x Fiber Optic PORT, 1 x Audio in/out. Built-in Bluetooth 5.4 and IEEE 802.11be wifi 7, Higher transfer rates and lower latency. Mini PC supports multiple device connection and can be used with servers, monitoring equipment, office equipment, projectors, televisions, etc, Mini desktop computer support automatic power on and Wake On Lan.
- [Warranty & heat dissipation] Warrant: 2 year/24 months. The compact computer size: 8.6*6.6*4.5in, 5.5lb, Inside the chassis are four all-copper turbo fans and eight vacuum heat pipes for powerful cooling performance. Make it can work smoothly and will not cause too much noise.
Failure behaviour
An oversized message is rejected with setReject(), which tells the sending server the message was refused, and the handler returns without writing a row. If the insert fails, the exception propagates out of the handler and appears in the Worker’s logs. The handler does not retry or write a fallback copy. Plan for that case in production, as described in the limits section.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Deploy and test
Deployment steps
- Create the database with
npx wrangler d1 create email-archive. The command prints adatabase_id; copy it. - Add the binding to
wrangler.toml. Use a currentcompatibility_dateand paste in the ID from step 1.name = 'email-archive' main = 'src/index.js' compatibility_date = '2026-10-01' [[d1_databases]] binding = 'DB' database_name = 'email-archive' database_id = 'paste-the-id-from-step-1' - Apply the schema to the remote database with
npx wrangler d1 execute email-archive --remote --file=schema.sql. - Deploy with
npx wrangler deploy. - In the dashboard, create the routing rule described earlier, pointing the address at this Worker, and confirm it is enabled.
Local check
Before you point live mail at the Worker, run npx wrangler d1 execute email-archive --local --file=schema.sql and start the Worker with npx wrangler dev. Cloudflare’s local development documentation describes how to trigger the email handler on your machine. A local run confirms the code and the binding work. It does not prove that Email Routing delivers mail to your Worker.
Best Value
- 【Supports Linux and Win11】Micro PC win 11 equipped with Celeron J4105 (2GHz to 2.7GHz) processor, supports Win 11 Pro OS, supports Linux, Ubuntu as well. This portable and powerful fanless mini computer is a great helper for your business, office, entertainment, classroom, conference room, industrial IOT applications, home and more
- 【Low-noise fanless design and PC material】Mini PC fanless has a special cooling system and outer texture design (efficient heat dissipation) to simulate overheating, no fan no noise. Provides a quiet and stable computer environment when using, portable PC supports 7/24 hours operation
- 【USB-C and multiple interfaces】Desktop mini PC stick Win 11 Pro equipped with 1 x USB-C (wider compatibility), 2 x USB 3.0 ports, TF card reader, 1 x HDMI 2.0 ports, 1 x Gigabit LAN port, 1 x 3.5 mm audio jack, you can connect to multiple devices such as projector, NAS, monitor, keyboard mouse, etc., mini desktop supports USB PD 3.0 Charge 0 Charge 024 W)
- 【Dual band Wi-Fi & 4K @ 60Hz】Portable mini pc stick server built in 2.4/5GHz I/O ports, WiFi and Bluetooth 5.0, our fanless mini PC equipped with HDMI port together with the UHD 600 graphics, supports HDMI 4K UHD graphics output, which can improve your video images to be more vivid
- 【Storage and storage】Mini PC stick HDMI equipped with 8GB LPDDR4, 128GB eMMC, fully functional to perform Win11 and HD video, micro computer can be easily connected to other devices, so you can easily deal with multiple tasks and projects at the same time
Live test
Send a message from an outside account to the routed address. Then query the newest rows:
npx wrangler d1 execute email-archive --remote --command "SELECT id, received_at, sender, subject, raw_size FROM emails ORDER BY id DESC LIMIT 5;"
A successful test shows a new row whose sender and subject match the message you sent, and a raw_size close to the size of the original message including headers. If no row appears, run npx wrangler tail while you send a second test message. A thrown error will show there. If the tail is silent, check the routing rule first, because the handler never ran.
Limits that decide what “every message” means
The figures below come from Cloudflare’s D1 limits documentation as it stood when this article was written. The page was last updated on 24 August 2026. Limits change, so check the current page before you size a production archive.
| Limit | Value | Why it matters here |
|---|---|---|
| Maximum string, BLOB, or row size | 2,000,000 bytes | A raw message larger than this cannot be stored in one row, so the handler rejects it. |
| Maximum database size, Workers Free | 500 MB | Caps how many messages a free-plan archive can hold. |
| Maximum database size, Workers Paid | 10 GB | Applies to the paid plan; plan for pruning or a second database once you approach it. |
Given those limits, a fair description of the archive is that it stores each message that reaches the handler, is no larger than the row limit, and fits in the database. Several conditions sit outside the code:
Quick Recap
- A disabled or misconfigured routing rule, or DNS that is not on Cloudflare, means the handler never runs.
- A handler error or a full database causes the insert to fail. The code does not queue or retry the message.
- Cloudflare’s documentation does not, in the sources reviewed for this article, promise permanent retention or a transactional delivery guarantee for inbound mail. Treat the D1 table as the record you control, not a guaranteed copy.
What this listing leaves out
- Migrations beyond a single schema file, and a plan for changing the table later.
- Retention rules, pruning, and backups or exports of the database.
- Deduplication. The
message_idcolumn is not unique, so a message redelivered by a sending server can be stored twice. - Attachment handling and search over message bodies. The raw MIME is stored as-is.
- Alerting on failed inserts or rejected messages. Logs and
wrangler tailare manual tools.
.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




