{"id":25728367,"url":"https://github.com/kenjij/postmark-inbound","last_synced_at":"2025-05-07T11:10:05.508Z","repository":{"id":56888589,"uuid":"74327570","full_name":"kenjij/postmark-inbound","owner":"kenjij","description":"A Ruby server for Postmark inbound webhook","archived":false,"fork":false,"pushed_at":"2017-03-24T00:14:52.000Z","size":11,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-11T23:43:23.443Z","etag":null,"topics":["postmark","ruby"],"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/kenjij.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}},"created_at":"2016-11-21T04:58:58.000Z","updated_at":"2017-12-04T00:18:45.000Z","dependencies_parsed_at":"2022-08-20T23:40:49.911Z","dependency_job_id":null,"html_url":"https://github.com/kenjij/postmark-inbound","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Fpostmark-inbound","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Fpostmark-inbound/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Fpostmark-inbound/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Fpostmark-inbound/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kenjij","download_url":"https://codeload.github.com/kenjij/postmark-inbound/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240766601,"owners_count":19854119,"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":["postmark","ruby"],"created_at":"2025-02-26T00:17:33.753Z","updated_at":"2025-02-26T00:17:35.778Z","avatar_url":"https://github.com/kenjij.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# postmark-inbound\n\n[![Gem Version](https://badge.fury.io/rb/postmark-inbound.svg)](http://badge.fury.io/rb/postmark-inbound) [![Code Climate](https://codeclimate.com/github/kenjij/postmark-inbound/badges/gpa.svg)](https://codeclimate.com/github/kenjij/postmark-inbound) [![security](https://hakiri.io/github/kenjij/postmark-inbound/master.svg)](https://hakiri.io/github/kenjij/postmark-inbound/master)\n\nA Ruby server for Postmark inbound webhook.\n\n## Requirements\n\n- [Ruby](https://www.ruby-lang.org/) 2.1 \u003c=\n- [Kajiki](https://kenjij.github.io/kajiki/) 1.1 \u003c=\n- [Sinatra](http://www.sinatrarb.com) 1.4 \u003c=\n\n## Install\n\n```\n$ gem install postmark-inbound\n```\n\n## Configure\n\nCreate a configuration file following the example below.\n\n```ruby\n# Configure application logging\nPINS.logger = Logger.new(STDOUT)\nPINS.logger.level = Logger::DEBUG\n\nPINS::Config.setup do |c|\n  # User custom data\n  c.user = {my_data1: 'Something', my_data2: 'Somethingelse'}\n  # For security, basic auth is required.\n  # Set accepted passwords; username is ignored\n  c.passwords = [\n    'someSTRING1234',\n    'OTHERstring987'\n  ]\n  # Paths of where you've stored the handlers\n  c.handler_paths = [\n    'handlers'\n  ]\n  # HTTP server (Sinatra) settings\n  c.dump_errors = true\n  c.logging = true\nend\n```\n\n### Handlers\n\nHandler blocks are called for every incoming requests. Create as many files you'd like containing handlers, for example: `handlers/examples.rb`\n\n```ruby\nPINS::Handler.add do |pin|\n  # The 'pin' variable contains data from Postmark\n  break unless pin[:originalrecipient] == 'myinbox@pm.example.com'\n  puts \"It's a match!\"\n  # Do something more\nend\n\n# You can have multiple handlers in one file\nPINS::Handler.add do |pin|\n  break unless pin[:spam_status]\n  puts \"We've got a spam.\"\n  # Do something more\nend\n\n```\n\n## Use\n\nTo see help:\n\n```\n$ pin-server -h\nUsage: pin-server [options] {start|stop}\n  -c, --config=\u003cs\u003e     Load config from file\n  -d, --daemonize      Run in the background\n  -l, --log=\u003cs\u003e        Log output to file\n  -P, --pid=\u003cs\u003e        Store PID to file\n  -p, --port=\u003ci\u003e       Use port (default: 4567)\n```\n\nThe minimum to start a server:\n\n```\n$ pin-server -c config.rb start\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenjij%2Fpostmark-inbound","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkenjij%2Fpostmark-inbound","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenjij%2Fpostmark-inbound/lists"}