Skip to content

SOGo - URLs for embedded images in emails have "localhost" domainย #7008

@SpikedCola

Description

@SpikedCola

Contribution guidelines

Checklist prior issue creation

  • I understand that failure to follow below instructions may cause this issue to be closed.
  • I understand that vague, incomplete or inaccurate information may cause this issue to be closed.
  • I understand that this form is intended solely for reporting software bugs and not for support-related inquiries.
  • I understand that all responses are voluntary and community-driven, and do not constitute commercial support.
  • I confirm that I have reviewed previous issues to ensure this matter has not already been addressed.
  • I confirm that my environment meets all prerequisite requirements as specified in the official documentation.

Description

I am running SOGo inside a Docker container with a reverse proxy on the host. I have noticed an inconsistency in how SOGo generates URLs for email images. This could be a misconfiguration on my part, but since everything else is working as expected I am not sure.

Standard file attachments work just fine and can be viewed and downloaded. However, embedded images that are pasted into the compose window (from Gmail) appear broken.

Image

Looking at the markup for the email, it is clear that the problem is the embedded image has been generated with a url including the domain and port "localhost:800", while the attachment view/save links all have urls that begin with "/".

<div class="SOGoHTMLMail-CSS-Delimiter mailer_htmlcontent">
  <div dir="ltr">
    here is what I see:
    <div><br></div>
    <div>
      <img src="http://localhost:800/SOGo/so/support@XXXXXXXX.com/Mail/0/folderINBOX/4/1/2/image.png" 
           alt="image.png" width="441" height="489">
      <br>
    </div>
  </div>
</div>

<md-dialog-actions>
  <a class="..." href="/SOGo/so/support@XXXXXXXX.com/Mail/0/folderINBOX/4/2/$_12.jpg" target="_blank">
    <md-icon>open_in_new</md-icon>
  </a>
</md-dialog-actions>

Steps to reproduce:

  1. Compose an email with an embedded image, by pasting an image in. I don't think is is a Gmail-specific problem, but my test was done in Gmail.
  2. Attach a different image to the email
  3. View the email in SOGo
  4. See that the embedded image does not work, but the attached image does

Logs:

Jan 16 14:45:31 8a62f77a5aab sogod [86]: mailcowdockerized-watchdog-mailcow-1.mailcowdockerized_mailcow-network "GET /SOGo.index/ HTTP/1.1" 200 2581/0 0.003 - - 0 - 13
Jan 16 14:45:53 8a62f77a5aab sogod [86]: mailcowdockerized-watchdog-mailcow-1.mailcowdockerized_mailcow-network "GET /SOGo.index/ HTTP/1.1" 200 2581/0 0.003 - - 0 - 13
Jan 16 14:47:11 8a62f77a5aab sogod [86]: mailcowdockerized-watchdog-mailcow-1.mailcowdockerized_mailcow-network "GET /SOGo.index/ HTTP/1.1" 200 2581/0 0.005 - - 0 - 12
Jan 16 14:47:24 8a62f77a5aab sogod [86]: XX.XX.XX.XX "GET /SOGo/so/support@XXXX.com/Mail/0/folderINBOX/4/2/$_12.jpg HTTP/1.0" 304 96/0 0.079 - - 0 - 13
Jan 16 14:47:26 8a62f77a5aab sogod [86]: XX.XX.XX.XX "POST /SOGo/so/support@XXXX.com/Mail/0/folderINBOX/expunge HTTP/1.0" 200 52/0 0.059 - - 0 - 13
Jan 16 14:47:27 8a62f77a5aab sogod [86]: XX.XX.XX.XX "GET /SOGo/so/support@XXXX.com/Mail/0/folderINBOX/4/2/asAttachment/$_12.jpg HTTP/1.0" 200 27009/0 0.044 - - 0 - 13
Jan 16 14:47:40 8a62f77a5aab sogod [86]: mailcowdockerized-watchdog-mailcow-1.mailcowdockerized_mailcow-network "GET /SOGo.index/ HTTP/1.1" 200 2581/0 0.007 - - 0 - 12
Jan 16 14:48:30 8a62f77a5aab sogod [86]: mailcowdockerized-watchdog-mailcow-1.mailcowdockerized_mailcow-network "GET /SOGo.index/ HTTP/1.1" 200 2581/0 0.006 - - 0 - 12
Jan 16 14:49:11 8a62f77a5aab sogod [86]: mailcowdockerized-watchdog-mailcow-1.mailcowdockerized_mailcow-network "GET /SOGo.index/ HTTP/1.1" 200 2581/0 0.008 - - 0 - 12
Jan 16 14:50:26 8a62f77a5aab sogod [86]: mailcowdockerized-watchdog-mailcow-1.mailcowdockerized_mailcow-network "GET /SOGo.index/ HTTP/1.1" 200 2581/0 0.003 - - 0 - 12

Which branch are you using?

master (stable)

Which architecture are you using?

x86_64

Operating System:

Ubuntu 24.04 LTS

Server/VM specifications:

Intel W-2145 8c/16t, 256GB RAM

Is Apparmor, SELinux or similar active?

No

Virtualization technology:

None

Docker version:

26.1.4

docker-compose version or docker compose version:

v2.27.1

mailcow version:

2025-12a

Reverse proxy:

Apache

Logs of git diff:


Logs of iptables -L -vn:

n/a

Logs of ip6tables -L -vn:

n/a

Logs of iptables -L -vn -t nat:

n/a

Logs of ip6tables -L -vn -t nat:

n/a

DNS check:

198.252.206.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions