reaction_mailer 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ .rbenv-version
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in reaction_mailer.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Ed Robinson
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # Re-ActionMailer
2
+
3
+ ReactionMailer is designed to send real emails out using the files
4
+ generated by [Inaction Mailer](https://github.com/cwninja/inaction_mailer/)
5
+
6
+ It will even read emails served up by [PopThis](https://github.com/cwninja/popthis)
7
+
8
+ Most of the time it is most useful to have a rails app in development
9
+ not to send out any actual emails.
10
+
11
+ However it is usefull to be able to send real emails for things like
12
+ testing with [Litmus](http://litmus.com/).
13
+
14
+ ## Installation
15
+
16
+ Install it:
17
+
18
+ $ gem install reaction_mailer
19
+
20
+ ## Usage
21
+
22
+ Usage: remail [options] file1 file2 ...
23
+
24
+ -u, --username USERNAME Gmail Username
25
+ -w, --password PASSWORD Gmail Password
26
+ -t, --to EMAIL Send the email to who?
27
+ -p, --pop Read the emails to send from popthis
28
+ -h, --help Display this screen
29
+
30
+ ## Examples
31
+
32
+ Send an email to a given email address using a file
33
+
34
+ $ remail -t test@emailtesting.com mail.0.txt
35
+ Enter your gmail username: someone@gmail.com
36
+ Enter your gmail password: *********
37
+ #<Mail::Message:2244614900, Multipart: true, Headers:<Date: Mon, 27 Aug 2012 23:33:09 +0100>, <From: Someone <someone@somesuch.com>>, <To: test@emailtesting.com >, <Cc: >, <Bcc: >, <Subject: About your Test Email>, <Mime-Version: 1.0>, <Content-Type: multipart/alternative; boundary=mimepart_503bf5a5a802a_146ee8749b13c38>
38
+
39
+ Send this email? y
40
+
41
+ Ok that email just got sent!
42
+
43
+ Send emails from the pop server
44
+
45
+ $remail -t test@emailtesting.com -u someone@gmail.com -p
46
+ Enter your gmail password: *********
47
+ #<Mail::Message:2244614900, Multipart: true, Headers:<Date: Mon, 27 Aug 2012 23:33:09 +0100>, <From: Someone <someone@somesuch.com>>, <To: test@emailtesting.com >, <Cc: >, <Bcc: >, <Subject: About your Test Email>, <Mime-Version: 1.0>, <Content-Type: multipart/alternative; boundary=mimepart_503bf5a5a802a_146ee8749b13c38>
48
+
49
+ Send this email? y
50
+
51
+ Ok that email just got sent!
52
+
53
+ ## Contributing
54
+
55
+ 1. Fork it
56
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
57
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
58
+ 4. Push to the branch (`git push origin my-new-feature`)
59
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
data/bin/remail ADDED
@@ -0,0 +1,89 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "rubygems"
4
+ require "highline/import"
5
+ require "mail"
6
+ require 'optparse'
7
+ require 'pp'
8
+
9
+ options = Hash.new(false)
10
+
11
+ OptionParser.new do|opts|
12
+ opts.banner = "Usage: remail [options] file1 file2 ... \n\n"
13
+
14
+ opts.on( '-u', '--username USERNAME', "Gmail Username" ) do|u|
15
+ options[:user] = u
16
+ end
17
+
18
+ opts.on( '-w', '--password PASSWORD', "Gmail Password") do|p|
19
+ options[:pass] = p
20
+ end
21
+
22
+ opts.on( '-t', '--to EMAIL', 'Send the email to who?' ) do|t|
23
+ options[:to] = t
24
+ end
25
+
26
+ opts.on( '-p', '--pop', 'Read the emails to send from popthis') do
27
+ options[:pop] = true
28
+ end
29
+
30
+ opts.on( '-h', '--help', 'Display this screen' ) do
31
+ puts opts
32
+ exit
33
+ end
34
+ end.parse!
35
+
36
+ options[:user] = ask("Enter your gmail username: ") unless options[:user]
37
+ options[:pass] = ask("Enter your gmail password: ") { |q| q.echo = "*" } unless options[:pass]
38
+
39
+ if /@(.*$)/.match(options[:user])
40
+ domain = /@(.*$)/.match(options[:user])[1]
41
+ else
42
+ domain = 'gmail.com'
43
+ end
44
+
45
+ mail_settings = {
46
+ :address => "smtp.gmail.com",
47
+ :port => 587,
48
+ :domain => domain,
49
+ :user_name => options[:user],
50
+ :password => options[:pass],
51
+ :authentication => 'plain',
52
+ :enable_starttls_auto => true
53
+ }
54
+
55
+ Mail.defaults do
56
+ delivery_method :smtp, mail_settings
57
+ retriever_method :pop3, :address => "localhost",
58
+ :port => 2220,
59
+ :user_name => 'reaction',
60
+ :password => 'canttouchthis'
61
+ end
62
+
63
+
64
+
65
+ unless options[:pop]
66
+ mail = []
67
+ ARGV.each do |f|
68
+ mail << Mail.read(f)
69
+ end
70
+ else
71
+ mail = Mail.all
72
+ end
73
+
74
+ mail.each do |mail|
75
+ mail.message_id = nil
76
+ mail.cc = nil
77
+ mail.bcc = nil
78
+ mail.to = options[:to] || mail.to
79
+ pp mail
80
+ send = agree("Send this email? ", true)
81
+ puts ""
82
+ if send
83
+ mail.to = options[:to] || ask('Send this email to who')
84
+ mail.deliver
85
+ puts "Ok that email just got sent!
86
+ "
87
+ end
88
+ end
89
+
@@ -0,0 +1,3 @@
1
+ module ReactionMailer
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,4 @@
1
+ require "reaction_mailer/version"
2
+
3
+ module ReactionMailer
4
+ end
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/reaction_mailer/version', __FILE__)
3
+ require "base64"
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.authors = ["Ed Robinson"]
7
+ gem.email = Base64.decode64("ZWQucm9iaW5zb25AcmVldm9vLmNvbQ==\n")
8
+ gem.description = %q{Reaction Mailer}
9
+ gem.summary = %q{Sends emails put on ice by Inaction Mailer}
10
+ gem.homepage = "https://github.com/errm/reaction_mailer"
11
+
12
+ gem.files = `git ls-files`.split($\)
13
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
14
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
15
+ gem.name = "reaction_mailer"
16
+ gem.require_paths = ["lib"]
17
+ gem.version = ReactionMailer::VERSION
18
+
19
+ gem.add_dependency('highline', '>= 1.6.14')
20
+ gem.add_dependency('mail', '>= 2.4.4')
21
+ end
metadata ADDED
@@ -0,0 +1,105 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: reaction_mailer
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Ed Robinson
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2012-08-27 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: highline
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 19
29
+ segments:
30
+ - 1
31
+ - 6
32
+ - 14
33
+ version: 1.6.14
34
+ type: :runtime
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: mail
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ hash: 23
45
+ segments:
46
+ - 2
47
+ - 4
48
+ - 4
49
+ version: 2.4.4
50
+ type: :runtime
51
+ version_requirements: *id002
52
+ description: Reaction Mailer
53
+ email: ed.robinson@reevoo.com
54
+ executables:
55
+ - remail
56
+ extensions: []
57
+
58
+ extra_rdoc_files: []
59
+
60
+ files:
61
+ - .gitignore
62
+ - Gemfile
63
+ - LICENSE
64
+ - README.md
65
+ - Rakefile
66
+ - bin/remail
67
+ - lib/reaction_mailer.rb
68
+ - lib/reaction_mailer/version.rb
69
+ - reaction_mailer.gemspec
70
+ homepage: https://github.com/errm/reaction_mailer
71
+ licenses: []
72
+
73
+ post_install_message:
74
+ rdoc_options: []
75
+
76
+ require_paths:
77
+ - lib
78
+ required_ruby_version: !ruby/object:Gem::Requirement
79
+ none: false
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ hash: 3
84
+ segments:
85
+ - 0
86
+ version: "0"
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ hash: 3
93
+ segments:
94
+ - 0
95
+ version: "0"
96
+ requirements: []
97
+
98
+ rubyforge_project:
99
+ rubygems_version: 1.8.24
100
+ signing_key:
101
+ specification_version: 3
102
+ summary: Sends emails put on ice by Inaction Mailer
103
+ test_files: []
104
+
105
+ has_rdoc: