Skip to content

Instantly share code, notes, and snippets.

@ran-deh
Forked from dotysan/mta-sts.js
Created September 19, 2022 21:21
Show Gist options
  • Save ran-deh/eab556048f3d813b20ed6b8299fa4af4 to your computer and use it in GitHub Desktop.
Save ran-deh/eab556048f3d813b20ed6b8299fa4af4 to your computer and use it in GitHub Desktop.
CloudFlare Worker for MTA-STS policy
const mode= 'testing';
//const mode= 'enforce';
const max_age= 604800; // 1 week
const mx_list = [
'aspmx.l.google.com'
,'aspmx2.googlemail.com'
,'aspmx3.googlemail.com'
,'aspmx4.googlemail.com'
,'aspmx5.googlemail.com'
,'alt1.aspmx.l.google.com'
,'alt2.aspmx.l.google.com'
];
const sts= `version: STSv1
mode: ${mode}
${mx_list.map(i=> 'mx: '+i).join('\n')}
max_age: ${max_age}`;
addEventListener('fetch', evt=> {
return evt.respondWith(new Response(sts));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment