[GH-ISSUE #441] mailpit.svg file not found when webroot is set #283

Closed
opened 2026-03-15 13:40:49 +03:00 by kerem · 7 comments
Owner

Originally created by @Lyrkan on GitHub (Feb 12, 2025).
Original GitHub issue: https://github.com/axllent/mailpit/issues/441

Hi there,

Since version 1.22.2 it seems that the mailpit.svg file cannot be loaded when using a webroot.

Using v1.22.2 without a webroot:

services:
  mailpit:
    image: axllent/mailpit:v1.22.2
    ports:
      - '8025:8025'
$ curl http://127.0.0.1:8025/mailpit.svg
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   width="500"
   height="460"
(...)

Using v1.22.2 with a webroot:

services:
  mailpit:
    image: axllent/mailpit:v1.22.2
    ports:
      - '8025:8025'
    environment:
      MP_WEBROOT: '/mailpit/'
$ curl http://127.0.0.1:8025/mailpit/mailpit.svg
File not found

Using v1.22.1 with a webroot:

services:
  mailpit:
    image: axllent/mailpit:v1.22.1
    ports:
      - '8025:8025'
    environment:
      MP_WEBROOT: '/mailpit/'
$ curl http://127.0.0.1:8025/mailpit/mailpit.svg
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   width="500"
   height="460"
(...)
Originally created by @Lyrkan on GitHub (Feb 12, 2025). Original GitHub issue: https://github.com/axllent/mailpit/issues/441 Hi there, Since version 1.22.2 it seems that the mailpit.svg file cannot be loaded when using a webroot. **Using v1.22.2 without a webroot:** ``` services: mailpit: image: axllent/mailpit:v1.22.2 ports: - '8025:8025' ``` ``` $ curl http://127.0.0.1:8025/mailpit.svg <?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg width="500" height="460" (...) ``` **Using v1.22.2 with a webroot:** ``` services: mailpit: image: axllent/mailpit:v1.22.2 ports: - '8025:8025' environment: MP_WEBROOT: '/mailpit/' ``` ``` $ curl http://127.0.0.1:8025/mailpit/mailpit.svg File not found ``` **Using v1.22.1 with a webroot:** ``` services: mailpit: image: axllent/mailpit:v1.22.1 ports: - '8025:8025' environment: MP_WEBROOT: '/mailpit/' ``` ``` $ curl http://127.0.0.1:8025/mailpit/mailpit.svg <?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg width="500" height="460" (...) ```
kerem closed this issue 2026-03-15 13:40:54 +03:00
Author
Owner

@NADEE-MJ commented on GitHub (Feb 12, 2025):

I was seeing this as well when using the binary. Installed via the installer on Ubuntu and also generated the binary from the go code using the guide and same result.

<!-- gh-comment-id:2654155853 --> @NADEE-MJ commented on GitHub (Feb 12, 2025): I was seeing this as well when using the binary. Installed via the installer on Ubuntu and also generated the binary from the go code using the guide and same result.
Author
Owner

@axllent commented on GitHub (Feb 12, 2025):

Sounds like a bug. Thanks for reporting, I'll look into this soon.

<!-- gh-comment-id:2654519908 --> @axllent commented on GitHub (Feb 12, 2025): Sounds like a bug. Thanks for reporting, I'll look into this soon.
Author
Owner

@axllent commented on GitHub (Feb 13, 2025):

I found the issue, which was caused in this case by the fact that both your webroot and the filename start with "mailpit"... It was "trimming" /mailpit off the virtual path to the file, however it did it multiple times, so /mailpit/mailpit.svg became just .svg 🤦

I have pushed a fix for this, however it hasn't yet been released as I try not release new versions too often (package maintainers get grumpy when I create extra work for them). Is this bug affecting just you, or is it impacting a wider audience (part of a larger Mailpit implementation)?

<!-- gh-comment-id:2655426609 --> @axllent commented on GitHub (Feb 13, 2025): I found the issue, which was caused in this case by the fact that both your webroot and the filename start with "mailpit"... It was "trimming" `/mailpit` off the virtual path to the file, however it did it multiple times, so `/mailpit/mailpit.svg` became just `.svg` 🤦 I have pushed a fix for this, however it hasn't yet been released as I try not release new versions too often (package maintainers get grumpy when I create extra work for them). Is this bug affecting just you, or is it impacting a wider audience (part of a larger Mailpit implementation)?
Author
Owner

@NADEE-MJ commented on GitHub (Feb 13, 2025):

Just a heads up I was seeing the same issue with web root set to mail. Not sure if the fix will work for that case as well. The app is still fully usable just an annoying 404.

<!-- gh-comment-id:2655429236 --> @NADEE-MJ commented on GitHub (Feb 13, 2025): Just a heads up I was seeing the same issue with web root set to mail. Not sure if the fix will work for that case as well. The app is still fully usable just an annoying 404.
Author
Owner

@axllent commented on GitHub (Feb 13, 2025):

Yes, /mail/mailpit.svg would have resulted in pit.svg. I can confirm that this is solved in the bugfix I pushed. My question (to you both) is how big is the impact of this bug for you? If it affects a larger audience then I can release a new version now, otherwise I will wait a couple more days (weekend).

<!-- gh-comment-id:2655448444 --> @axllent commented on GitHub (Feb 13, 2025): Yes, `/mail/mailpit.svg` would have resulted in `pit.svg`. I can confirm that this is solved in the bugfix I pushed. My question (to you both) is how big is the impact of this bug for you? If it affects a larger audience then I can release a new version now, otherwise I will wait a couple more days (weekend).
Author
Owner

@Lyrkan commented on GitHub (Feb 13, 2025):

I have pushed a fix for this, however it hasn't yet been released as I try not release new versions too often (package maintainers get grumpy when I create extra work for them). Is this bug affecting just you, or is it impacting a wider audience (part of a larger Mailpit implementation)?

It can wait, don't worry :)

<!-- gh-comment-id:2655958121 --> @Lyrkan commented on GitHub (Feb 13, 2025): > I have pushed a fix for this, however it hasn't yet been released as I try not release new versions too often (package maintainers get grumpy when I create extra work for them). Is this bug affecting just you, or is it impacting a wider audience (part of a larger Mailpit implementation)? It can wait, don't worry :)
Author
Owner

@axllent commented on GitHub (Feb 15, 2025):

This fix has now been released in v1.22.3. Thanks for reporting the issue!

<!-- gh-comment-id:2661098730 --> @axllent commented on GitHub (Feb 15, 2025): This fix has now been released in [v1.22.3](https://github.com/axllent/mailpit/releases/tag/v1.22.3). Thanks for reporting the issue!
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
starred/mailpit#283
No description provided.