mailcatcher-jruby 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b12132d30e684f47cc6409c240b0684615fb436
4
- data.tar.gz: 11958f289b65ecf2f04958d1a9a05eaa3813392c
3
+ metadata.gz: 6d7dbf6f7dc917fba2df9292cb9f903bdbbcad00
4
+ data.tar.gz: 0d5019147e9d02b444f533222a146028ea19c37d
5
5
  SHA512:
6
- metadata.gz: 6027fc8fdb637e18dcc60a37973dd16bf9a7942c17f25e453e669cda48881ba92e9fa7f13366e1dfe7a4501a15c8d422bb0cc4571abe643cc79df00d867d5502
7
- data.tar.gz: 7cf61262e58f58ed09b76bb4ed9a493bb34c827280c83fb457201c9e2e98735917b86c9c646991448fe48fcb58de0ee2130bd5773af88723aa4fe1935319910a
6
+ metadata.gz: 8bbfcd98382524f55e41a03f7d1703282209bf0f633302bec91411f9d515fd563596f2fee1c8fb8b96157b7424da7bdc29b1bbe8016770b44dfc1ee7b3698e41
7
+ data.tar.gz: e38d8789105f7a632046764059cf9354851f9a0157bec963ecd837ac34754ef94d71edbb45e72a8fbde5d378716c3f32a68a6d600eda845e28fbe0fd328b5b59
data/LICENSE CHANGED
@@ -1,20 +1,20 @@
1
- Copyright (c) 2010-2011 Samuel Cochran
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.
1
+ Copyright (c) 2010-2011 Samuel Cochran
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.md CHANGED
@@ -1,165 +1,165 @@
1
- # MailCatcher for JRuby
2
-
3
- ## Usage for JRuby on Rails.
4
-
5
- 1. Install
6
- ```
7
- gem install mailcatcher-jruby
8
- ```
9
-
10
- 2. Start the smpt server at port 9000
11
-
12
- ```
13
- mailcatcher
14
- ```
15
-
16
- use `--smtp-port 1080` to change the port to 1080
17
-
18
- 3. Start Puma rack server to host web pages of emails at port 9090.
19
- ```
20
- mailweb
21
- ```
22
- add `-p 1080` to use port 1080
23
-
24
- Open [http://127.0.0.1:9090](http://127.0.0.1:9090) to see emails.
25
-
26
-
27
- 4. Configure rails.
28
- To set up your rails app, I recommend adding this to your `environment/development.rb`:
29
- ```
30
- config.action_mailer.delivery_method = :smtp
31
- config.action_mailer.smtp_settings = { :address => "127.0.0.1", :port =>
32
- 9000 }
33
- ```
34
-
35
-
36
- # Original Documentation
37
-
38
- # MailCatcher
39
-
40
-
41
- Catches mail and serves it through a dream.
42
-
43
- MailCatcher runs a super simple SMTP server which catches any message sent to it to display in a web interface. Run mailcatcher, set your favourite app to deliver to smtp://127.0.0.1:1025 instead of your default SMTP server, then check out http://127.0.0.1:1080 to see the mail that's arrived so far.
44
-
45
- ![MailCatcher screenshot](http://f.cl.ly/items/3w2T1p0F3g003b2i1F2z/Screen%20shot%202011-06-23%20at%2011.39.03%20PM.png)
46
-
47
- ## Features
48
-
49
- * Catches all mail and stores it for display.
50
- * Shows HTML, Plain Text and Source version of messages, as applicable.
51
- * Rewrites HTML enabling display of embedded, inline images/etc and open links in a new window. (currently very basic)
52
- * Can send HTML for analysis by [Fractal][fractal].
53
- * Lists attachments and allows separate downloading of parts.
54
- * Download original email to view in your native mail client(s).
55
- * Command line options to override the default SMTP/HTTP IP and port settings.
56
- * Mail appears instantly if your browser supports [WebSockets][websockets], otherwise updates every thirty seconds.
57
- * Growl notifications when you receive a new message.
58
- * Runs as a daemon run in the background.
59
- * Sendmail-analogue command, `catchmail`, makes [using mailcatcher from PHP][withphp] a lot easier.
60
- * Written super-simply in EventMachine, easy to dig in and change.
61
- * Keyboard navigation between messages
62
-
63
- ## How
64
-
65
- 1. `gem install mailcatcher`
66
- 2. `mailcatcher`
67
- 3. Go to http://localhost:1080/
68
- 4. Send mail through smtp://localhost:1025
69
-
70
- The brave can get the source from [the GitHub repository][mailcatcher-github].
71
-
72
- ### Bundler
73
-
74
- Please don't put mailcatcher into your Gemfile. It will conflict with your applications gems at some point.
75
-
76
- Instead, pop a note in your README stating you use mailcatcher. Simply run `gem install mailcatcher` then `mailcatcher` to get started.
77
-
78
- ### RVM
79
-
80
- Under RVM your mailcatcher command may only be available under the ruby you install mailcatcher into. To prevent this, and to prevent gem conflicts, install mailcatcher into a dedicated gemset and create wrapper scripts:
81
-
82
- rvm default@mailcatcher --create do gem install mailcatcher
83
- rvm wrapper default@mailcatcher --no-prefix mailcatcher catchmail
84
-
85
- ### Rails
86
-
87
- To set up your rails app, I recommend adding this to your `environment/development.rb`:
88
-
89
- config.action_mailer.delivery_method = :smtp
90
- config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }
91
-
92
- ### PHP
93
-
94
- For projects using PHP, or PHP frameworks and application platforms like Drupal, you can set [PHP's mail configuration](http://www.php.net/manual/en/mail.configuration.php) in your [php.ini](http://www.php.net/manual/en/configuration.file.php) to send via MailCatcher with:
95
-
96
- sendmail_path = /usr/bin/env catchmail -f some@from.address
97
-
98
- You can do this in an [Apache htaccess file](http://php.net/manual/en/configuration.changes.php) or general configuration like so:
99
-
100
- php_value sendmail_path "/usr/bin/env catchmail -f some@from.address"
101
-
102
- If you've installed via RVM this probably won't work unless you've manually added your RVM bin paths to your system environment's PATH. In that case, run `which catchmail` and put that path into the `sendmail_path` directive above instead of `/usr/bin/env catchmail`.
103
-
104
- If starting `mailcatcher` on alternative SMTP IP and/or port with parameters like `--smtp-ip 192.168.0.1 --smtp-port 10025`, add the same parameters to your `catchmail` command:
105
-
106
- sendmail_path = /usr/bin/env catchmail --smtp-ip 192.160.0.1 --smtp-port 10025 -f some@from.address
107
-
108
- ### Django
109
-
110
- For use in Django, simply add the following configuration to your projects' settings.py
111
-
112
- ```python
113
- if DEBUG:
114
- EMAIL_HOST = '127.0.0.1'
115
- EMAIL_HOST_USER = ''
116
- EMAIL_HOST_PASSWORD = ''
117
- EMAIL_PORT = 1025
118
- EMAIL_USE_TLS = False
119
- ```
120
-
121
- ### API
122
-
123
- A fairly RESTful URL schema means you can download a list of messages in JSON from `/messages`, each message's metadata with `/messages/:id.json`, and then the pertinent parts with `/messages/:id.html` and `/messages/:id.plain` for the default HTML and plain text version, `/messages/:id/:cid` for individual attachments by CID, or the whole message with `/messages/:id.source`.
124
-
125
- ## Caveats
126
-
127
- * Mail processing is fairly basic but easily modified. If something doesn't work for you, fork and fix it or [file an issue][mailcatcher-issues] and let me know. Include the whole message you're having problems with.
128
- * The interface is very basic and has not been tested on many browsers yet.
129
-
130
- ## TODO
131
-
132
- * Add mail delivery on request, optionally multiple times.
133
- * Better Growl support in MacRuby and RubyCocoa with click notifications which takes you to the received message.
134
- * An API-compatible nodejs version, for fun and profit (and non-ruby npm users).
135
- * Test suite.
136
- * Compatibility testing against CampaignMonitor's [design guidelines](http://www.campaignmonitor.com/design-guidelines/) and [CSS support matrix](http://www.campaignmonitor.com/design-guidelines/).
137
- * Forward mail to rendering service, maybe CampaignMonitor?
138
- * Package as an app? Native interfaces? HotCocoa?
139
-
140
- ## Thanks
141
-
142
- MailCatcher is just a mishmash of other people's hard work. Thank you so much to the people who have built the wonderful guts on which this project relies.
143
-
144
- Thanks also to [The Frontier Group][tfg] for giving me the idea, being great guinea pigs and letting me steal pieces of time to keep the project alive.
145
-
146
- ## Donations
147
-
148
- I work on MailCatcher mostly in my own spare time. If you've found Mailcatcher useful and would like to help feed me and fund continued development and new features, please [donate via PayPal][donate]. If you'd like a specific feature added to MailCatcher and are willing to pay for it, please [email me](mailto:sj26@sj26.com).
149
-
150
- ## License
151
-
152
- Copyright © 2010-2011 Samuel Cochran (sj26@sj26.com). Released under the MIT License, see [LICENSE][license] for details.
153
-
154
- ## Dreams
155
-
156
- For dream catching, try [this](http://goo.gl/kgbh). OR [THIS](http://www.nyanicorn.com), OMG.
157
-
158
- [donate]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=522WUPLRWUSKE
159
- [fractal]: http://getfractal.com
160
- [license]: https://github.com/sj26/mailcatcher/blob/master/LICENSE
161
- [mailcatcher-github]: https://github.com/sj26/mailcatcher
162
- [mailcatcher-issues]: https://github.com/sj26/mailcatcher/issues
163
- [tfg]: http://www.thefrontiergroup.com.au
164
- [websockets]: http://www.whatwg.org/specs/web-socket-protocol/
165
- [withphp]: http://webschuur.com/publications/blogs/2011-05-29-catchmail_for_drupal_and_other_phpapplications_the_simple_version
1
+ # MailCatcher for JRuby
2
+
3
+ ## Usage for JRuby on Rails.
4
+
5
+ 1. Install
6
+ ```
7
+ gem install mailcatcher-jruby
8
+ ```
9
+
10
+ 2. Start the smpt server at port 9000
11
+
12
+ ```
13
+ mailcatcher
14
+ ```
15
+
16
+ use `--smtp-port 1080` to change the port to 1080
17
+
18
+ 3. Start Puma rack server to host web pages of emails at port 9090.
19
+ ```
20
+ mailweb
21
+ ```
22
+ add `-p 1080` to use port 1080
23
+
24
+ Open [http://127.0.0.1:9090](http://127.0.0.1:9090) to see emails.
25
+
26
+
27
+ 4. Configure rails.
28
+ To set up your rails app, I recommend adding this to your `environment/development.rb`:
29
+ ```
30
+ config.action_mailer.delivery_method = :smtp
31
+ config.action_mailer.smtp_settings = { :address => "127.0.0.1", :port =>
32
+ 9000 }
33
+ ```
34
+
35
+
36
+ # Original Documentation
37
+
38
+ # MailCatcher
39
+
40
+
41
+ Catches mail and serves it through a dream.
42
+
43
+ MailCatcher runs a super simple SMTP server which catches any message sent to it to display in a web interface. Run mailcatcher, set your favourite app to deliver to smtp://127.0.0.1:1025 instead of your default SMTP server, then check out http://127.0.0.1:1080 to see the mail that's arrived so far.
44
+
45
+ ![MailCatcher screenshot](http://f.cl.ly/items/3w2T1p0F3g003b2i1F2z/Screen%20shot%202011-06-23%20at%2011.39.03%20PM.png)
46
+
47
+ ## Features
48
+
49
+ * Catches all mail and stores it for display.
50
+ * Shows HTML, Plain Text and Source version of messages, as applicable.
51
+ * Rewrites HTML enabling display of embedded, inline images/etc and open links in a new window. (currently very basic)
52
+ * Can send HTML for analysis by [Fractal][fractal].
53
+ * Lists attachments and allows separate downloading of parts.
54
+ * Download original email to view in your native mail client(s).
55
+ * Command line options to override the default SMTP/HTTP IP and port settings.
56
+ * Mail appears instantly if your browser supports [WebSockets][websockets], otherwise updates every thirty seconds.
57
+ * Growl notifications when you receive a new message.
58
+ * Runs as a daemon run in the background.
59
+ * Sendmail-analogue command, `catchmail`, makes [using mailcatcher from PHP][withphp] a lot easier.
60
+ * Written super-simply in EventMachine, easy to dig in and change.
61
+ * Keyboard navigation between messages
62
+
63
+ ## How
64
+
65
+ 1. `gem install mailcatcher`
66
+ 2. `mailcatcher`
67
+ 3. Go to http://localhost:1080/
68
+ 4. Send mail through smtp://localhost:1025
69
+
70
+ The brave can get the source from [the GitHub repository][mailcatcher-github].
71
+
72
+ ### Bundler
73
+
74
+ Please don't put mailcatcher into your Gemfile. It will conflict with your applications gems at some point.
75
+
76
+ Instead, pop a note in your README stating you use mailcatcher. Simply run `gem install mailcatcher` then `mailcatcher` to get started.
77
+
78
+ ### RVM
79
+
80
+ Under RVM your mailcatcher command may only be available under the ruby you install mailcatcher into. To prevent this, and to prevent gem conflicts, install mailcatcher into a dedicated gemset and create wrapper scripts:
81
+
82
+ rvm default@mailcatcher --create do gem install mailcatcher
83
+ rvm wrapper default@mailcatcher --no-prefix mailcatcher catchmail
84
+
85
+ ### Rails
86
+
87
+ To set up your rails app, I recommend adding this to your `environment/development.rb`:
88
+
89
+ config.action_mailer.delivery_method = :smtp
90
+ config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }
91
+
92
+ ### PHP
93
+
94
+ For projects using PHP, or PHP frameworks and application platforms like Drupal, you can set [PHP's mail configuration](http://www.php.net/manual/en/mail.configuration.php) in your [php.ini](http://www.php.net/manual/en/configuration.file.php) to send via MailCatcher with:
95
+
96
+ sendmail_path = /usr/bin/env catchmail -f some@from.address
97
+
98
+ You can do this in an [Apache htaccess file](http://php.net/manual/en/configuration.changes.php) or general configuration like so:
99
+
100
+ php_value sendmail_path "/usr/bin/env catchmail -f some@from.address"
101
+
102
+ If you've installed via RVM this probably won't work unless you've manually added your RVM bin paths to your system environment's PATH. In that case, run `which catchmail` and put that path into the `sendmail_path` directive above instead of `/usr/bin/env catchmail`.
103
+
104
+ If starting `mailcatcher` on alternative SMTP IP and/or port with parameters like `--smtp-ip 192.168.0.1 --smtp-port 10025`, add the same parameters to your `catchmail` command:
105
+
106
+ sendmail_path = /usr/bin/env catchmail --smtp-ip 192.160.0.1 --smtp-port 10025 -f some@from.address
107
+
108
+ ### Django
109
+
110
+ For use in Django, simply add the following configuration to your projects' settings.py
111
+
112
+ ```python
113
+ if DEBUG:
114
+ EMAIL_HOST = '127.0.0.1'
115
+ EMAIL_HOST_USER = ''
116
+ EMAIL_HOST_PASSWORD = ''
117
+ EMAIL_PORT = 1025
118
+ EMAIL_USE_TLS = False
119
+ ```
120
+
121
+ ### API
122
+
123
+ A fairly RESTful URL schema means you can download a list of messages in JSON from `/messages`, each message's metadata with `/messages/:id.json`, and then the pertinent parts with `/messages/:id.html` and `/messages/:id.plain` for the default HTML and plain text version, `/messages/:id/:cid` for individual attachments by CID, or the whole message with `/messages/:id.source`.
124
+
125
+ ## Caveats
126
+
127
+ * Mail processing is fairly basic but easily modified. If something doesn't work for you, fork and fix it or [file an issue][mailcatcher-issues] and let me know. Include the whole message you're having problems with.
128
+ * The interface is very basic and has not been tested on many browsers yet.
129
+
130
+ ## TODO
131
+
132
+ * Add mail delivery on request, optionally multiple times.
133
+ * Better Growl support in MacRuby and RubyCocoa with click notifications which takes you to the received message.
134
+ * An API-compatible nodejs version, for fun and profit (and non-ruby npm users).
135
+ * Test suite.
136
+ * Compatibility testing against CampaignMonitor's [design guidelines](http://www.campaignmonitor.com/design-guidelines/) and [CSS support matrix](http://www.campaignmonitor.com/design-guidelines/).
137
+ * Forward mail to rendering service, maybe CampaignMonitor?
138
+ * Package as an app? Native interfaces? HotCocoa?
139
+
140
+ ## Thanks
141
+
142
+ MailCatcher is just a mishmash of other people's hard work. Thank you so much to the people who have built the wonderful guts on which this project relies.
143
+
144
+ Thanks also to [The Frontier Group][tfg] for giving me the idea, being great guinea pigs and letting me steal pieces of time to keep the project alive.
145
+
146
+ ## Donations
147
+
148
+ I work on MailCatcher mostly in my own spare time. If you've found Mailcatcher useful and would like to help feed me and fund continued development and new features, please [donate via PayPal][donate]. If you'd like a specific feature added to MailCatcher and are willing to pay for it, please [email me](mailto:sj26@sj26.com).
149
+
150
+ ## License
151
+
152
+ Copyright © 2010-2011 Samuel Cochran (sj26@sj26.com). Released under the MIT License, see [LICENSE][license] for details.
153
+
154
+ ## Dreams
155
+
156
+ For dream catching, try [this](http://goo.gl/kgbh). OR [THIS](http://www.nyanicorn.com), OMG.
157
+
158
+ [donate]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=522WUPLRWUSKE
159
+ [fractal]: http://getfractal.com
160
+ [license]: https://github.com/sj26/mailcatcher/blob/master/LICENSE
161
+ [mailcatcher-github]: https://github.com/sj26/mailcatcher
162
+ [mailcatcher-issues]: https://github.com/sj26/mailcatcher/issues
163
+ [tfg]: http://www.thefrontiergroup.com.au
164
+ [websockets]: http://www.whatwg.org/specs/web-socket-protocol/
165
+ [withphp]: http://webschuur.com/publications/blogs/2011-05-29-catchmail_for_drupal_and_other_phpapplications_the_simple_version
@@ -1,62 +1,62 @@
1
- #!/usr/bin/env ruby
2
-
3
- begin
4
- require 'mail'
5
- rescue LoadError
6
- require 'rubygems'
7
- require 'mail'
8
- end
9
-
10
- require 'optparse'
11
-
12
- options = {:smtp_ip => '127.0.0.1', :smtp_port => 9000}
13
-
14
- OptionParser.new do |parser|
15
- parser.banner = <<-BANNER.gsub /^ +/, ""
16
- Usage: catchmail [options]
17
- sendmail-like interface to forward mail to MailCatcher.
18
- BANNER
19
-
20
- parser.on('--ip IP') do |ip|
21
- options[:smtp_ip] = ip
22
- end
23
-
24
- parser.on('--smtp-ip IP', 'Set the ip address of the smtp server') do |ip|
25
- options[:smtp_ip] = ip
26
- end
27
-
28
- parser.on('--smtp-port PORT', Integer, 'Set the port of the smtp server') do |port|
29
- options[:smtp_port] = port
30
- end
31
-
32
- parser.on('-f FROM', 'Set the sending address') do |from|
33
- options[:from] = from
34
- end
35
-
36
- parser.on('-oi', 'Ignored option -oi') do |ignored|
37
- end
38
- parser.on('-t', 'Ignored option -t') do |ignored|
39
- end
40
- parser.on('-q', 'Ignored option -q') do |ignored|
41
- end
42
-
43
- parser.on('-x', '--no-exit', 'Can\'t exit from the application') do
44
- options[:no_exit] = true
45
- end
46
-
47
- parser.on('-h', '--help', 'Display this help information') do
48
- puts parser
49
- exit!
50
- end
51
- end.parse!
52
-
53
- Mail.defaults do
54
- delivery_method :smtp,
55
- :address => options[:smtp_ip],
56
- :port => options[:smtp_port]
57
- end
58
-
59
- message = Mail.new ARGF.read
60
- message.return_path = options[:from] if options[:from]
61
- puts 'Got email input, sending...'
62
- message.deliver
1
+ #!/usr/bin/env ruby
2
+
3
+ begin
4
+ require 'mail'
5
+ rescue LoadError
6
+ require 'rubygems'
7
+ require 'mail'
8
+ end
9
+
10
+ require 'optparse'
11
+
12
+ options = {:smtp_ip => '127.0.0.1', :smtp_port => 9000}
13
+
14
+ OptionParser.new do |parser|
15
+ parser.banner = <<-BANNER.gsub /^ +/, ""
16
+ Usage: catchmail [options]
17
+ sendmail-like interface to forward mail to MailCatcher.
18
+ BANNER
19
+
20
+ parser.on('--ip IP') do |ip|
21
+ options[:smtp_ip] = ip
22
+ end
23
+
24
+ parser.on('--smtp-ip IP', 'Set the ip address of the smtp server') do |ip|
25
+ options[:smtp_ip] = ip
26
+ end
27
+
28
+ parser.on('--smtp-port PORT', Integer, 'Set the port of the smtp server') do |port|
29
+ options[:smtp_port] = port
30
+ end
31
+
32
+ parser.on('-f FROM', 'Set the sending address') do |from|
33
+ options[:from] = from
34
+ end
35
+
36
+ parser.on('-oi', 'Ignored option -oi') do |ignored|
37
+ end
38
+ parser.on('-t', 'Ignored option -t') do |ignored|
39
+ end
40
+ parser.on('-q', 'Ignored option -q') do |ignored|
41
+ end
42
+
43
+ parser.on('-x', '--no-exit', 'Can\'t exit from the application') do
44
+ options[:no_exit] = true
45
+ end
46
+
47
+ parser.on('-h', '--help', 'Display this help information') do
48
+ puts parser
49
+ exit!
50
+ end
51
+ end.parse!
52
+
53
+ Mail.defaults do
54
+ delivery_method :smtp,
55
+ :address => options[:smtp_ip],
56
+ :port => options[:smtp_port]
57
+ end
58
+
59
+ message = Mail.new ARGF.read
60
+ message.return_path = options[:from] if options[:from]
61
+ puts 'Got email input, sending...'
62
+ message.deliver