{"id":13880125,"url":"https://github.com/tpope/mta-settings","last_synced_at":"2025-04-26T12:30:43.999Z","repository":{"id":30627968,"uuid":"34183412","full_name":"tpope/mta-settings","owner":"tpope","description":"Configure ActionMailer or Mail delivery settings based on the environment","archived":false,"fork":false,"pushed_at":"2023-09-10T01:35:32.000Z","size":17,"stargazers_count":12,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-16T08:17:01.111Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/tpope.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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},"funding":{"github":"tpope"}},"created_at":"2015-04-18T21:27:11.000Z","updated_at":"2023-09-22T16:42:57.000Z","dependencies_parsed_at":"2024-11-11T01:30:09.900Z","dependency_job_id":"e132099d-a7fc-4042-b9c2-bb29595ae784","html_url":"https://github.com/tpope/mta-settings","commit_stats":{"total_commits":13,"total_committers":3,"mean_commits":4.333333333333333,"dds":0.3076923076923077,"last_synced_commit":"6fdc592606e1916201bfe49e9d7fe7a9dce7cd3a"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpope%2Fmta-settings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpope%2Fmta-settings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpope%2Fmta-settings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpope%2Fmta-settings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tpope","download_url":"https://codeload.github.com/tpope/mta-settings/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250986219,"owners_count":21518465,"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":[],"created_at":"2024-08-06T08:02:48.220Z","updated_at":"2025-04-26T12:30:43.752Z","avatar_url":"https://github.com/tpope.png","language":"Ruby","funding_links":["https://github.com/sponsors/tpope"],"categories":["Ruby"],"sub_categories":[],"readme":"# MTA Settings for Ruby\n\nThe `mta-settings` gem enables transparent MTA (mail transport agent)\nconfiguration from the environment for both [ActionMailer][] and [Mail][],\nbased on either an explicit `MTA_URL` variable or popular conventions for\nSendgrid, Mandrill, Postmark, and Mailgun (as provided by Heroku addons, for\nexample).\n\n[ActionMailer]: https://github.com/rails/rails/tree/master/actionmailer\n[Mail]: https://github.com/mikel/mail\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'mta-settings'\n\n### ActionMailer\n\nIf `mta-settings` is required (which Bundler does automatically by default),\nActionMailer configuration is fully automatic.  With Rails, be aware that\n`config.action_mailer` assignments will take precedence, so you might want to\nstrip those out of your apps `config/environments/` files.\n\n### Mail\n\n    Mail.defaults do\n      delivery_method *MtaSettings.from_env\n      # delivery_method *MtaSettings.from_url(ENV['MTA_URL'])\n    end\n\n## Usage\n\nConfiguration will happen based on the presence of the following environment\nvariables, in order of decreasing precedence:\n\n* `MTA_PROVIDER`: points to another environment variable containing an MTA URL\n* `MTA_URL`: See below\n* `SENDGRID_USERNAME`: Sendgrid\n* `MANDRILL_APIKEY`: Mandrill\n* `POSTMARK_API_TOKEN`: Postmark\n* `MAILGUN_SMTP_LOGIN`: Mailgun\n* `MAILTRAP_API_TOKEN`: Mailtrap (for development)\n\nIf no supported environment variable is found, the configuration is left\nblank.  This enables easy defaulting:\n\n    ActionMailer::Base.delivery_method ||= :letter_opener\n\n### MTA URLs\n\nThe scheme of an MTA URL is used to set the delivery method.  The user,\npassword, host, port, and path portions are used to populate the `user_name`,\n`address`, `port`, and `location` settings of the chosen delivery method.\nQuery parameters are then merged in.\n\n* The `sendmail` and `file` adapters both respect the ActionMailer `location`\n  defaults, so you can just give `sendmail:///` or `file:///`.\n* If a path is given in an `smtp` URL, it will be used as `domain` rather than\n  `location` (minus the leading slash).\n* If `domain` is set, the default from address will be set to `noreply` at\n  that domain.\n\nHere's an example for Gmail:\n\n    smtp://username%40gmail.com:password@smtp.gmail.com:587/\n\nUsing an MTA URL is highly recommended even when your SMTP provider is\nsupported out of the box.  MTA URLs are much easier to copy between\nenvironments or try out locally for debugging.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpope%2Fmta-settings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftpope%2Fmta-settings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpope%2Fmta-settings/lists"}