Skip to content

Update MTA-STS

Update MTA-STS #5

name: Daily MTA-STS Update
on:
schedule:
- cron: '0 0 * * *' # Runs every day at midnight UTC
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
update-mta-sts:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: Fetch MTA-STS Policy
run: |
curl -s https://mta-sts.protonmail.com/.well-known/mta-sts.txt > .well-known/mta-sts.txt
- name: Replace `max_age` and `mode` values (Testing)
run: |
# Replace max_age with 86400
sed -i 's/^max_age: .*/max_age: 86400/' .well-known/mta-sts.txt
# Replace mode with testing
sed -i 's/^mode: .*/mode: testing/' .well-known/mta-sts.txt
- name: Commit and push updated file
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "[email protected]."
git add .well-known/mta-sts.txt
git commit -m "Update MTA-STS policy on $(date +'%Y-%m-%d')"
git push