omiid
homenotebookai usage

Email special headers

November 20, 2024 · Updated on August 09, 2026

Email headers carry more than the sender address and the subject line. A few special email headers tell Gmail and Outlook how to show an unsubscribe button and how to group messages that come from the same sender.

I write short, practical notes like this one. Get the next one by email:

Unsubscribe anytime.

List-Unsubscribe puts the opt-out in the client UI

Modern email services like Gmail and Outlook use List-Unsubscribe headers to let users opt out with a single click. Instead of digging through the email for a tiny “unsubscribe” link, you get a clear button at the top. This improves deliverability for senders and makes it easier for users to manage subscriptions.

Bulk senders need one more piece. Gmail and Yahoo expect one-click unsubscribe as defined in RFC 8058: a List-Unsubscribe-Post: List-Unsubscribe=One-Click header, plus an HTTPS endpoint that accepts a POST request.

List-ID and Precedence tell the provider this is bulk mail

To prevent inbox clutter, email providers use headers like List-ID and Precedence to group related emails together. For example:

• List-ID: Helps categorize newsletters from the same source.

• Precedence: Bulk: Tells the email provider it’s part of a mass mailing, which can influence filtering.

Point List-Unsubscribe at a mailto address

Both examples below send with Nodemailer. The first one gives the List-Unsubscribe header a mailto address and an HTTPS URL, so the client can take either route.

const info = await transporter.sendMail({
	from: '"My Newsletter" <newsletter[at]yourdomain.com>',
	to: "subscriber[at]example.com",
	subject: "Your Weekly Update",
	text: "Here is your update!",
	html: "<p>Here is your update!</p>",
 
	// Special headers
	headers: {
		"List-Unsubscribe":
			"<mailto:unsubscribe[at]yourdomain.com>, <https://yourdomain.com/unsubscribe>",
		"List-ID": "weekly-updates.yourdomain.com",
		Precedence: "bulk",
	},
});

When a recipient clicks the unsubscribe link, an unsubscribe request will be emailed to the email address you've provided.

Point List-Unsubscribe at a URL instead

Drop the mailto value when every opt-out should land in your own web flow.

const info = await transporter.sendMail({
	from: '"My Newsletter" <newsletter[at]yourdomain.com>',
	to: "subscriber[at]example.com",
	subject: "Your Weekly Update",
	text: "Here is your update!",
	html: "<p>Here is your update!</p>",
 
	// Special headers
	headers: {
		"List-Unsubscribe": "<https://yourdomain.com/unsubscribe>",
		"List-ID": "weekly-updates.yourdomain.com",
		Precedence: "bulk",
	},
});

When a recipient clicks the unsubscribe link, the user will be redirected to the provided URL where the rest of the flow will continue.

By using these headers correctly, email senders improve engagement, while users get a cleaner, more manageable inbox.

Join My Newsletter

Occasional notes on software, tools, and things I learn. No spam.

Unsubscribe anytime.

Continue Reading

  • Stop tuning everything. pgvector has three knobs that matter.Aug 18, 2026
  • Your agent's knowledge base is lying to you. Run these 14 checks.Aug 18, 2026
  • Your agent's knowledge base is rotting in 14 waysAug 17, 2026
  • Claude watermarks its text now. Here's how, and what it can't do.Aug 16, 2026
  • HNSW or IVFFlat? Choosing and building your pgvector indexAug 14, 2026