Skip to content

Add List-Unsubscribe email headers for better deliverability and Gmail compliance #53

@kamsirichard

Description

@kamsirichard

Context

ScoutBot emails currently include an unsubscribe link in the footer (mailto: link). However, Gmail's bulk sender guidelines (effective Feb 2024) require one-click List-Unsubscribe headers for senders to more than 5,000 recipients per day.

Without these headers:

  • Gmail may route ScoutBot emails to Promotions or Spam
  • Bulk senders without headers face increased filtering from 2024 onwards

Task

Add standard List-Unsubscribe and List-Unsubscribe-Post headers to every outgoing digest email.

msg["List-Unsubscribe"]      = f"<mailto:{SENDER_EMAIL}?subject=Unsubscribe>"
msg["List-Unsubscribe-Post"] = "List-Unsubscribe=One-Click"

These go in _build_personal_email() in notify.py.

Stretch goal

Build a tiny unsubscribe endpoint so Gmail's one-click unsubscribe button works — clicking it in Gmail sends a POST request to a URL you control which removes the address from the sheet automatically. (Could be a minimal Flask app or a free serverless function.)

Files to touch

  • notify.py_build_personal_email()
  • Optionally: new unsubscribe.py or hosted endpoint

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is neededsecuritySecurity hardening or vulnerability fixes

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions