bitlove-tlsmail 0.0.2

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.
@@ -0,0 +1,30 @@
1
+ require "net/smtp"
2
+ require "net/pop"
3
+ # If smtp or pop is already loaded, remove all constants.
4
+ module Net
5
+ if defined?(SMTP)
6
+ SMTP.class_eval do remove_const(:Revision) end
7
+ [:SMTP, :SMTPSession].each do |c|
8
+ remove_const(c) if constants.include?(c.to_s)
9
+ end
10
+ end
11
+ if defined?(POP)
12
+ POP.class_eval do remove_const(:Revision) end
13
+ [:POP, :POPSession, :POP3Session, :APOPSession].each do |c|
14
+ remove_const(c) if constants.include?(c.to_s)
15
+ end
16
+ end
17
+ end
18
+
19
+ load File.dirname(__FILE__) + "/net/smtp.rb"
20
+ load File.dirname(__FILE__) + "/net/pop.rb"
21
+
22
+ Net::SMTP.class_eval do
23
+ def quit # gmail smtp server disconnects as soon as get quit message.
24
+ begin
25
+ getok('QUIT')
26
+ rescue EOFError
27
+ end
28
+ end
29
+ end
30
+
@@ -0,0 +1,10 @@
1
+ # This file is a template for parameters.rb
2
+ # Copy this file and change variables below.
3
+ SMTP_SERVER = "smtp.gmail.com"
4
+ SMTP_PORT = "587"
5
+ POP_SERVER = "pop.gmail.com"
6
+ POP_PORT = "995"
7
+ DOMAIN = "localhost.localdomain"
8
+ AUTH = :plain
9
+ USER = "XXXXXXXXXXXX@gmail.com"
10
+ PASS = "ZZZZZZZZZZ"
@@ -0,0 +1,4 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
2
+ require 'test/unit'
3
+ require File.dirname(__FILE__) + '/../lib/tlsmail'
4
+ require "parameters"
@@ -0,0 +1,34 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+
3
+ class TlsmailTest < Test::Unit::TestCase
4
+
5
+ def setup
6
+ end
7
+
8
+ def test_truth
9
+ assert true
10
+ end
11
+
12
+ def test_send_mail
13
+ require "time"
14
+ msgstr = <<END_OF_MESSAGE
15
+ From: Your Name <#{USER}@gmail.com>
16
+ To: Destination Address <#{USER}@gmail.com>
17
+ Subject: test message
18
+ Date: #{Time.now.rfc2822}
19
+
20
+ test message.
21
+ END_OF_MESSAGE
22
+ Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)
23
+ Net::SMTP.start(SMTP_SERVER, SMTP_PORT, DOMAIN, USER, PASS, AUTH) do |smtp|
24
+ smtp.send_message msgstr, "#{USER}@gmail.com", "#{USER}@gmail.com"
25
+ end
26
+ end
27
+
28
+ def test_receive_mail
29
+ Net::POP.enable_ssl(OpenSSL::SSL::VERIFY_NONE)
30
+ Net::POP.start(POP_SERVER, POP_PORT, USER, PASS) do |pop|
31
+ p pop.mails[0].pop
32
+ end
33
+ end
34
+ end
metadata ADDED
@@ -0,0 +1,57 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bitlove-tlsmail
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - zorio
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2007-03-17 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: This library enables pop or smtp via ssl/tls by dynamically replacing
15
+ these classes to these in ruby 1.9.
16
+ email: zoriorz@gmail.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - Rakefile
22
+ - README.txt
23
+ - CHANGELOG.txt
24
+ - Manifest.txt
25
+ - lib/tlsmail.rb
26
+ - lib/net/pop.rb
27
+ - lib/net/smtp.rb
28
+ - test/test_helper.rb
29
+ - test/tlsmail_test.rb
30
+ - test/template.parameters.rb
31
+ homepage: http://tlsmail.rubyforge.org
32
+ licenses: []
33
+ post_install_message:
34
+ rdoc_options: []
35
+ require_paths:
36
+ - lib
37
+ required_ruby_version: !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ! '>'
41
+ - !ruby/object:Gem::Version
42
+ version: 0.0.0
43
+ required_rubygems_version: !ruby/object:Gem::Requirement
44
+ none: false
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ requirements: []
50
+ rubyforge_project: tlsmail
51
+ rubygems_version: 1.8.10
52
+ signing_key:
53
+ specification_version: 1
54
+ summary: This library enables pop or smtp via ssl/tls by dynamically replacing these
55
+ classes to these in ruby 1.9.
56
+ test_files:
57
+ - test/tlsmail_test.rb