[GH-ISSUE #6030] Sub: node-hosted inbounds don't expand remark template for client email #4175

Closed
opened 2026-10-31 20:37:44 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @acidmsg on GitHub (Jul 18, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6030

Description

In a multi-node setup, the remark template {{INBOUND}}_{{EMAIL}} is applied correctly for master-hosted inbound links, but node-hosted inbound links only show the inbound name without the client email.

Steps to reproduce

  1. Master + node, both on v3.5.0
  2. subEmailInRemark: true, template includes {{EMAIL}}
  3. Client attached to inbounds on both master and node
  4. Fetch subscription

Current behavior

Master: InboundName_ClientEmail
Node:   InboundName

Expected behavior

Master: InboundName_ClientEmail
Node:   InboundName_ClientEmail

Environment

  • 3x-ui v3.5.0
  • Master + 1 node
Originally created by @acidmsg on GitHub (Jul 18, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6030 ## Description In a multi-node setup, the remark template `{{INBOUND}}_{{EMAIL}}` is applied correctly for master-hosted inbound links, but node-hosted inbound links only show the inbound name without the client email. ## Steps to reproduce 1. Master + node, both on v3.5.0 2. `subEmailInRemark: true`, template includes `{{EMAIL}}` 3. Client attached to inbounds on both master and node 4. Fetch subscription ## Current behavior ``` Master: InboundName_ClientEmail Node: InboundName ``` ## Expected behavior ``` Master: InboundName_ClientEmail Node: InboundName_ClientEmail ``` ## Environment - 3x-ui v3.5.0 - Master + 1 node
bsakaguchi 2026-10-31 20:37:44 +07:00
  • closed this issue
  • added the
    duplicate
    label
Author
Owner

@github-actions[bot] commented on GitHub (Jul 18, 2026):

This is a duplicate of #6029, which was filed and closed with a detailed root-cause analysis a few minutes before this issue was opened (the report content is essentially identical).

Summary, independently re-verified here in internal/sub/remark_vars.go: {{EMAIL}}/{{USERNAME}} are deliberately emitted only on a client's first link within a subscription response. firstLinkOnlyBodyTokens (internal/sub/remark_vars.go:484-491) lists them alongside the usage tokens as stripped from every later link, and effectiveTemplate (internal/sub/remark_vars.go:557-567) tracks this per client email via s.usageShown. This is confirmed by TestIdentityTokenBodyVsDisplay (internal/sub/remark_vars_test.go:377-397), which shows the email is dropped on a client's second link even when both links come from the same single inbound — the dedup is about link order within the subscription, not node-hosting.

It only looks node-specific because getInboundsBySubId (internal/sub/service.go:459-470) pulls every inbound attached to the subscription — master and node alike — ordered sub_sort_index ASC, id ASC, and one SubService instance generates all of them, sharing a single usageShown map. Whichever inbound sorts first for a client keeps {{EMAIL}}; every later one for that same client loses it, regardless of master vs. node.

Also worth noting: subEmailInRemark is not a setting that exists in this codebase (confirmed via search) — the actual mechanism is the free-form remarkTemplate setting with the {{EMAIL}} token, which this report is already using correctly.

Please continue any further discussion on #6029.

This reply was generated automatically by an AI agent. A maintainer may follow up.

<!-- gh-comment-id:5010533259 --> @github-actions[bot] commented on GitHub (Jul 18, 2026): This is a duplicate of #6029, which was filed and closed with a detailed root-cause analysis a few minutes before this issue was opened (the report content is essentially identical). Summary, independently re-verified here in `internal/sub/remark_vars.go`: `{{EMAIL}}`/`{{USERNAME}}` are deliberately emitted only on a client's *first* link within a subscription response. `firstLinkOnlyBodyTokens` (`internal/sub/remark_vars.go:484-491`) lists them alongside the usage tokens as stripped from every later link, and `effectiveTemplate` (`internal/sub/remark_vars.go:557-567`) tracks this per client email via `s.usageShown`. This is confirmed by `TestIdentityTokenBodyVsDisplay` (`internal/sub/remark_vars_test.go:377-397`), which shows the email is dropped on a client's *second* link even when both links come from the same single inbound — the dedup is about link order within the subscription, not node-hosting. It only looks node-specific because `getInboundsBySubId` (`internal/sub/service.go:459-470`) pulls every inbound attached to the subscription — master and node alike — ordered `sub_sort_index ASC, id ASC`, and one `SubService` instance generates all of them, sharing a single `usageShown` map. Whichever inbound sorts first for a client keeps `{{EMAIL}}`; every later one for that same client loses it, regardless of master vs. node. Also worth noting: `subEmailInRemark` is not a setting that exists in this codebase (confirmed via search) — the actual mechanism is the free-form `remarkTemplate` setting with the `{{EMAIL}}` token, which this report is already using correctly. Please continue any further discussion on #6029. *This reply was generated automatically by an AI agent. A maintainer may follow up.*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#4175
No description provided.