{"id":13462979,"url":"https://github.com/sj26/mailcatcher","last_synced_at":"2025-05-14T22:05:38.610Z","repository":{"id":38375089,"uuid":"1021040","full_name":"sj26/mailcatcher","owner":"sj26","description":"Catches mail and serves it through a dream.","archived":false,"fork":false,"pushed_at":"2024-05-25T04:47:59.000Z","size":942,"stargazers_count":6616,"open_issues_count":43,"forks_count":591,"subscribers_count":81,"default_branch":"main","last_synced_at":"2025-05-14T22:04:52.431Z","etag":null,"topics":["development","devtools","mail","rails","ruby","rubygems","server","smtp"],"latest_commit_sha":null,"homepage":"http://mailcatcher.me","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sj26.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-10-25T01:29:06.000Z","updated_at":"2025-05-13T06:25:21.000Z","dependencies_parsed_at":"2022-07-12T01:47:26.519Z","dependency_job_id":"1882e55b-cebf-42c8-bccf-18d6414b45b3","html_url":"https://github.com/sj26/mailcatcher","commit_stats":{"total_commits":517,"total_committers":59,"mean_commits":8.76271186440678,"dds":"0.17601547388781436","last_synced_commit":"fbe811a53aeabe75b6e728b87f7f4c8fbf4b4843"},"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sj26%2Fmailcatcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sj26%2Fmailcatcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sj26%2Fmailcatcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sj26%2Fmailcatcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sj26","download_url":"https://codeload.github.com/sj26/mailcatcher/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235687,"owners_count":22036962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["development","devtools","mail","rails","ruby","rubygems","server","smtp"],"created_at":"2024-07-31T13:00:43.170Z","updated_at":"2025-05-14T22:05:38.426Z","avatar_url":"https://github.com/sj26.png","language":"Ruby","readme":"# MailCatcher\n\nCatches mail and serves it through a dream.\n\nMailCatcher runs a super simple SMTP server which catches any message sent to it to display in a web interface. Run mailcatcher, set your favourite app to deliver to smtp://127.0.0.1:1025 instead of your default SMTP server, then check out http://127.0.0.1:1080 to see the mail that's arrived so far.\n\n![MailCatcher screenshot](https://cloud.githubusercontent.com/assets/14028/14093249/4100f904-f598-11e5-936b-e6a396f18e39.png)\n\n## Features\n\n* Catches all mail and stores it for display.\n* Shows HTML, Plain Text and Source version of messages, as applicable.\n* Rewrites HTML enabling display of embedded, inline images/etc and opens links in a new window.\n* Lists attachments and allows separate downloading of parts.\n* Download original email to view in your native mail client(s).\n* Command line options to override the default SMTP/HTTP IP and port settings.\n* Mail appears instantly if your browser supports [WebSockets][websockets], otherwise updates every thirty seconds.\n* Runs as a daemon in the background, optionally in foreground.\n* Sendmail-analogue command, `catchmail`, makes using mailcatcher from PHP a lot easier.\n* Keyboard navigation between messages\n\n## How\n\n1. `gem install mailcatcher`\n2. `mailcatcher`\n3. Go to http://127.0.0.1:1080/\n4. Send mail through smtp://127.0.0.1:1025\n\n### Command Line Options\n\nUse `mailcatcher --help` to see the command line options.\n\n```\nUsage: mailcatcher [options]\n\nMailCatcher v0.8.0\n\n        --ip IP                      Set the ip address of both servers\n        --smtp-ip IP                 Set the ip address of the smtp server\n        --smtp-port PORT             Set the port of the smtp server\n        --http-ip IP                 Set the ip address of the http server\n        --http-port PORT             Set the port address of the http server\n        --messages-limit COUNT       Only keep up to COUNT most recent messages\n        --http-path PATH             Add a prefix to all HTTP paths\n        --no-quit                    Don't allow quitting the process\n    -f, --foreground                 Run in the foreground\n    -b, --browse                     Open web browser\n    -v, --verbose                    Be more verbose\n    -h, --help                       Display this help information\n        --version                    Display the current version\n```\n\n### Upgrading\n\nUpgrading works the same as installation:\n\n```\ngem install mailcatcher\n```\n\n### Ruby\n\nIf you have trouble with the setup commands, make sure you have [Ruby installed](https://www.ruby-lang.org/en/documentation/installation/):\n\n```\nruby -v\ngem environment\n```\n\nYou might need to install build tools for some of the gem dependencies. On Debian or Ubuntu, `apt install build-essential`. On macOS, `xcode-select --install`.\n\nIf you encounter issues installing [thin](https://rubygems.org/gems/thin), try:\n\n```\ngem install thin -v 1.5.1 -- --with-cflags=\"-Wno-error=implicit-function-declaration\"\n```\n\n### Bundler\n\nPlease don't put mailcatcher into your Gemfile. It will conflict with your application's gems at some point.\n\nInstead, pop a note in your README stating you use mailcatcher, and to run `gem install mailcatcher` then `mailcatcher` to get started.\n\n### RVM\n\nUnder RVM your mailcatcher command may only be available under the ruby you install mailcatcher into. To prevent this, and to prevent gem conflicts, install mailcatcher into a dedicated gemset with a wrapper script:\n\n    rvm default@mailcatcher --create do gem install mailcatcher\n    ln -s \"$(rvm default@mailcatcher do rvm wrapper show mailcatcher)\" \"$rvm_bin_path/\"\n\n### Rails\n\nTo set up your rails app, I recommend adding this to your `environments/development.rb`:\n\n    config.action_mailer.delivery_method = :smtp\n    config.action_mailer.smtp_settings = { :address =\u003e '127.0.0.1', :port =\u003e 1025 }\n    config.action_mailer.raise_delivery_errors = false\n\n### PHP\n\nFor projects using PHP, or PHP frameworks and application platforms like Drupal, you can set [PHP's mail configuration](https://www.php.net/manual/en/mail.configuration.php) in your [php.ini](https://www.php.net/manual/en/configuration.file.php) to send via MailCatcher with:\n\n    sendmail_path = /usr/bin/env catchmail -f some@from.address\n\nYou can do this in your [Apache configuration](https://www.php.net/manual/en/configuration.changes.php) like so:\n\n    php_admin_value sendmail_path \"/usr/bin/env catchmail -f some@from.address\"\n\nIf you've installed via RVM this probably won't work unless you've manually added your RVM bin paths to your system environment's PATH. In that case, run `which catchmail` and put that path into the `sendmail_path` directive above instead of `/usr/bin/env catchmail`.\n\nIf starting `mailcatcher` on alternative SMTP IP and/or port with parameters like `--smtp-ip 192.168.0.1 --smtp-port 10025`, add the same parameters to your `catchmail` command:\n\n    sendmail_path = /usr/bin/env catchmail --smtp-ip 192.160.0.1 --smtp-port 10025 -f some@from.address\n\n### Django\n\nFor use in Django, add the following configuration to your projects' settings.py\n\n```python\nif DEBUG:\n    EMAIL_HOST = '127.0.0.1'\n    EMAIL_HOST_USER = ''\n    EMAIL_HOST_PASSWORD = ''\n    EMAIL_PORT = 1025\n    EMAIL_USE_TLS = False\n```\n\n### Docker\n\nThere is a Docker image available [on Docker Hub](https://hub.docker.com/r/sj26/mailcatcher):\n\n```\n$ docker run -p 1080 -p 1025 sj26/mailcatcher\nUnable to find image 'sj26/mailcatcher:latest' locally\nlatest: Pulling from sj26/mailcatcher\n8c6d1654570f: Already exists\nf5649d186f41: Already exists\nb850834ea1df: Already exists\nd6ac1a07fd46: Pull complete\nb609298bc3c9: Pull complete\nab05825ece51: Pull complete\nDigest: sha256:b17c45de08a0a82b012d90d4bd048620952c475f5655c61eef373318de6c0855\nStatus: Downloaded newer image for sj26/mailcatcher:latest\nStarting MailCatcher v0.9.0\n==\u003e smtp://0.0.0.0:1025\n==\u003e http://0.0.0.0:1080\n```\n\nHow those ports appear and can be accessed may vary based on your Docker configuration. For example, your may need to use `http://127.0.0.1:1080` etc instead of the listed address. But MailCatcher will run and listen to those ports on all IPs it can from within the Docker container.\n\n### API\n\nA fairly RESTful URL schema means you can download a list of messages in JSON from `/messages`, each message's metadata with `/messages/:id.json`, and then the pertinent parts with `/messages/:id.html` and `/messages/:id.plain` for the default HTML and plain text version, `/messages/:id/parts/:cid` for individual attachments by CID, or the whole message with `/messages/:id.source`.\n\n## Caveats\n\n* Mail processing is fairly basic but easily modified. If something doesn't work for you, fork and fix it or [file an issue][mailcatcher-issues] and let me know. Include the whole message you're having problems with.\n* Encodings are difficult. MailCatcher does not completely support utf-8 straight over the wire, you must use a mail library which encodes things properly based on SMTP server capabilities.\n\n## Thanks\n\nMailCatcher is just a mishmash of other people's hard work. Thank you so much to the people who have built the wonderful guts on which this project relies.\n\n## Donations\n\nI work on MailCatcher mostly in my own spare time. If you've found Mailcatcher useful and would like to help feed me and fund continued development and new features, please [donate via PayPal][donate]. If you'd like a specific feature added to MailCatcher and are willing to pay for it, please [email me](mailto:sj26@sj26.com).\n\n## License\n\nCopyright © 2010-2019 Samuel Cochran (sj26@sj26.com). Released under the MIT License, see [LICENSE][license] for details.\n\n  [donate]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=522WUPLRWUSKE\n  [license]: https://github.com/sj26/mailcatcher/blob/master/LICENSE\n  [mailcatcher-github]: https://github.com/sj26/mailcatcher\n  [mailcatcher-issues]: https://github.com/sj26/mailcatcher/issues\n  [websockets]: https://tools.ietf.org/html/rfc6455\n","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=522WUPLRWUSKE"],"categories":["Communication","Configuration","Web应用","Ruby","server","Web应用 Web Applications","配置 Configuration","Email Testing","Web Applications","development","Apps","Web Tools","Web 应用程序(Web Applications)"],"sub_categories":["E-Mail Preview","Web Applications","Web应用程序 Web Applications","Mail"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsj26%2Fmailcatcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsj26%2Fmailcatcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsj26%2Fmailcatcher/lists"}