fix: improve tracking pixel HTML attributes for anti-spam compliance#3136
Merged
Conversation
Replace the bare <img src="..." alt="" /> tracking pixel with a standardized 1x1 invisible pixel that includes explicit dimensions and CSS visibility properties. Before: <img src="..." alt="" /> After: <img src="..." width="1" height="1" style="display:none;max-height:0;max-width:0;opacity:0" alt=""> Benefits: - Explicit width/height="1" satisfies HTML validators and email clients that expect dimensional attributes for tracking pixels - CSS style properties (display:none, max-height/width:0, opacity:0) provide redundant hiding across different email clients - Better compatibility with strict anti-spam filters that flag pixels without proper size attributes - Follows common best practices used by major ESPs (Mailchimp, SendGrid, etc.)
The drawTransparentImage call was using hardcoded non-standard dimensions (width=14, height=3) for the tracking pixel PNG served at /px.png. Change to the canonical 1x1 transparent PNG, which is the industry standard used by all major ESPs (Mailchimp, SendGrid, etc.). This is backward-compatible: the pixel URL in already-sent emails (/campaign/:campUUID/:subUUID/px.png) does not encode image dimensions — only UUIDs. The server-side tracking logic is unchanged; only the binary payload of the PNG response is smaller and correct.
shustovTE
added a commit
to shustovTE/listmonk
that referenced
this pull request
Jul 8, 2026
- cmd/public.go: change drawTransparentImage(3, 14) → drawTransparentImage(1, 1) Tracking pixel PNG was being generated with non-standard 14×3 dimensions. Changed to the canonical 1×1 transparent PNG (industry standard). - internal/manager/manager.go: add width/height/style to TrackView img tag The generated <img> tag lacked explicit width="1" height="1" and display:none style, which caused some email clients to request a full-size image placeholder and show a broken image icon. This is the fix backported to v6.2.0 for the custom v6.2.1 release. See upstream PR knadh#3136.
shustovTE
added a commit
to shustovTE/listmonk
that referenced
this pull request
Jul 8, 2026
release: v6.2.1 — fix tracking pixel (backport from upstream PR knadh#3136)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The current tracking pixel is rendered as a bare
<img>tag without explicit size attributes:This can trigger stricter anti-spam filters that look for tracking pixels without proper dimensional attributes, and doesn't follow best practices used by major ESPs.
Solution
Replace with a fully-attributed 1×1 invisible pixel:
Benefits
width="1" height="1"— explicit HTML dimensions satisfy email client validators and prevent the image from being rendered as a broken/empty image in some clientsdisplay:none— hides the pixel in all modern email clients that support CSSmax-height:0;max-width:0— redundant hiding for clients that partially support CSS (e.g. older Outlook)opacity:0— additional layer of invisibility for clients that may ignoredisplay:noneChanged file
internal/manager/manager.go—TrackViewtemplate function