actionmailer-javamail 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -6
- data/README.txt +12 -2
- data/lib/java_mail.rb +1 -1
- data/lib/java_mail/config.rb +4 -4
- metadata +1 -1
data/History.txt
CHANGED
@@ -1,11 +1,10 @@
|
|
1
|
+
=== 0.1.1 / 2009-05-10
|
2
|
+
|
3
|
+
* Google App Engine support
|
4
|
+
|
1
5
|
=== 0.1.0 / 2009-05-07
|
2
6
|
|
3
7
|
* Initial release
|
4
8
|
* Support for SMTP and SMTPS (over SSL)
|
5
|
-
* [Experimental] Untested support for Google App Engine
|
6
9
|
* Support for DKIM message signing
|
7
|
-
* Support for authentication
|
8
|
-
|
9
|
-
* Coming soon
|
10
|
-
* Google App Engine verification
|
11
|
-
* Unit tests
|
10
|
+
* Support for authentication
|
data/README.txt
CHANGED
@@ -31,7 +31,7 @@ In your config/environment.rb, add the following:
|
|
31
31
|
|
32
32
|
config.gem "actionmailer-javamail", :lib => 'java_mail' if defined?(JRUBY_VERSION)
|
33
33
|
|
34
|
-
In one of your config/
|
34
|
+
In one of your config/initializers files, add the following:
|
35
35
|
|
36
36
|
ActionMailer::Base.delivery_method = :javamail
|
37
37
|
ActionMailer::Base.javamail_settings = {
|
@@ -44,7 +44,7 @@ In one of your config/initializer files, add the following:
|
|
44
44
|
:dkim => { :domain => 'mydomain.com', :selector => 'mysel', :key_file => KEY_FILE_PATH }
|
45
45
|
}
|
46
46
|
|
47
|
-
:protocol - the possible values are :smtp, :smtps, :
|
47
|
+
:protocol - the possible values are :smtp, :smtps, or :gm. (:gm is the Google App Engine protocol)
|
48
48
|
:address - allows you to use a remote server
|
49
49
|
:port - currently a required option for SMTP port
|
50
50
|
:domain - domain to be specified in HELO command
|
@@ -52,6 +52,16 @@ In one of your config/initializer files, add the following:
|
|
52
52
|
:password - password for server authentication
|
53
53
|
:dkim - (optional) arguments for DKIM signing. Key file needs to be in DER format
|
54
54
|
|
55
|
+
== GOOGLE APP ENGINE:
|
56
|
+
|
57
|
+
ActionMailer-JavaMail allows to interface with the Mail API within the Google App Engine.
|
58
|
+
Below is the simple configuration that you should place in a config/initializers file:
|
59
|
+
|
60
|
+
ActionMailer::Base.delivery_method = :javamail
|
61
|
+
ActionMailer::Base.javamail_settings = { :protocol => :gm }
|
62
|
+
|
63
|
+
That's it!
|
64
|
+
|
55
65
|
== REFERENCES:
|
56
66
|
|
57
67
|
* The gem includes a copy of DKIM message signing library
|
data/lib/java_mail.rb
CHANGED
@@ -26,7 +26,7 @@ $:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) ||
|
|
26
26
|
require 'java'
|
27
27
|
|
28
28
|
module JavaMail
|
29
|
-
VERSION = '0.1.
|
29
|
+
VERSION = '0.1.1'
|
30
30
|
|
31
31
|
unless defined?(JAVAMAIL_HOME)
|
32
32
|
JAVAMAIL_HOME = File.expand_path(File.dirname(__FILE__) + '/..')
|
data/lib/java_mail/config.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
module JavaMail
|
2
2
|
class Config
|
3
|
+
PROTOCOLS = [:smtp, :smtps, :gm]
|
4
|
+
|
3
5
|
def initialize(settings = {})
|
4
6
|
@settings = settings
|
5
|
-
@settings[:protocol] ||= :none
|
6
7
|
|
7
|
-
unless
|
8
|
-
raise JavaMailError.new("
|
8
|
+
unless PROTOCOLS.include?(@settings[:protocol])
|
9
|
+
raise JavaMailError.new("Protocol #{@settings[:protocol].inspect} is not one of the supported protocols: #{PROTOCOLS.inspect}")
|
9
10
|
end
|
10
11
|
end
|
11
12
|
|
12
13
|
def session_properties
|
13
14
|
props = java.util.Properties.new()
|
14
|
-
return props if @mode == :none
|
15
15
|
|
16
16
|
# We only support SMTP (plan and SSL) for now
|
17
17
|
props.put('mail.transport.protocol', @settings[:protocol].to_s);
|