repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/app/mailers/application_mailer.rb
app/mailers/application_mailer.rb
# frozen_string_literal: true class ApplicationMailer < ActionMailer::Base default from: "#{Postal::Config.smtp.from_name} <#{Postal::Config.smtp.from_address}>" layout false end
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/db/seeds.rb
db/seeds.rb
# frozen_string_literal: true # Seeds go here...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/db/schema.rb
db/schema.rb
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # This file is the source Rails uses to define your schema when running `bin/rai...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/db/migrate/20240311205229_add_oidc_fields_to_user.rb
db/migrate/20240311205229_add_oidc_fields_to_user.rb
# frozen_string_literal: true class AddOIDCFieldsToUser < ActiveRecord::Migration[7.0] def change add_column :users, :oidc_uid, :string add_column :users, :oidc_issuer, :string end end
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/db/migrate/20240213165450_create_worker_roles.rb
db/migrate/20240213165450_create_worker_roles.rb
# frozen_string_literal: true class CreateWorkerRoles < ActiveRecord::Migration[6.1] def change create_table :worker_roles do |t| t.string :role t.string :worker t.datetime :acquired_at t.index :role, unique: true end end end
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/db/migrate/20161003195211_add_parent_id_to_authie_sessions.authie.rb
db/migrate/20161003195211_add_parent_id_to_authie_sessions.authie.rb
# frozen_string_literal: true # This migration comes from authie (originally 20150109144120) class AddParentIdToAuthieSessions < ActiveRecord::Migration def change end end
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/db/migrate/20210727210551_add_priority_to_ip_addresses.rb
db/migrate/20210727210551_add_priority_to_ip_addresses.rb
# frozen_string_literal: true class AddPriorityToIPAddresses < ActiveRecord::Migration[5.2] def change add_column :ip_addresses, :priority, :integer IPAddress.where(priority: nil).update_all(priority: 100) end end
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/db/migrate/20240223141501_add_countries_to_authie_sessions.authie.rb
db/migrate/20240223141501_add_countries_to_authie_sessions.authie.rb
# frozen_string_literal: true # This migration comes from authie (originally 20230627165500) class AddCountriesToAuthieSessions < ActiveRecord::Migration[6.1] def change add_column :authie_sessions, :login_ip_country, :string add_column :authie_sessions, :two_factored_ip_country, :string add_column :aut...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/db/migrate/20240213171830_create_scheduled_tasks.rb
db/migrate/20240213171830_create_scheduled_tasks.rb
# frozen_string_literal: true class CreateScheduledTasks < ActiveRecord::Migration[6.1] def change create_table :scheduled_tasks do |t| t.string :name t.datetime :next_run_after t.index :name, unique: true end end end
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/db/migrate/20240223141500_add_two_factor_required_to_sessions.authie.rb
db/migrate/20240223141500_add_two_factor_required_to_sessions.authie.rb
# frozen_string_literal: true # This migration comes from authie (originally 20220502180100) class AddTwoFactorRequiredToSessions < ActiveRecord::Migration[6.1] def change add_column :authie_sessions, :skip_two_factor, :boolean, default: false end end
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/db/migrate/20200717083943_add_uuid_to_credentials.rb
db/migrate/20200717083943_add_uuid_to_credentials.rb
# frozen_string_literal: true class AddUUIDToCredentials < ActiveRecord::Migration[5.2] def change add_column :credentials, :uuid, :string Credential.find_each do |c| c.update_column(:uuid, SecureRandom.uuid) end end end
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/db/migrate/20161003195209_create_authie_sessions.authie.rb
db/migrate/20161003195209_create_authie_sessions.authie.rb
# frozen_string_literal: true # This migration comes from authie (originally 20141012174250) class CreateAuthieSessions < ActiveRecord::Migration def change end end
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/db/migrate/20161003195212_add_two_factor_auth_fields_to_authie.authie.rb
db/migrate/20161003195212_add_two_factor_auth_fields_to_authie.authie.rb
# frozen_string_literal: true # This migration comes from authie (originally 20150305135400) class AddTwoFactorAuthFieldsToAuthie < ActiveRecord::Migration def change end end
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/db/migrate/20170421195415_add_index_to_token_hashes_on_authie_sessions.authie.rb
db/migrate/20170421195415_add_index_to_token_hashes_on_authie_sessions.authie.rb
# frozen_string_literal: true # This migration comes from authie (originally 20170421174100) class AddIndexToTokenHashesOnAuthieSessions < ActiveRecord::Migration def change add_index :authie_sessions, :token_hash, length: 8 end end
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/db/migrate/20170428153353_remove_type_from_ip_pools.rb
db/migrate/20170428153353_remove_type_from_ip_pools.rb
# frozen_string_literal: true class RemoveTypeFromIPPools < ActiveRecord::Migration[5.0] def change remove_column :ip_pools, :type, :string end end
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/db/migrate/20161003195210_add_indexes_to_authie_sessions.authie.rb
db/migrate/20161003195210_add_indexes_to_authie_sessions.authie.rb
# frozen_string_literal: true # This migration comes from authie (originally 20141013115205) class AddIndexesToAuthieSessions < ActiveRecord::Migration def change end end
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/db/migrate/20180216114344_add_host_to_authie_sessions.authie.rb
db/migrate/20180216114344_add_host_to_authie_sessions.authie.rb
# frozen_string_literal: true # This migration comes from authie (originally 20180215152200) class AddHostToAuthieSessions < ActiveRecord::Migration[4.2] def change add_column :authie_sessions, :host, :string end end
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/db/migrate/20170418200606_initial_schema.rb
db/migrate/20170418200606_initial_schema.rb
# frozen_string_literal: true class InitialSchema < ActiveRecord::Migration def up create_table "additional_route_endpoints", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| t.integer "route_id" t.string "endpoint_type" t.integer "endpoint_id" t.datetime "cre...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/db/migrate/20170421195414_add_token_hashes_to_authie_sessions.authie.rb
db/migrate/20170421195414_add_token_hashes_to_authie_sessions.authie.rb
# frozen_string_literal: true # This migration comes from authie (originally 20170417170000) class AddTokenHashesToAuthieSessions < ActiveRecord::Migration def change end end
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/db/migrate/20240206173036_add_privacy_mode_to_servers.rb
db/migrate/20240206173036_add_privacy_mode_to_servers.rb
# frozen_string_literal: true class AddPrivacyModeToServers < ActiveRecord::Migration[6.1] def change add_column :servers, :privacy_mode, :boolean, default: false end end
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/db/migrate/20240214132253_add_lock_fields_to_webhook_requests.rb
db/migrate/20240214132253_add_lock_fields_to_webhook_requests.rb
# frozen_string_literal: true class AddLockFieldsToWebhookRequests < ActiveRecord::Migration[6.1] def change add_column :webhook_requests, :locked_by, :string add_column :webhook_requests, :locked_at, :datetime add_index :webhook_requests, :locked_by end end
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/rails_helper.rb
spec/rails_helper.rb
# frozen_string_literal: true ENV["POSTAL_CONFIG_FILE_PATH"] ||= "config/postal/postal.test.yml" require "dotenv" Dotenv.load(".env.test") require File.expand_path("../config/environment", __dir__) require "rspec/rails" require "spec_helper" require "factory_bot" require "timecop" require "webmock/rspec" require "sh...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/spec_helper.rb
spec/spec_helper.rb
# frozen_string_literal: true RSpec.configure do |config| config.color = true config.expect_with :rspec do |expectations| expectations.include_chain_clauses_in_custom_matcher_descriptions = true end config.mock_with :rspec do |mocks| mocks.verify_partial_doubles = true end end
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/senders/smtp_sender_spec.rb
spec/senders/smtp_sender_spec.rb
# frozen_string_literal: true require "rails_helper" RSpec.describe SMTPSender do subject(:sender) { described_class.new("example.com") } let(:smtp_start_error) { nil } let(:smtp_send_message_error) { nil } let(:smtp_send_message_result) { double("Result", string: "accepted") } before do # Mock the SM...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/services/webhook_delivery_service_spec.rb
spec/services/webhook_delivery_service_spec.rb
# frozen_string_literal: true require "rails_helper" RSpec.describe WebhookDeliveryService do let(:server) { create(:server) } let(:webhook) { create(:webhook, server: server) } let(:webhook_request) { create(:webhook_request, :locked, webhook: webhook) } subject(:service) { described_class.new(webhook_reque...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/helpers/message_factory.rb
spec/helpers/message_factory.rb
# frozen_string_literal: true # This class can be used to generate a message which can be used for the purposes of # testing within the given server. class MessageFactory def initialize(server) @server = server end def incoming(route: nil, &block) @message = @server.message_db.new_message @message....
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/helpers/message_db_mocking.rb
spec/helpers/message_db_mocking.rb
# frozen_string_literal: true module GlobalMessageDB class << self def find_or_create return @db if @db @db = Postal::MessageDB::Database.new(1, 1, database_name: "postal-test-message-db") @db.provisioner.provision end def exists? !@db.nil? end end end RSpec.configure...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/helpers/general_helpers.rb
spec/helpers/general_helpers.rb
# frozen_string_literal: true module GeneralHelpers def create_plain_text_message(server, text, to = "test@example.com", override_attributes = {}) domain = create(:domain, owner: server) attributes = { from: "test@#{domain.name}", subject: "Test Plain Text Message" }.merge(override_attributes) attribute...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/helpers/test_logger.rb
spec/helpers/test_logger.rb
# frozen_string_literal: true class TestLogger def initialize @log_lines = [] @group_set = Klogger::GroupSet.new @print = false end def print! @print = true end def add(level, message, **tags) @group_set.groups.each do |group| tags = group[:tags].merge(tags) end @log_lin...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/scheduled_tasks/tidy_queued_messages_task_spec.rb
spec/scheduled_tasks/tidy_queued_messages_task_spec.rb
# frozen_string_literal: true require "rails_helper" RSpec.describe TidyQueuedMessagesTask do let(:logger) { TestLogger.new } subject(:task) { described_class.new(logger: logger) } describe "#call" do it "destroys queued messages with stale locks" do stale_message = create(:queued_message, locked_at...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/factories/track_domain_factory.rb
spec/factories/track_domain_factory.rb
# frozen_string_literal: true # == Schema Information # # Table name: track_domains # # id :integer not null, primary key # uuid :string(255) # server_id :integer # domain_id :integer # name :string(255) # dns_checked_at ...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/factories/credential_factory.rb
spec/factories/credential_factory.rb
# frozen_string_literal: true # == Schema Information # # Table name: credentials # # id :integer not null, primary key # hold :boolean default(FALSE) # key :string(255) # last_used_at :datetime # name :string(255) # options :text(65535) # type :...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/factories/ip_pool_factory.rb
spec/factories/ip_pool_factory.rb
# frozen_string_literal: true # == Schema Information # # Table name: ip_pools # # id :integer not null, primary key # default :boolean default(FALSE) # name :string(255) # uuid :string(255) # created_at :datetime # updated_at :datetime # # Indexes # # index_ip_pools_on_...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/factories/user_factory.rb
spec/factories/user_factory.rb
# frozen_string_literal: true # == Schema Information # # Table name: users # # id :integer not null, primary key # admin :boolean default(FALSE) # email_address :string(255) # email_verification_token :string(255...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/factories/route_factory.rb
spec/factories/route_factory.rb
# frozen_string_literal: true # == Schema Information # # Table name: routes # # id :integer not null, primary key # endpoint_type :string(255) # mode :string(255) # name :string(255) # spam_mode :string(255) # token :string(255) # uuid :string(255) # ...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/factories/organization_factory.rb
spec/factories/organization_factory.rb
# frozen_string_literal: true # == Schema Information # # Table name: organizations # # id :integer not null, primary key # uuid :string(255) # name :string(255) # permalink :string(255) # time_zone :string(255) # created_at :datetime # up...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/factories/webhook_request_factory.rb
spec/factories/webhook_request_factory.rb
# frozen_string_literal: true # == Schema Information # # Table name: webhook_requests # # id :integer not null, primary key # attempts :integer default(0) # error :text(65535) # event :string(255) # locked_at :datetime # locked_by :string(255) # payload :text(6...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/factories/server_factory.rb
spec/factories/server_factory.rb
# frozen_string_literal: true # == Schema Information # # Table name: servers # # id :integer not null, primary key # allow_sender :boolean default(FALSE) # deleted_at :datetime # domains_not_to_click_track :tex...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/factories/webhook_factory.rb
spec/factories/webhook_factory.rb
# frozen_string_literal: true # == Schema Information # # Table name: webhooks # # id :integer not null, primary key # all_events :boolean default(FALSE) # enabled :boolean default(TRUE) # last_used_at :datetime # name :string(255) # sign :boolean ...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/factories/ip_pool_rule_factory.rb
spec/factories/ip_pool_rule_factory.rb
# frozen_string_literal: true # == Schema Information # # Table name: ip_pool_rules # # id :integer not null, primary key # from_text :text(65535) # owner_type :string(255) # to_text :text(65535) # uuid :string(255) # created_at :datetime not null # updated_at :datetime ...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/factories/domain_factory.rb
spec/factories/domain_factory.rb
# frozen_string_literal: true # == Schema Information # # Table name: domains # # id :integer not null, primary key # server_id :integer # uuid :string(255) # name :string(255) # verification_token :string(255) # verification_metho...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/factories/http_endpoint_factory.rb
spec/factories/http_endpoint_factory.rb
# frozen_string_literal: true # == Schema Information # # Table name: http_endpoints # # id :integer not null, primary key # disabled_until :datetime # encoding :string(255) # error :text(65535) # format :string(255) # include_attachments :bool...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/factories/queued_message_factory.rb
spec/factories/queued_message_factory.rb
# frozen_string_literal: true # == Schema Information # # Table name: queued_messages # # id :integer not null, primary key # attempts :integer default(0) # batch_key :string(255) # domain :string(255) # locked_at :datetime # locked_by :string(255) # manual ...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/factories/smtp_endpoint_factory.rb
spec/factories/smtp_endpoint_factory.rb
# frozen_string_literal: true # == Schema Information # # Table name: smtp_endpoints # # id :integer not null, primary key # disabled_until :datetime # error :text(65535) # hostname :string(255) # last_used_at :datetime # name :string(255) # port :intege...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/factories/worker_role_factory.rb
spec/factories/worker_role_factory.rb
# frozen_string_literal: true # == Schema Information # # Table name: worker_roles # # id :bigint not null, primary key # acquired_at :datetime # role :string(255) # worker :string(255) # # Indexes # # index_worker_roles_on_role (role) UNIQUE # FactoryBot.define do factory :worke...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/factories/ip_address_factory.rb
spec/factories/ip_address_factory.rb
# frozen_string_literal: true # == Schema Information # # Table name: ip_addresses # # id :integer not null, primary key # hostname :string(255) # ipv4 :string(255) # ipv6 :string(255) # priority :integer # created_at :datetime # updated_at :datetime # ip_pool_id :integer # Fac...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/factories/address_endpoint_factory.rb
spec/factories/address_endpoint_factory.rb
# frozen_string_literal: true # == Schema Information # # Table name: address_endpoints # # id :integer not null, primary key # address :string(255) # last_used_at :datetime # uuid :string(255) # created_at :datetime not null # updated_at :datetime not null # ...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/models/worker_role_spec.rb
spec/models/worker_role_spec.rb
# frozen_string_literal: true # == Schema Information # # Table name: worker_roles # # id :bigint not null, primary key # acquired_at :datetime # role :string(255) # worker :string(255) # # Indexes # # index_worker_roles_on_role (role) UNIQUE # require "rails_helper" RSpec.describ...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/models/domain_spec.rb
spec/models/domain_spec.rb
# frozen_string_literal: true # == Schema Information # # Table name: domains # # id :integer not null, primary key # dkim_error :string(255) # dkim_identifier_string :string(255) # dkim_private_key :text(65535) # dkim_status :string(255) # dns_checked_at...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/models/outgoing_message_prototype_spec.rb
spec/models/outgoing_message_prototype_spec.rb
# frozen_string_literal: true require "rails_helper" describe OutgoingMessagePrototype do let(:server) { create(:server) } it "should create a new message" do domain = create(:domain, owner: server) prototype = OutgoingMessagePrototype.new(server, "127.0.0.1", "TestSuite", { from: "test@#{domain.nam...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/models/server_spec.rb
spec/models/server_spec.rb
# frozen_string_literal: true # == Schema Information # # Table name: servers # # id :integer not null, primary key # allow_sender :boolean default(FALSE) # deleted_at :datetime # domains_not_to_click_track :tex...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/models/queued_message_spec.rb
spec/models/queued_message_spec.rb
# frozen_string_literal: true # == Schema Information # # Table name: queued_messages # # id :integer not null, primary key # attempts :integer default(0) # batch_key :string(255) # domain :string(255) # locked_at :datetime # locked_by :string(255) # manual ...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/models/organization_spec.rb
spec/models/organization_spec.rb
# frozen_string_literal: true # == Schema Information # # Table name: organizations # # id :integer not null, primary key # deleted_at :datetime # name :string(255) # permalink :string(255) # suspended_at :datetime # suspension_reason :string(255) # time_...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/models/user_spec.rb
spec/models/user_spec.rb
# frozen_string_literal: true # == Schema Information # # Table name: users # # id :integer not null, primary key # admin :boolean default(FALSE) # email_address :string(255) # email_verification_token :string(255...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/models/user/oidc_spec.rb
spec/models/user/oidc_spec.rb
# frozen_string_literal: true require "rails_helper" RSpec.describe User do let(:user) { build(:user) } describe "#oidc?" do it "returns true if the user has an OIDC UID" do user.oidc_uid = "123" expect(user.oidc?).to be true end it "returns false if the user does not have an OIDC UID" d...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/models/user/authentication_spec.rb
spec/models/user/authentication_spec.rb
# frozen_string_literal: true require "rails_helper" RSpec.describe User do describe ".authenticate" do it "does not authenticate users with invalid emails" do expect { User.authenticate("nothing@nothing.com", "hello") }.to raise_error(Postal::Errors::AuthenticationError) do |e| expect(e.error).to...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/dns_resolver_spec.rb
spec/lib/dns_resolver_spec.rb
# frozen_string_literal: true require "rails_helper" RSpec.describe DNSResolver do subject(:resolver) { described_class.local } # Now, we could mock everything in here which would give us some comfort # but I do think that we'll benefit more from having a full E2E test here # so we'll test this using values ...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/received_header_spec.rb
spec/lib/received_header_spec.rb
# frozen_string_literal: true require "rails_helper" describe ReceivedHeader do before do allow(DNSResolver.local).to receive(:ip_to_hostname).and_return("hostname.com") end describe ".generate" do context "when server is nil" do it "returns the correct string" do result = described_class...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/query_string_spec.rb
spec/lib/query_string_spec.rb
# frozen_string_literal: true require "rails_helper" describe QueryString do it "works with a single item" do qs = described_class.new("to: test@example.com") expect(qs.hash["to"]).to eq "test@example.com" end it "works with a multiple items" do qs = described_class.new("to: test@example.com from: ...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/message_dequeuer_spec.rb
spec/lib/message_dequeuer_spec.rb
# frozen_string_literal: true require "rails_helper" RSpec.describe MessageDequeuer do describe ".process" do it "calls the initial process with the given message and logger" do message = create(:queued_message) logger = TestLogger.new mock = double("InitialProcessor") expect(mock).to r...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/postal_spec.rb
spec/lib/postal_spec.rb
# frozen_string_literal: true require "rails_helper" RSpec.describe Postal do describe "#signer" do it "returns a signer with the installation's signing key" do expect(Postal.signer).to be_a(Postal::Signer) expect(Postal.signer.private_key.to_pem).to eq OpenSSL::PKey::RSA.new(File.read(Postal::Confi...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/dkim_header_spec.rb
spec/lib/dkim_header_spec.rb
# frozen_string_literal: true require "rails_helper" describe DKIMHeader do examples = Rails.root.join("spec/examples/dkim_signing/*.msg") Dir[examples].each do |path| contents = File.read(path) frontmatter, email = contents.split(/^---\n/m, 2) frontmatter = YAML.safe_load(frontmatter) email.strip...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/worker/jobs/process_webhook_requests_job_spec.rb
spec/lib/worker/jobs/process_webhook_requests_job_spec.rb
# frozen_string_literal: true require "rails_helper" module Worker module Jobs RSpec.describe ProcessWebhookRequestsJob do subject(:job) { described_class.new(logger: Postal.logger) } let(:mocked_service) { double("Service") } before do allow(WebhookDeliveryService).to receive(:new)...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/worker/jobs/process_queued_messages_job_spec.rb
spec/lib/worker/jobs/process_queued_messages_job_spec.rb
# frozen_string_literal: true require "rails_helper" module Worker module Jobs RSpec.describe ProcessQueuedMessagesJob do subject(:job) { described_class.new(logger: Postal.logger) } before do allow(MessageDequeuer).to receive(:process) end describe "#call" do context ...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/smtp_client/endpoint_spec.rb
spec/lib/smtp_client/endpoint_spec.rb
# frozen_string_literal: true require "rails_helper" module SMTPClient RSpec.describe Endpoint do let(:ssl_mode) { SSLModes::AUTO } let(:server) { Server.new("mx1.example.com", port: 25, ssl_mode: ssl_mode) } let(:ip) { "1.2.3.4" } before do allow(Net::SMTP).to receive(:new).and_wrap_origina...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/smtp_client/server_spec.rb
spec/lib/smtp_client/server_spec.rb
# frozen_string_literal: true require "rails_helper" module SMTPClient RSpec.describe Server do let(:hostname) { "example.com" } let(:port) { 25 } let(:ssl_mode) { SSLModes::AUTO } subject(:server) { described_class.new(hostname, port: port, ssl_mode: ssl_mode) } describe "#endpoints" do ...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/postal/signer_spec.rb
spec/lib/postal/signer_spec.rb
# frozen_string_literal: true require "rails_helper" module Postal RSpec.describe Signer do STATIC_PRIVATE_KEY = OpenSSL::PKey::RSA.new(2048) # rubocop:disable Lint/ConstantDefinitionInBlock subject(:signer) { described_class.new(STATIC_PRIVATE_KEY) } describe "#private_key" do it "returns the p...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/postal/message_parser_spec.rb
spec/lib/postal/message_parser_spec.rb
# frozen_string_literal: true require "rails_helper" describe Postal::MessageParser do let(:server) { create(:server) } it "should not do anything when there are no tracking domains" do expect(server.track_domains.size).to eq 0 message = create_plain_text_message(server, "Hello world!", "test@example.com...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/postal/legacy_config_source_spec.rb
spec/lib/postal/legacy_config_source_spec.rb
# frozen_string_literal: true require "rails_helper" module Postal SOURCE_CONFIG = YAML.safe_load(File.read(Rails.root.join("spec/examples/full_legacy_config_file.yml"))) # Rather than actuall test the LegacyConfigSource directly, I have decided # to test this source via. the Konfig::Config system to ensure i...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/postal/message_db/database_spec.rb
spec/lib/postal/message_db/database_spec.rb
# frozen_string_literal: true require "rails_helper" describe Postal::MessageDB::Database do context "when provisioned" do let(:server) { create(:server) } subject(:database) { server.message_db } it "should be a message db" do expect(database).to be_a Postal::MessageDB::Database end it ...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/postal/message_db/connection_pool_spec.rb
spec/lib/postal/message_db/connection_pool_spec.rb
# frozen_string_literal: true require "rails_helper" describe Postal::MessageDB::ConnectionPool do subject(:pool) { described_class.new } describe "#use" do it "yields a connection" do counter = 0 pool.use do |connection| expect(connection).to be_a Mysql2::Client counter += 1 ...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/smtp_server/client_spec.rb
spec/lib/smtp_server/client_spec.rb
# frozen_string_literal: true require "rails_helper" module SMTPServer describe Client do let(:ip_address) { "1.2.3.4" } subject(:client) { described_class.new(ip_address) } end end
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/smtp_server/client/proxy_spec.rb
spec/lib/smtp_server/client/proxy_spec.rb
# frozen_string_literal: true require "rails_helper" module SMTPServer describe Client do let(:ip_address) { nil } subject(:client) { described_class.new(ip_address) } describe "PROXY" do context "when the proxy header is sent correctly" do it "sets the IP address" do expect(cl...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/smtp_server/client/data_spec.rb
spec/lib/smtp_server/client/data_spec.rb
# frozen_string_literal: true require "rails_helper" module SMTPServer describe Client do let(:ip_address) { "1.2.3.4" } subject(:client) { described_class.new(ip_address) } describe "DATA" do it "returns an error if no helo" do expect(client.handle("DATA")).to eq "503 HELO/EHLO, MAIL FR...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/smtp_server/client/auth_spec.rb
spec/lib/smtp_server/client/auth_spec.rb
# frozen_string_literal: true require "rails_helper" module SMTPServer describe Client do let(:ip_address) { "1.2.3.4" } subject(:client) { described_class.new(ip_address) } before do client.handle("HELO test.example.com") end describe "AUTH PLAIN" do context "when no credentials ...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/smtp_server/client/rcpt_to_spec.rb
spec/lib/smtp_server/client/rcpt_to_spec.rb
# frozen_string_literal: true require "rails_helper" module SMTPServer describe Client do let(:ip_address) { "1.2.3.4" } subject(:client) { described_class.new(ip_address) } describe "RCPT TO" do let(:helo) { "test.example.com" } let(:mail_from) { "test@example.com" } before do ...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/smtp_server/client/helo_spec.rb
spec/lib/smtp_server/client/helo_spec.rb
# frozen_string_literal: true require "rails_helper" module SMTPServer describe Client do let(:ip_address) { "1.2.3.4" } subject(:client) { described_class.new(ip_address) } describe "HELO" do it "returns the hostname" do expect(client.state).to eq :welcome expect(client.handle("...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/smtp_server/client/finished_spec.rb
spec/lib/smtp_server/client/finished_spec.rb
# frozen_string_literal: true require "rails_helper" module SMTPServer describe Client do let(:ip_address) { "1.2.3.4" } let(:server) { create(:server) } subject(:client) { described_class.new(ip_address) } let(:credential) { create(:credential, server: server, type: "SMTP") } let(:auth_plain)...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/smtp_server/client/mail_from_spec.rb
spec/lib/smtp_server/client/mail_from_spec.rb
# frozen_string_literal: true require "rails_helper" module SMTPServer describe Client do let(:ip_address) { "1.2.3.4" } subject(:client) { described_class.new(ip_address) } describe "MAIL FROM" do it "returns an error if no HELO is provided" do expect(client.handle("MAIL FROM: test@exam...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/message_dequeuer/initial_message_processor_spec.rb
spec/lib/message_dequeuer/initial_message_processor_spec.rb
# frozen_string_literal: true require "rails_helper" module MessageDequeuer RSpec.describe InitialProcessor do let(:server) { create(:server) } let(:logger) { TestLogger.new } let(:route) { create(:route, server: server) } let(:message) { MessageFactory.incoming(server, route: route) } let(:que...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/message_dequeuer/outgoing_message_processor_spec.rb
spec/lib/message_dequeuer/outgoing_message_processor_spec.rb
# frozen_string_literal: true require "rails_helper" module MessageDequeuer RSpec.describe OutgoingMessageProcessor do let(:server) { create(:server) } let(:state) { State.new } let(:logger) { TestLogger.new } let(:domain) { create(:domain, server: server) } let(:credential) { create(:credentia...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/message_dequeuer/incoming_message_processor_spec.rb
spec/lib/message_dequeuer/incoming_message_processor_spec.rb
# frozen_string_literal: true require "rails_helper" module MessageDequeuer RSpec.describe IncomingMessageProcessor do let(:server) { create(:server) } let(:state) { State.new } let(:logger) { TestLogger.new } let(:route) { create(:route, server: server) } let(:message) { MessageFactory.incomin...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/message_dequeuer/base_spec.rb
spec/lib/message_dequeuer/base_spec.rb
# frozen_string_literal: true require "rails_helper" module MessageDequeuer RSpec.describe Base do describe ".new" do context "when given state" do it "uses that state" do base = described_class.new(nil, logger: nil, state: 1234) expect(base.state).to eq 1234 end ...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/message_dequeuer/state_spec.rb
spec/lib/message_dequeuer/state_spec.rb
# frozen_string_literal: true require "rails_helper" module MessageDequeuer RSpec.describe State do subject(:state) { described_class.new } describe "#send_result" do it "can be get and set" do result = instance_double(SendResult) state.send_result = result expect(state.send_...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/lib/message_dequeuer/single_message_processor_spec.rb
spec/lib/message_dequeuer/single_message_processor_spec.rb
# frozen_string_literal: true require "rails_helper" module MessageDequeuer RSpec.describe SingleMessageProcessor do let(:server) { create(:server) } let(:state) { State.new } let(:logger) { TestLogger.new } let(:route) { create(:route, server: server) } let(:message) { MessageFactory.incoming(...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/apis/legacy_api/messages/message_spec.rb
spec/apis/legacy_api/messages/message_spec.rb
# frozen_string_literal: true require "rails_helper" RSpec.describe "Legacy Messages API", type: :request do describe "/api/v1/messages/message" do context "when no authentication is provided" do it "returns an error" do post "/api/v1/messages/message" expect(response.status).to eq 200 ...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/apis/legacy_api/messages/deliveries_spec.rb
spec/apis/legacy_api/messages/deliveries_spec.rb
# frozen_string_literal: true require "rails_helper" RSpec.describe "Legacy Messages API", type: :request do describe "/api/v1/messages/deliveries" do context "when no authentication is provided" do it "returns an error" do post "/api/v1/messages/deliveries" expect(response.status).to eq 2...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/apis/legacy_api/send/message_spec.rb
spec/apis/legacy_api/send/message_spec.rb
# frozen_string_literal: true require "rails_helper" RSpec.describe "Legacy Send API", type: :request do describe "/api/v1/send/message" do context "when no authentication is provided" do it "returns an error" do post "/api/v1/send/message" expect(response.status).to eq 200 parsed_...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/spec/apis/legacy_api/send/raw_spec.rb
spec/apis/legacy_api/send/raw_spec.rb
# frozen_string_literal: true require "rails_helper" RSpec.describe "Legacy Send API", type: :request do describe "/api/v1/send/raw" do context "when no authentication is provided" do it "returns an error" do post "/api/v1/send/raw" expect(response.status).to eq 200 parsed_body = J...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/script/send_html_email.rb
script/send_html_email.rb
# frozen_string_literal: true # This script will automatically send an HTML email to the # SMTP server given. require "mail" require "net/smtp" from = ARGV[0] to = ARGV[1] if from.nil? || to.nil? puts "Usage: ruby send-html-email.rb <from> <to>" exit 1 end mail = Mail.new mail.to = to mail.from = from mail.sub...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/script/default_dkim_record.rb
script/default_dkim_record.rb
# frozen_string_literal: true ENV["SILENCE_POSTAL_CONFIG_LOCATION_MESSAGE"] = "true" require File.expand_path("../lib/postal/config", __dir__) puts Postal.rp_dkim_dns_record
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/script/version.rb
script/version.rb
#!/usr/bin/env ruby # frozen_string_literal: true require File.expand_path("../lib/postal/config", __dir__) puts Postal.version
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/script/queue_size.rb
script/queue_size.rb
#!/usr/bin/env ruby # frozen_string_literal: true require_relative "../lib/postal/config" require "mysql2" client = Mysql2::Client.new( host: Postal::Config.main_db.host, username: Postal::Config.main_db.username, password: Postal::Config.main_db.password, port: Postal::Config.main_db.port, database: Postal...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/script/test_app_smtp.rb
script/test_app_smtp.rb
#!/usr/bin/env ruby # frozen_string_literal: true trap("INT") do puts exit end if ARGV[0].nil? || ARGV[0] !~ /@/ puts "usage: postal test-app-smtp [email address]" exit 1 end require_relative "../config/environment" begin Timeout.timeout(10) do AppMailer.test_message(ARGV[0]).deliver end puts "\e...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/script/insert-bounce.rb
script/insert-bounce.rb
#!/usr/bin/env ruby # frozen_string_literal: true # This script will insert a message into your database that looks like a bounce # for a message that you specify. # usage: insert-bounce.rb [serverid] [messageid] if ARGV[0].nil? || ARGV[1].nil? puts "usage: #{__FILE__} [server-id] [message-id]" exit 1 end requi...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/script/make_user.rb
script/make_user.rb
#!/usr/bin/env ruby # frozen_string_literal: true trap("INT") do puts exit end require_relative "../config/environment" UserCreator.start do |u| u.admin = true u.email_verified_at = Time.now end
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/script/worker.rb
script/worker.rb
#!/usr/bin/env ruby # frozen_string_literal: true $stdout.sync = true $stderr.sync = true require_relative "../config/environment" HealthServer.start( name: "worker", default_port: Postal::Config.worker.default_health_server_port, default_bind_address: Postal::Config.worker.default_health_server_bind_address )...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/script/smtp_server.rb
script/smtp_server.rb
# frozen_string_literal: true $stdout.sync = true $stderr.sync = true require_relative "../config/environment" HealthServer.start( name: "smtp-server", default_port: Postal::Config.smtp_server.default_health_server_port, default_bind_address: Postal::Config.smtp_server.default_health_server_bind_address ) SMTP...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/script/generate_tls_certificate.rb
script/generate_tls_certificate.rb
# frozen_string_literal: true require File.expand_path("../lib/postal/config", __dir__) require "openssl" key_path = Postal::Config.smtp_server.tls_private_key_path cert_path = Postal::Config.smtp_server.tls_certificate_path unless File.exist?(key_path) key = OpenSSL::PKey::RSA.new(2048).to_s File.write(key_path...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false
postalserver/postal
https://github.com/postalserver/postal/blob/b7e5232e077b3c9b7a999dcb6676fba0ec61458e/lib/migration_waiter.rb
lib/migration_waiter.rb
# frozen_string_literal: true # This initializer will wait for all pending migrations to be applied before # continuing to start the application. This is useful when running the application # in a cluster where migrations are run in a separate job which runs at the same # time as the other processes. class MigrationW...
ruby
MIT
b7e5232e077b3c9b7a999dcb6676fba0ec61458e
2026-01-04T15:37:27.414740Z
false