mailcatcher icon indicating copy to clipboard operation
mailcatcher copied to clipboard

MailCatcher UI not working in 0.10.0 (when installed via homebrew)

Open iamstuba opened this issue 1 year ago • 19 comments

Environment:

OS: macOS Sonoma 14.4.1 Ruby: 3.3.2 MailCatcher: 0.10.0 Browser: Google Chrome (125.0.6422.114) and Mozilla Firefox (126.0.1)

Screenshot 2024-06-04 at 11 32 39

The .js and .css files from /assets are resolving with an incorrect content-type of text/html, which prevents browsers from executing them.

This issue was not present in the 0.9.0 version of MailCatcher.

iamstuba avatar Jun 04 '24 09:06 iamstuba

Were you able to find a solution? (It's happening to me as well)

joshualip-plaudit avatar Jun 05 '24 16:06 joshualip-plaudit

Nope. Haven't ever written a line of Ruby, so don't really know how/where the headers are set. I'd hope/think that for anyone more familiar with Ruby and/or MailCatcher this'd be quite an easy fix.

iamstuba avatar Jun 05 '24 20:06 iamstuba

Same issue when installed via Homebrew for version 0.10.0

kilis avatar Jun 06 '24 07:06 kilis

@joshualip-plaudit @kilis, my current workaround is to just go to http://127.0.0.1:1080/messages/{X}.html where {X} is the id of the message I want to see. Not optimal, but at least I can work this way.

Wasn't able to install version 0.9.0 of MailCatcher via Homebrew for some reason.

iamstuba avatar Jun 10 '24 08:06 iamstuba

Hm, this is a weird one. And I can't replicate it -- for me they resolve with the correct content type:

image

including in Chrome:

image

sj26 avatar Jun 10 '24 22:06 sj26

mailcatcher --foreground
Starting MailCatcher v0.10.0
==> smtp://127.0.0.1:1025
==> http://127.0.0.1:1080

curl -I http://localhost:1080/assets/mailcatcher.js
HTTP/1.1 404 Not Found
X-Cascade: pass
Content-Type: text/html;charset=utf-8
Content-Length: 145
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Connection: keep-alive
Server: thin

Seems like my initial report was incorrect and the assets folder isn't even exposed. I've installed MailCatcher through Homebrew.

iamstuba avatar Jun 11 '24 08:06 iamstuba

I've installed MailCatcher through Homebrew.

Ah, interesting. Through the tap? That hasn’t been updated in a very long time.

https://github.com/sj26/homebrew-mailcatcher

sj26 avatar Jun 11 '24 23:06 sj26

Oh, there’s an official formula now!

https://github.com/Homebrew/homebrew-core/blob/95f7ea11c1fe7c4f65a81b5e09984cd392316bef/Formula/m/mailcatcher.rb

but it’s missing the step that compiles assets. That’s the issue.

sj26 avatar Jun 11 '24 23:06 sj26

Seems like the homebrew PR was automatically closed? 🤔

iamstuba avatar Jul 15 '24 09:07 iamstuba

Yeah. The formula is broken, but I don’t install with homebrew and don’t know how to fix it. Please help if you know how! 🙏

sj26 avatar Jul 15 '24 09:07 sj26

@sj26 I opened a discussion on the homebrew github page to discuss the proper way to fix the homebrew formula.

tldr; it seems like the easiest path forward would be to add a Gemfile.lock to the mailcatcher repo. Then the formula can simply install the released gem version from rubygems.

Any particular feelings about checking in a Gemfile.lock going forward? It seems kind of pointless to me, other than to satisfy the homebrew folks. Unfortunately it lightens the burden on maintaining the homebrew formula by shifting the burden to the mailcatcher repo.

james-caresnap avatar Aug 20 '24 16:08 james-caresnap

@sj26 any thoughts on the above?

james-caresnap avatar Sep 23 '24 19:09 james-caresnap

Somebody please fix this :)

hermanzamula avatar Nov 18 '24 10:11 hermanzamula

I don’t want to add a Gemfile.lock to mailcatcher. That’s an anti pattern for gems. Mailcatcher works with a range of versions. It pushes additional maintenance burden into this repo.

Resolving a set of compatible software versions is the job of the package manager, imho.

sj26 avatar Nov 28 '24 02:11 sj26

Hi, Anyone found a fix or a work around for this problem? I'm not finding a way to install an older version of mailcatcher

samirahellab avatar Jan 09 '25 14:01 samirahellab

My work around: use a docker container docker-compose.yml :

version: "3"
 
services:
  mailcatcher:
    restart: always
    image: dockage/mailcatcher:0.9.0
    ports:
    - "1080:1080"
    - "1025:1025"

Then run docker compose up -d

samirahellab avatar Jan 10 '25 14:01 samirahellab

Hi, Anyone found a fix or a work around for this problem? I'm not finding a way to install an older version of mailcatcher

I switched to Mailpit. I know that's not a work around for this repo, but I needed something.

chimmelb avatar Jan 25 '25 00:01 chimmelb

Yep. Just switch to Mailpit. It actually works!

joshualip-plaudit avatar Jan 28 '25 23:01 joshualip-plaudit

Same issue, I also switched to mailpit.

aydinkazim avatar May 08 '25 12:05 aydinkazim