Email List-Unsubscribe Header?

How can I add the List-Unsubscribe header when I send emails?

I tried the below, but it didn’t work.

Email.send({
  ...,
  headers: {
    'List-Unsubscribe': `<${Meteor.absoluteUrl('unsubscribe')}>`,
  },
};

This is a difficult topic to search for since searching for unsubscribe and Meteor usually leads to collection related information

Can you paste the headers you received in a reply?
Are you getting any output in the logs?

I just tested adding that header in meteor shell and it worked fine

Email.send({
	to: 'fred@foo.com.au',
	from: 'fred@foo.com.au',
	subject: 'test',
	text: 'test',
	headers: {
		'List-Unsubscribe': `<${Meteor.absoluteUrl('unsubscribe')}>`
	}
});

And received this:

email headers
From 0@xxx 2017-06-18 23:21:47 +0000
Return-Path: <fred@foo.com.au>
Delivered-To: fred@foo.com.au
Received: from DIR-03 ([10.20.147.193])
	by IMAP-26 (Dovecot) with LMTP id S2oQAQoLR1ngHwAAYYZmRw
	for <fred@foo.com.au>; Sun, 18 Jun 2017 19:21:46 -0400
Received: from MTA-05.privateemail.com ([10.20.147.15])
	by DIR-03 (Dovecot) with LMTP id O8zjHAoLR1mTRAAAtNLlyA
	; Sun, 18 Jun 2017 19:21:46 -0400
Received: from Nimisha.local (unknown [10.20.151.245])
	by MTA-05.privateemail.com (Postfix) with ESMTPA id D0CAF60048
	for <fred@foo.com.au>; Sun, 18 Jun 2017 23:21:45 +0000 (UTC)
Content-Type: text/plain
List-Unsubscribe: <http://localhost:3000/unsubscribe>
From: fred@foo.com.au
To: fred@foo.com.au
Subject: test
Message-ID: <02876f64-04f9-093c-68f1-9c4b27d98efb@foo.com.au>
Content-Transfer-Encoding: 7bit
Date: Sun, 18 Jun 2017 23:21:44 +0000
MIME-Version: 1.0

test

Where can I see the headers?

I tested by sending it to Gmail and was expecting an unsubscribe link to appear as highlighted in the image below but nothing showed. And when I click the little arrow next to “me,” it also doesn’t show up.

You can find the headers on gmail using the dropdown here:

Also having a quick google I found that on Gmail “only senders with good reputations will see the functionality” and they prefer the mailto: method for List-Unsubscribe headers. Even if they don’t display the button, they still want you to have the header.
Microsoft will only use the mailto: method but will display the unsubscribe functionality for anyone that includes the header.

Thank you. So it must be the sender reputation since I’m using my own domain and it is new.

Though I’m confused why only good senders would have that? Wouldn’t you especially want bad senders to have it?

I guess the link could be anything and so a bad sender would use it for more spam.

Good question. I have no idea