trym-mail_bouncer 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 [Trym Skaar]
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,24 @@
1
+ = MailBouncer
2
+
3
+ Rails gem for catching outgoing emails and bouncing them to
4
+ specified recipient(s) while keeping headers intact.
5
+
6
+ == Install
7
+
8
+ gem install trym-mail_bouncer --source http://gems.github.com
9
+
10
+ or
11
+
12
+ config.gem "trym-mail_bouncer", :lib => "mail_bouncer", :source => "http://gems.github.com"
13
+
14
+ == Usage
15
+
16
+ Add this to config/initializers/mail_bouncer.rb:
17
+
18
+ MailBouncer.configure do |config|
19
+ config.enabled = ENV["RAILS_ENV"] == 'development'
20
+ config.recipients = 'your@email'
21
+ end
22
+
23
+
24
+
data/Rakefile ADDED
@@ -0,0 +1,14 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'echoe'
4
+
5
+ Echoe.new('mail_bouncer', '0.1.0') do |p|
6
+ p.description = "Catch outgoing emails and bounce them to a specified recipient while keeping headers intact."
7
+ p.url = "http://github.com/trym/mail-bouncer"
8
+ p.author = "Trym Skaar"
9
+ p.email = "trym@tryms.no"
10
+ p.ignore_pattern = ["tmp/*", "script/*"]
11
+ p.development_dependencies = []
12
+ end
13
+
14
+ Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
data/init.rb ADDED
@@ -0,0 +1 @@
1
+ require 'mail_bouncer'
data/install.rb ADDED
@@ -0,0 +1 @@
1
+ # Install hook code here
@@ -0,0 +1,31 @@
1
+ module MailBouncer
2
+ class << self
3
+ attr_accessor :enabled, :recipients
4
+ def configure
5
+ yield self
6
+ end
7
+ end
8
+ end
9
+
10
+ # For smtp delivery
11
+ module TMail
12
+ class Mail
13
+ def destinations_with_bouncer(default = nil)
14
+ MailBouncer.enabled ?
15
+ MailBouncer.recipients :
16
+ destinations_without_bouncer(default)
17
+ end
18
+ alias_method_chain :destinations, :bouncer
19
+ end
20
+ end
21
+
22
+ # For sendmail delivery
23
+ module ActionMailer
24
+ class Base
25
+ def perform_delivery_sendmail_with_bouncer(mail)
26
+ sendmail_settings[:arguments].gsub!(/\s*-t\s*/,'')
27
+ perform_delivery_sendmail_without_bouncer(mail)
28
+ end
29
+ alias_method_chain :perform_delivery_sendmail, :bouncer
30
+ end
31
+ end
@@ -0,0 +1,32 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{mail_bouncer}
5
+ s.version = "0.1.0"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Trym Skaar"]
9
+ s.date = %q{2009-03-10}
10
+ s.description = %q{Catch outgoing emails and bounce them to a specified recipient while keeping headers intact.}
11
+ s.email = %q{trym@tryms.no}
12
+ s.extra_rdoc_files = ["lib/mail_bouncer.rb", "tasks/mail_bouncer_tasks.rake", "README.rdoc"]
13
+ s.files = ["lib/mail_bouncer.rb", "Manifest", "install.rb", "mail_bouncer.gemspec", "test/test_helper.rb", "test/mail_bouncer_test.rb", "tasks/mail_bouncer_tasks.rake", "MIT-LICENSE", "Rakefile", "uninstall.rb", "README.rdoc", "init.rb"]
14
+ s.has_rdoc = true
15
+ s.homepage = %q{http://github.com/trym/mail-bouncer}
16
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Mail_bouncer", "--main", "README.rdoc"]
17
+ s.require_paths = ["lib"]
18
+ s.rubyforge_project = %q{mail_bouncer}
19
+ s.rubygems_version = %q{1.3.1}
20
+ s.summary = %q{Catch outgoing emails and bounce them to a specified recipient while keeping headers intact.}
21
+ s.test_files = ["test/test_helper.rb", "test/mail_bouncer_test.rb"]
22
+
23
+ if s.respond_to? :specification_version then
24
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
25
+ s.specification_version = 2
26
+
27
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
28
+ else
29
+ end
30
+ else
31
+ end
32
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :mail_bouncer do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class MailBouncerTest < ActiveSupport::TestCase
4
+
5
+ # No tests yet :(
6
+
7
+ end
@@ -0,0 +1,3 @@
1
+ require 'rubygems'
2
+ require 'active_support'
3
+ require 'active_support/test_case'
data/uninstall.rb ADDED
File without changes
metadata ADDED
@@ -0,0 +1,72 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: trym-mail_bouncer
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Trym Skaar
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-03-10 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: Catch outgoing emails and bounce them to a specified recipient while keeping headers intact.
17
+ email: trym@tryms.no
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - lib/mail_bouncer.rb
24
+ - tasks/mail_bouncer_tasks.rake
25
+ - README.rdoc
26
+ files:
27
+ - lib/mail_bouncer.rb
28
+ - Manifest
29
+ - install.rb
30
+ - mail_bouncer.gemspec
31
+ - test/test_helper.rb
32
+ - test/mail_bouncer_test.rb
33
+ - tasks/mail_bouncer_tasks.rake
34
+ - MIT-LICENSE
35
+ - Rakefile
36
+ - uninstall.rb
37
+ - README.rdoc
38
+ - init.rb
39
+ has_rdoc: true
40
+ homepage: http://github.com/trym/mail-bouncer
41
+ post_install_message:
42
+ rdoc_options:
43
+ - --line-numbers
44
+ - --inline-source
45
+ - --title
46
+ - Mail_bouncer
47
+ - --main
48
+ - README.rdoc
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: "0"
56
+ version:
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: "1.2"
62
+ version:
63
+ requirements: []
64
+
65
+ rubyforge_project: mail_bouncer
66
+ rubygems_version: 1.2.0
67
+ signing_key:
68
+ specification_version: 2
69
+ summary: Catch outgoing emails and bounce them to a specified recipient while keeping headers intact.
70
+ test_files:
71
+ - test/test_helper.rb
72
+ - test/mail_bouncer_test.rb