Skip to content

BUG: strings.Replace instead of ReplaceAll for inline images in sendEmail #862

@andrinoff

Description

@andrinoff

Describe the bug

In sendEmail() (main.go:2236), strings.Replace(body, imgPath, "cid:"+cid, 1) only replaces the first occurrence of an image path. If the same image is referenced multiple times in the email body, subsequent occurrences won't be replaced with the correct CID, resulting in broken image references.

To reproduce

  1. Compose an email with the same image referenced twice in the body
  2. Send the email
  3. Second image reference remains as file path instead of CID

Expected behavior

Use strings.ReplaceAll() to replace all occurrences of the image path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomersneeds-responseWaiting on issue author replystaleNo activity for extended period

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions