Skip to content

feat: preserve List-* headers (List-ID, List-Help, List-Post, List-Subscribe, List-Owner, List-Archive) when forwarding emails - #904

Open
lenucksi wants to merge 1 commit into
anonaddy:masterfrom
lenucksi:fix/preserve-list-id-header
Open

lenucksi wants to merge 1 commit into
anonaddy:masterfrom
lenucksi:fix/preserve-list-id-header

Conversation

@lenucksi

@lenucksi lenucksi commented Jul 8, 2026

Copy link
Copy Markdown

Problem

addy.io builds a brand-new Symfony\Component\Mime\Email when forwarding. The List-* family of headers (RFC 2919) was never extracted from the incoming email, so the forwarded mail arrives without them. Downstream services (NewsBlur, Sieve filters, spam-reporting tools) that rely on List-ID to identify and group mailing-list emails cannot do so.

List-ID (RFC 2919) is the standard header for identifying a mailing list. Unlike List-Unsubscribe (which addy.io already forwards and rewrites), List-ID is purely informational — it identifies which list the message belongs to, regardless of who the individual sender is. The remaining List-* headers (List-Help, List-Post, List-Subscribe, List-Owner, List-Archive) are equally safe metadata.

Changes

app/Models/EmailData.php

  • Add $listId, $listHelp, $listPost, $listSubscribe, $listOwner, $listArchive properties
  • Parse each from the incoming email via $parser->getHeader()

app/Mail/ForwardEmail.php

  • Add corresponding properties
  • Store from $emailData in the constructor
  • Forward in build() in a small loop — only when the header value is present

tests/emails/email_list_id.eml

  • New test fixture with all six List-* headers present

tests/Feature/ReceiveEmailTest.php

  • New test it_can_forward_email_with_list_headers verifying every List-* header is present on the forwarded message with the correct value

Test plan

  1. php artisan test --filter=it_can_forward_email_with_list_headers
  2. All 349 existing tests must still pass

Closes: #905
Refs: #230

@lenucksi lenucksi changed the title test feat: preserve List-* headers (List-ID, List-Help, List-Post, List-Subscribe, List-Owner, List-Archive) when forwarding emails Jul 8, 2026
@lenucksi
lenucksi force-pushed the fix/preserve-list-id-header branch from 1305eff to 0ae5978 Compare July 8, 2026 12:24
…bscribe, List-Owner, List-Archive) when forwarding emails

addyo builds a brand-new Symfony Mime Email when forwarding. The List-*
family of headers (RFC 2919) was never extracted from the incoming email,
so forwarded mail arrived without them. Downstream services that rely on
List-ID to identify and group mailing-list emails (NewsBlur, Sieve filters,
etc.) could not function correctly.

Changes:
- EmailData: add listId, listHelp, listPost, listSubscribe, listOwner,
  listArchive properties and parse from incoming email
- ForwardEmail: store List-* data from EmailData, forward as headers
  in build() when present
- Tests: new email_list_id.eml fixture + test verifying all List-*
  headers are present on the forwarded message

Refs: anonaddy#230 (partial)
@lenucksi
lenucksi force-pushed the fix/preserve-list-id-header branch from 0ae5978 to c0fb1c0 Compare July 8, 2026 13:28
@beedell-roke

Copy link
Copy Markdown

@lenucksi, I'm quite confident that this was authored by an LLM, so best to disclose that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

List-* headers (List-ID, List-Help, List-Post, List-Subscribe, List-Owner, List-Archive) stripped when forwarding emails

2 participants