Permalink
Please sign in to comment.
23
.gitignore
| @@ -0,0 +1,23 @@ | ||
| +# See https://help.github.com/articles/ignoring-files for more about ignoring files. | ||
| +# | ||
| +# If you find yourself ignoring temporary files generated by your text editor | ||
| +# or operating system, you probably want to add a global ignore instead: | ||
| +# git config --global core.excludesfile '~/.gitignore_global' | ||
| + | ||
| +# Ignore bundler config. | ||
| +/.bundle | ||
| + | ||
| +# Ignore all logfiles and tempfiles. | ||
| +/log/* | ||
| +/tmp/* | ||
| +!/log/.keep | ||
| +!/tmp/.keep | ||
| + | ||
| +# Ignore Byebug command history file. | ||
| +.byebug_history | ||
| + | ||
| +config/postal.yml | ||
| +config/smtp.cert | ||
| +config/smtp.key | ||
| +config/lets_encrypt.pem | ||
| +config/signing.key |
| @@ -0,0 +1,44 @@ | ||
| +source 'https://rubygems.org' | ||
| +gem 'rails', '= 5.0.2' | ||
| +gem 'mysql2', '>= 0.3.18', '< 0.5' | ||
| +gem 'puma', '~> 3.0' | ||
| +gem 'sass-rails', '~> 5.0' | ||
| +gem 'uglifier', '>= 1.3.0' | ||
| +gem 'coffee-rails', '~> 4.2' | ||
| +gem 'jquery-rails' | ||
| +gem 'turbolinks', '~> 5' | ||
| +gem 'haml' | ||
| +gem 'nifty-utils' | ||
| +gem 'nilify_blanks' | ||
| +gem 'kaminari' | ||
| +gem 'bcrypt' | ||
| +gem 'foreman' | ||
| +gem 'hashie' | ||
| +gem 'authie', :git => "git@codebasehq.com:atechmedia/libs/authie" | ||
| +gem 'dynamic_form' | ||
| +gem 'changey' | ||
| +gem 'mail' | ||
| +gem 'autoprefixer-rails' | ||
| +gem 'bunny', '~> 2.5.1' | ||
| +gem 'secure_headers' | ||
| +gem 'chronic' | ||
| +gem 'basic_ssl' | ||
| +gem 'clockwork' | ||
| +gem 'encrypto_signo' | ||
| +gem 'epoll', :require => nil | ||
| +gem 'mongo' | ||
| +gem 'sentry-raven' | ||
| +gem 'gelf' | ||
| +gem 'moonrope', :git => 'https://github.com/adamcooke/moonrope', :branch => 'master' | ||
| +gem 'jwt' | ||
| +gem 'createsend', '~> 4.0' | ||
| +gem 'acme-client', :git => 'https://github.com/unixcharles/acme-client' | ||
| + | ||
| +group :development, :test do | ||
| + gem 'byebug' | ||
| +end | ||
| + | ||
| +group :development do | ||
| + gem 'web-console' | ||
| + gem 'annotate' | ||
| +end |
257
Gemfile.lock
| @@ -0,0 +1,257 @@ | ||
| +GIT | ||
| + remote: git@codebasehq.com:atechmedia/libs/authie | ||
| + revision: 045adc2e54e3ec6ced99ad49356da6397dd62542 | ||
| + specs: | ||
| + authie (3.0.0) | ||
| + | ||
| +GIT | ||
| + remote: https://github.com/adamcooke/moonrope | ||
| + revision: fe5d5de38a35c36416f256a41902a6984e147fe5 | ||
| + branch: master | ||
| + specs: | ||
| + moonrope (2.0.0) | ||
| + deep_merge (~> 1.0) | ||
| + json (~> 1.7) | ||
| + rack (>= 1.4) | ||
| + | ||
| +GIT | ||
| + remote: https://github.com/unixcharles/acme-client | ||
| + revision: 9a80e9301acd3f17ebff6ceaf245e0c400d08519 | ||
| + specs: | ||
| + acme-client (0.5.0) | ||
| + faraday (~> 0.9, >= 0.9.1) | ||
| + | ||
| +GEM | ||
| + remote: https://rubygems.org/ | ||
| + specs: | ||
| + actioncable (5.0.2) | ||
| + actionpack (= 5.0.2) | ||
| + nio4r (>= 1.2, < 3.0) | ||
| + websocket-driver (~> 0.6.1) | ||
| + actionmailer (5.0.2) | ||
| + actionpack (= 5.0.2) | ||
| + actionview (= 5.0.2) | ||
| + activejob (= 5.0.2) | ||
| + mail (~> 2.5, >= 2.5.4) | ||
| + rails-dom-testing (~> 2.0) | ||
| + actionpack (5.0.2) | ||
| + actionview (= 5.0.2) | ||
| + activesupport (= 5.0.2) | ||
| + rack (~> 2.0) | ||
| + rack-test (~> 0.6.3) | ||
| + rails-dom-testing (~> 2.0) | ||
| + rails-html-sanitizer (~> 1.0, >= 1.0.2) | ||
| + actionview (5.0.2) | ||
| + activesupport (= 5.0.2) | ||
| + builder (~> 3.1) | ||
| + erubis (~> 2.7.0) | ||
| + rails-dom-testing (~> 2.0) | ||
| + rails-html-sanitizer (~> 1.0, >= 1.0.3) | ||
| + activejob (5.0.2) | ||
| + activesupport (= 5.0.2) | ||
| + globalid (>= 0.3.6) | ||
| + activemodel (5.0.2) | ||
| + activesupport (= 5.0.2) | ||
| + activerecord (5.0.2) | ||
| + activemodel (= 5.0.2) | ||
| + activesupport (= 5.0.2) | ||
| + arel (~> 7.0) | ||
| + activesupport (5.0.2) | ||
| + concurrent-ruby (~> 1.0, >= 1.0.2) | ||
| + i18n (~> 0.7) | ||
| + minitest (~> 5.1) | ||
| + tzinfo (~> 1.1) | ||
| + amq-protocol (2.0.1) | ||
| + annotate (2.7.1) | ||
| + activerecord (>= 3.2, < 6.0) | ||
| + rake (>= 10.4, < 12.0) | ||
| + arel (7.1.4) | ||
| + autoprefixer-rails (6.5.0.2) | ||
| + execjs | ||
| + basic_ssl (1.0.3) | ||
| + bcrypt (3.1.11) | ||
| + bson (4.0.4) | ||
| + builder (3.2.3) | ||
| + bunny (2.5.1) | ||
| + amq-protocol (>= 2.0.1) | ||
| + byebug (9.0.6) | ||
| + changey (1.0.0) | ||
| + activerecord (>= 4.2, < 6) | ||
| + chronic (0.10.2) | ||
| + clockwork (1.0.0) | ||
| + activesupport | ||
| + tzinfo | ||
| + coffee-rails (4.2.1) | ||
| + coffee-script (>= 2.2.0) | ||
| + railties (>= 4.0.0, < 5.2.x) | ||
| + coffee-script (2.4.1) | ||
| + coffee-script-source | ||
| + execjs | ||
| + coffee-script-source (1.10.0) | ||
| + concurrent-ruby (1.0.5) | ||
| + createsend (4.1.0) | ||
| + hashie (~> 3.0) | ||
| + httparty (~> 0.10) | ||
| + json (~> 1.0) | ||
| + debug_inspector (0.0.2) | ||
| + deep_merge (1.1.1) | ||
| + dynamic_form (1.1.4) | ||
| + encrypto_signo (1.0.0) | ||
| + epoll (0.3.0) | ||
| + erubis (2.7.0) | ||
| + execjs (2.7.0) | ||
| + faraday (0.9.2) | ||
| + multipart-post (>= 1.2, < 3) | ||
| + foreman (0.82.0) | ||
| + thor (~> 0.19.1) | ||
| + gelf (3.0.0) | ||
| + json | ||
| + globalid (0.3.7) | ||
| + activesupport (>= 4.1.0) | ||
| + haml (4.0.7) | ||
| + tilt | ||
| + hashie (3.4.6) | ||
| + httparty (0.14.0) | ||
| + multi_xml (>= 0.5.2) | ||
| + i18n (0.8.1) | ||
| + jquery-rails (4.2.1) | ||
| + rails-dom-testing (>= 1, < 3) | ||
| + railties (>= 4.2.0) | ||
| + thor (>= 0.14, < 2.0) | ||
| + json (1.8.6) | ||
| + jwt (1.5.6) | ||
| + kaminari (0.17.0) | ||
| + actionpack (>= 3.0.0) | ||
| + activesupport (>= 3.0.0) | ||
| + loofah (2.0.3) | ||
| + nokogiri (>= 1.5.9) | ||
| + mail (2.6.4) | ||
| + mime-types (>= 1.16, < 4) | ||
| + method_source (0.8.2) | ||
| + mime-types (3.1) | ||
| + mime-types-data (~> 3.2015) | ||
| + mime-types-data (3.2016.0521) | ||
| + mini_portile2 (2.1.0) | ||
| + minitest (5.10.1) | ||
| + mongo (2.2.4) | ||
| + bson (~> 4.0) | ||
| + multi_xml (0.5.5) | ||
| + multipart-post (2.0.0) | ||
| + mysql2 (0.4.4) | ||
| + nifty-utils (1.1.7) | ||
| + nilify_blanks (1.2.1) | ||
| + activerecord (>= 3.0.0) | ||
| + activesupport (>= 3.0.0) | ||
| + nio4r (2.0.0) | ||
| + nokogiri (1.7.1) | ||
| + mini_portile2 (~> 2.1.0) | ||
| + puma (3.8.2) | ||
| + rack (2.0.1) | ||
| + rack-test (0.6.3) | ||
| + rack (>= 1.0) | ||
| + rails (5.0.2) | ||
| + actioncable (= 5.0.2) | ||
| + actionmailer (= 5.0.2) | ||
| + actionpack (= 5.0.2) | ||
| + actionview (= 5.0.2) | ||
| + activejob (= 5.0.2) | ||
| + activemodel (= 5.0.2) | ||
| + activerecord (= 5.0.2) | ||
| + activesupport (= 5.0.2) | ||
| + bundler (>= 1.3.0, < 2.0) | ||
| + railties (= 5.0.2) | ||
| + sprockets-rails (>= 2.0.0) | ||
| + rails-dom-testing (2.0.2) | ||
| + activesupport (>= 4.2.0, < 6.0) | ||
| + nokogiri (~> 1.6) | ||
| + rails-html-sanitizer (1.0.3) | ||
| + loofah (~> 2.0) | ||
| + railties (5.0.2) | ||
| + actionpack (= 5.0.2) | ||
| + activesupport (= 5.0.2) | ||
| + method_source | ||
| + rake (>= 0.8.7) | ||
| + thor (>= 0.18.1, < 2.0) | ||
| + rake (11.3.0) | ||
| + sass (3.4.22) | ||
| + sass-rails (5.0.6) | ||
| + railties (>= 4.0.0, < 6) | ||
| + sass (~> 3.1) | ||
| + sprockets (>= 2.8, < 4.0) | ||
| + sprockets-rails (>= 2.0, < 4.0) | ||
| + tilt (>= 1.1, < 3) | ||
| + secure_headers (3.4.1) | ||
| + useragent | ||
| + sentry-raven (2.1.0) | ||
| + faraday (>= 0.7.6, < 0.10.x) | ||
| + sprockets (3.7.1) | ||
| + concurrent-ruby (~> 1.0) | ||
| + rack (> 1, < 3) | ||
| + sprockets-rails (3.2.0) | ||
| + actionpack (>= 4.0) | ||
| + activesupport (>= 4.0) | ||
| + sprockets (>= 3.0.0) | ||
| + thor (0.19.4) | ||
| + thread_safe (0.3.6) | ||
| + tilt (2.0.5) | ||
| + turbolinks (5.0.1) | ||
| + turbolinks-source (~> 5) | ||
| + turbolinks-source (5.0.0) | ||
| + tzinfo (1.2.3) | ||
| + thread_safe (~> 0.1) | ||
| + uglifier (3.0.2) | ||
| + execjs (>= 0.3.0, < 3) | ||
| + useragent (0.16.8) | ||
| + web-console (3.3.1) | ||
| + actionview (>= 5.0) | ||
| + activemodel (>= 5.0) | ||
| + debug_inspector | ||
| + railties (>= 5.0) | ||
| + websocket-driver (0.6.5) | ||
| + websocket-extensions (>= 0.1.0) | ||
| + websocket-extensions (0.1.2) | ||
| + | ||
| +PLATFORMS | ||
| + ruby | ||
| + | ||
| +DEPENDENCIES | ||
| + acme-client! | ||
| + annotate | ||
| + authie! | ||
| + autoprefixer-rails | ||
| + basic_ssl | ||
| + bcrypt | ||
| + bunny (~> 2.5.1) | ||
| + byebug | ||
| + changey | ||
| + chronic | ||
| + clockwork | ||
| + coffee-rails (~> 4.2) | ||
| + createsend (~> 4.0) | ||
| + dynamic_form | ||
| + encrypto_signo | ||
| + epoll | ||
| + foreman | ||
| + gelf | ||
| + haml | ||
| + hashie | ||
| + jquery-rails | ||
| + jwt | ||
| + kaminari | ||
| + mongo | ||
| + moonrope! | ||
| + mysql2 (>= 0.3.18, < 0.5) | ||
| + nifty-utils | ||
| + nilify_blanks | ||
| + puma (~> 3.0) | ||
| + rails (= 5.0.2) | ||
| + sass-rails (~> 5.0) | ||
| + secure_headers | ||
| + sentry-raven | ||
| + turbolinks (~> 5) | ||
| + uglifier (>= 1.3.0) | ||
| + web-console | ||
| + | ||
| +BUNDLED WITH | ||
| + 1.14.5 |
| @@ -0,0 +1,6 @@ | ||
| +web: bundle exec puma -C config/puma.rb | ||
| +fast: bundle exec rake postal:fast_server | ||
| +worker: bundle exec rake postal:worker | ||
| +cron: bundle exec rake postal:cron | ||
| +smtp: bundle exec rake postal:smtp_server | ||
| +requeuer: bundle exec rake postal:requeuer |
| @@ -0,0 +1,14 @@ | ||
| +app_name: Postal | ||
| +log_path: log/procodile.log | ||
| +pid_root: tmp/pids | ||
| +processes: | ||
| + web: | ||
| + restart_mode: usr1 | ||
| + fast: | ||
| + restart_mode: term-start | ||
| + smtp: | ||
| + restart_mode: usr1 | ||
| + worker: | ||
| + restart_mode: start-term | ||
| + cron: | ||
| + restart_mode: term-start |
| @@ -0,0 +1,9 @@ | ||
| +# Postal | ||
| + | ||
| +Postal is a complete and fully featured mail server for use by websites & web servers. Think Sendgrid, Mailgun or Postmark but open source and ready for you to run on your own servers. Postal was developed by aTech Media to serve its own mail processing requirements and we have since decided that it should be released as an open source project for the community. It was originally launched by us as AppMail but renamed to Postal as part of making it open source as we felt the name was more suitable. | ||
| + | ||
| +The application has been running in production for us for nearly 6 months and we will be continuing to use it ourselves and support its ongoing development. | ||
| + | ||
| +We are still just putting a few finishing touches to the documentation & installation instructions but we'll make it as easy as possible. | ||
| + | ||
| +Standby. |
| @@ -0,0 +1,6 @@ | ||
| +# Add your own tasks in files placed in lib/tasks ending in .rake, | ||
| +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | ||
| + | ||
| +require_relative 'config/application' | ||
| + | ||
| +Rails.application.load_tasks |
| @@ -0,0 +1,28 @@ | ||
| +authenticator :server do | ||
| + header "X-Server-API-Key", "The API token for a server that you wish to authenticate with.", :example => 'f29a45f0d4e1744ebaee' | ||
| + error 'InvalidServerAPIKey', "The API token provided in X-Server-API-Key was not valid.", :attributes => {:token => "The token that was looked up"} | ||
| + error 'ServerSuspended', "The mail server has been suspended" | ||
| + lookup do | ||
| + if key = request.headers['X-Server-API-Key'] | ||
| + if credential = Credential.where(:type => 'API', :key => key).first | ||
| + if credential.server.suspended? | ||
| + error 'ServerSuspended' | ||
| + else | ||
| + credential.use | ||
| + credential | ||
| + end | ||
| + else | ||
| + error 'InvalidServerAPIKey', :token => key | ||
| + end | ||
| + end | ||
| + end | ||
| + rule :default, "AccessDenied", "Must be authenticated as a server." do | ||
| + identity.is_a?(Credential) | ||
| + end | ||
| +end | ||
| + | ||
| +authenticator :anonymous do | ||
| + rule :default, "MustNotBeAuthenticated", "Must not be authenticated." do | ||
| + identity.nil? | ||
| + end | ||
| +end |
Oops, something went wrong.
0 comments on commit
2fdba0c