All posts
Gabe 7 min read

Inbound email to Google Sheets: the whole path, including the two gaps

Every 'email to Sheets' walkthrough stops at the webhook. The last mile is two separate products with a seam: Apps Script answers with a redirect, and Google's official Workspace MCP can read a Sheet but not append to it. Here is the path that actually closes, and which half does the writing.

You want every enquiry, support reply and form notification to land as a row in a spreadsheet. It sounds like one integration. It is three things that have to meet: an address that can receive mail, a receiver that can accept a POST, and a Sheet that accepts a row.

The first two are the easy part now. A MailKite subdomain gives you an address with no DNS work at all, and its inbound webhook hands you clean JSON. The last mile is where the walkthroughs get quiet, because the obvious answers both fail for a reason worth knowing.

1 · an address you@something.mailk.us no DNS to publish 2 · a receiver must answer 200 to the JSON POST 3 · a row Google Sheet append, not overwrite

✕ Apps Script web apps answer POST with a redirect ✕ Google’s Workspace MCP reads Sheets; it cannot append So: push to something that answers 200 (Zapier, Make, n8n, a Worker) — or pull from inside the Sheet.

Three stages, two seams. Both seams have a clean fix once you know they exist.

The short answer

  • Address: claim a free MailKite subdomain — <name>.mailk.us — and there is no DNS step, no registrar, no propagation wait. Receiving starts in minutes.
  • Receiver: push the webhook at Zapier, Make or n8n (they answer 200 immediately), or run a small Apps Script inside the Sheet and pull. Do not point the webhook straight at an Apps Script web app.
  • Agent: connect Google’s official Workspace extension to read the Sheet back — count today’s rows, summarise them, flag the ones that need a reply. Writing stays with the receiver.

The rest of this post is why those two constraints exist, because a guide that skips them fails on camera the first time someone tries the obvious thing.

Gap one: a webhook cannot end at Apps Script

The natural design is: mail arrives, MailKite POSTs it to a Google Apps Script web app, the script appends a row. No server, no third party, free.

It does not work, and the failure is silent if you are not watching.

Deploy an Apps Script as a web app and Google answers every request — GET and POST alike — with a 302 to script.googleusercontent.com, which is where the actual output lives. That is fine for a browser and for HTTP clients that follow redirects. MailKite’s webhook delivery uses redirect: "manual" on purpose: a 3xx is recorded as a failed delivery, because a redirect is not proof that your endpoint processed the message. Following one blindly would also let a receiver that no longer exists look healthy right up until the mail is gone.

So the delivery is marked failed, retried on the backoff schedule, and never becomes a row. Nothing errors in your Sheet, because your script was never called.

That leaves two shapes that both work:

Push to something that answers 200. Zapier’s Catch Hook, Make’s custom webhook, n8n’s Webhook node and a ten-line Cloudflare Worker all return 200 before they do the slow part. Then the automation appends the row. Latency is seconds, and it runs whether or not your laptop is open.

Trigger:  Webhooks by Zapier → Catch Hook
Action:   Google Sheets → Create Spreadsheet Row
          From    ← from__address
          Subject ← subject
          Body    ← textFromHtml

Pull from inside the Sheet. A bound Apps Script can call MailKite’s GET /api/messages on a one-minute trigger and append anything it has not seen. It is one file, no extra account, and the only cost is latency plus an API key in the script properties.

var res = UrlFetchApp.fetch('https://api.mailkite.dev/api/messages?limit=50', {
  headers: { Authorization: 'Bearer ' + key },
  muteHttpExceptions: true,
});
// filter direction === 'inbound', dedupe on id, appendRow(...)

Which one is better? Push if the row has to exist within seconds (lead capture, a demo on camera). Pull if you want zero third-party services and can live with a minute. The full walkthrough has both, with the complete script.

Gap two: Google’s MCP reads Sheets, it does not write them

Google publishes an official Workspace extension for Gemini CLI — gemini-cli-extensions/workspace under the google org — and it ships a real MCP server. Point an agent at it and it can find your spreadsheet, read any range, and summarise what it sees.

That is genuinely useful here, just not for the writing half. The extension’s Sheets surface is three tools:

ToolWhat it does
sheets.getMetadatatabs, row and column counts, locale
sheets.getRangevalues from an A1 range
sheets.getTextthe whole sheet as text, CSV or JSON

All reads. There is no values.append, so “ask the agent to add a row” is not a thing the official server can do today, however the prompt is worded.

The split that works is: the automation writes, the agent reads. The webhook or script owns the append; the agent owns the questions you actually have about the data — “how many enquiries came in today”, “which ones mention a deadline”, “draft replies to the three that asked about pricing”. That is also the safer division of labour: the write path is deterministic and testable, and the model never touches the Sheet’s contents.

One more thing worth saying plainly, because it comes up every time: an agent that can read your mail and your documents is a prompt-injection surface. Google’s own README says so. Keep the agent’s Sheet access scoped to the one spreadsheet, and do not let it take instructions from message bodies.

The part that got easy: the address

The old version of this tutorial started with a paragraph about MX records, then SPF, DKIM, DMARC and a propagation wait, and lost half the readers before the first email.

MailKite hands out free subdomains on a zone we run. The agent claims one in a single call:

mailkite_claim_subdomain({ subdomain: "leads-acme" })
// → { domain: "leads-acme.mailk.us", dns: [] }

That empty dns array is the point — we publish the records. A subdomain of a domain you already own is still the right choice when the address has to look like you (hello@yourbrand.com), but for a contact form, a lead sheet or an agent inbox there is no reason to make DNS the first step.

Because it is a catch-all, every local part works: hello@, forms@, fix-my-site@. One webhook, one Sheet, no per-address setup.

What the row should contain

The inbound payload is the whole parsed message, so pick the fields before you build the map:

  • from.address — who to reply to
  • subject
  • text or textFromHtml — the sender’s plain text, or our derivation when they only sent HTML
  • receivedAtIso
  • auth.spam and auth.spamSignals — the edge’s verdict, informational but useful as a filter once the address is public
  • attachments[] — name, size and a signed download URL

The id is worth keeping as a column even if you never look at it: it is the dedupe key that makes a retry, a replay or a re-run of the script harmless.

When Sheets is the wrong answer

Sheets is a great CRM for one person and a bad database for a team. It caps at roughly ten million cells per file, has no transactions, and every editor can break a formula. If two people will be triaging the same inbox, or you need a query surface, put the rows in Airtable, a Postgres table or MailKite’s own contacts and sequences — the webhook payload is the same JSON either way.

For a freelancer with one enquiry form, a podcast inbox, or a “who wrote in this week” list, a Sheet is exactly right: it opens instantly on a phone, it is shareable, and it is the one tool everyone already has.

Build it in about ten minutes

The full path — the one-prompt agent setup, the subdomain claim, both receiver options with the complete Apps Script, and the read-back prompt for Google’s official extension — is in the guide:

Inbound email to Google Sheets →

No DNS. No mail server. No serverless function to babysit. One address, one receiver, one Sheet — and an agent that can tell you what is in it.

Discuss this post: Hacker News Share on X Share on LinkedIn

Related posts