mailhandler 1.0.57 → 1.0.60

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
  SHA256:
3
- metadata.gz: eb1c79224a2d06818e5fe0d17efb43582e3bc4493e0a96059ade1ce0a040210d
4
- data.tar.gz: 65a3032f84a5f0485b8d9e59768d3641d74ffeb32731d06854e18828fb975211
3
+ metadata.gz: 8030c60b3dadc77214d7a1bfc8c5bc475a3665586b22d01b1a0973c8386de30f
4
+ data.tar.gz: 5c782690c6dc90db551254b3e3e8ab007717b15961143b0d9a6251a0f34a2731
5
5
  SHA512:
6
- metadata.gz: b95a623ebf0d6c1d06f2f8de30ff4f8123ae0cb9d5bde77d2b61f088af958154bf1c7626db84137cd5ded7e3734b79ad0fda345cec2f88e8784583c9aeb8706d
7
- data.tar.gz: 33e8d8113c5bdc964564a034c9113a98ad571acc1fd824448a6b6def2363c82b8e72dc98bcd15042ae0656cf27d84cedd698d0d61541688dd80ff4b4ad44ea22
6
+ metadata.gz: f61717a2295a6cfe5f6d961fa9dbffae6f0e6e77a2fe93f667a4838cd55cebb3dba6835182d6d9f41b1f7032afcb146e25db05f97503486e0dfe06f3184dc416
7
+ data.tar.gz: 1fb736635cf0608cd3d438598ef1c5f0aa1d1c6f60a7b1bcde6b61a840b30512e72ccb3f7686ad0d685317e663ee7a5bd558a9e63c9db2419f67d48a4af1743d
@@ -0,0 +1,43 @@
1
+ version: 2.1
2
+
3
+ workflows:
4
+ ruby-tests:
5
+ jobs:
6
+ - unit-tests:
7
+ name: ruby24
8
+ version: "2.4.6"
9
+ - unit-tests:
10
+ name: ruby25
11
+ version: "2.5.5"
12
+ requires:
13
+ - ruby24
14
+ - unit-tests:
15
+ name: ruby27
16
+ version: "2.7.5"
17
+ requires:
18
+ - ruby25
19
+ - unit-tests:
20
+ name: ruby30
21
+ version: "3.0.0"
22
+ requires:
23
+ - ruby27
24
+
25
+ jobs:
26
+ unit-tests:
27
+ parameters:
28
+ version:
29
+ type: string
30
+ docker:
31
+ - image: cimg/ruby:<< parameters.version >>
32
+ steps:
33
+ - checkout
34
+ - run:
35
+ name: Versions
36
+ command: |
37
+ echo "ruby: $(ruby --version)"
38
+ - run:
39
+ name: Install dependencies
40
+ command: bundle install
41
+ - run:
42
+ name: Run tests
43
+ command: bundle exec rspec
data/LICENSE CHANGED
@@ -1,7 +1,7 @@
1
1
  MailHandler
2
2
 
3
- https://github.com/wildbit/mailhandler
4
- Copyright (c) 2016 Balos Igor
3
+ https://github.com/ActiveCampaign/mailhandler
4
+ Copyright (c) 2022 Balos Igor
5
5
 
6
6
  The MIT License
7
7
 
@@ -0,0 +1,22 @@
1
+ module Mail
2
+ # wrapper methods to support sending raw email, where recipient and sender can be custom
3
+ class SMTP
4
+ def deliver_raw!(raw_source_email, smtp_from, smtp_to)
5
+ response = start_smtp_session do |smtp|
6
+ Mail::SMTPConnection.new(:connection => smtp, :return_response => true).
7
+ deliver_raw!(raw_source_email, smtp_from, smtp_to)
8
+ end
9
+
10
+ settings[:return_response] ? response : self
11
+ end
12
+ end
13
+
14
+ # wrapper methods to support sending raw email, where recipient and sender can be custom
15
+ class SMTPConnection
16
+ def deliver_raw!(raw_source_email, smtp_from, smtp_to)
17
+ response = smtp.sendmail(dot_stuff(raw_source_email), smtp_from, smtp_to)
18
+
19
+ settings[:return_response] ? response : self
20
+ end
21
+ end
22
+ end
@@ -17,7 +17,7 @@ module MailHandler
17
17
  @type = :postmark_api
18
18
  @host = DEFAULTS[:host]
19
19
  @api_token = api_token
20
- @use_ssl = false
20
+ @use_ssl = true
21
21
 
22
22
  @http_open_timeout = DEFAULTS[:open_timeout]
23
23
  @http_read_timeout = DEFAULTS[:read_timeout]
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'base'
4
+ require_relative "../extensions/mail/smtp"
4
5
 
5
6
  module MailHandler
6
7
  module Sending
@@ -22,7 +23,7 @@ module MailHandler
22
23
  def initialize
23
24
  @type = :smtp
24
25
  @authentication = 'plain'
25
- @use_ssl = false
26
+ @use_ssl = true
26
27
  @save_response = true
27
28
 
28
29
  @open_timeout = 60
@@ -36,10 +37,8 @@ module MailHandler
36
37
  end
37
38
 
38
39
  def send_raw_email(text_email, smtp_from, smtp_to)
39
- response = init_net_smtp.start(domain, username, password, authentication) do |smtp|
40
- smtp.send_message(text_email, smtp_from, smtp_to)
41
- end
42
-
40
+ # use same settings as when sending mail created with Mail gem
41
+ response = Mail::SMTP.new(delivery_options).deliver_raw!(text_email, smtp_from, smtp_to)
43
42
  save_response ? response : nil
44
43
  end
45
44
 
@@ -54,14 +53,6 @@ module MailHandler
54
53
 
55
54
  private
56
55
 
57
- def init_net_smtp
58
- sending = Net::SMTP.new(address, port)
59
- sending.read_timeout = read_timeout
60
- sending.open_timeout = open_timeout
61
- sending.enable_starttls_auto if use_ssl
62
- sending
63
- end
64
-
65
56
  def configure_sending(email)
66
57
  email.delivery_method :smtp, delivery_options
67
58
  email
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MailHandler
4
- VERSION = '1.0.57'
4
+ VERSION = '1.0.60'
5
5
  end
data/mailhandler.gemspec CHANGED
@@ -11,14 +11,14 @@ Gem::Specification.new do |s|
11
11
  s.license = 'MIT'
12
12
 
13
13
  s.authors = ['Igor Balos']
14
- s.email = ['ibalosh@gmail.com', 'igor@wildbit.com']
14
+ s.email = ['ibalosh@gmail.com', 'ibalos@activecampaign.com']
15
15
 
16
16
  s.summary = 'Postmark email receiving and sending handler.'
17
17
  s.description = 'Use this gem to send emails through SMTP and Postmark API and check if email arrived.'
18
18
 
19
19
  s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
20
20
  s.test_files = `git ls-files -- {spec}/*`.split("\n")
21
- s.homepage = 'https://github.com/wildbit/mailhandler'
21
+ s.homepage = 'https://github.com/ActiveCampaign/mailhandler'
22
22
  s.require_paths = ['lib']
23
23
 
24
24
  s.post_install_message = '
data/postmark.png ADDED
Binary file
data/readme.md CHANGED
@@ -1,10 +1,12 @@
1
- <img src="http://assets.wildbit.com/postmark/misc/mailhandler-logo@2x.png" alt="MailHandler Logo" title="MailHandler" width="148" height="148" align="right">
1
+ <a href="https://postmarkapp.com">
2
+ <img src="postmark.png" alt="Postmark Logo" title="Postmark" width="120" height="120" align="right">
3
+ </a>
2
4
 
3
5
  # MailHandler Gem
4
6
 
5
- [![Build Status](https://travis-ci.org/wildbit/mailhandler.svg?branch=master)](https://travis-ci.org/wildbit/mailhandler)
7
+ [![Build Status](https://circleci.com/gh/ActiveCampaign/mailhandler.svg?style=shield)](https://circleci.com/gh/ActiveCampaign/mailhandler)
6
8
 
7
- MailHandler is a simple wrapper on top of [Mail gem](https://github.com/mikel/mail) and [Postmark gem](https://github.com/wildbit/postmark-gem) libraries. It allows you to send and retrieve emails and at the same time get details on how long these operations took.
9
+ MailHandler is a simple wrapper on top of [Mail gem](https://github.com/mikel/mail) and [Postmark gem](https://github.com/ActiveCampaign/postmark-gem) libraries. It allows you to send and retrieve emails and at the same time get details on how long these operations took.
8
10
  Main purpose of the gem is easier email sending/delivery testing with notification option if sending or retrieving email is taking too long.
9
11
 
10
12
  The library supports sending email by standard SMTP protocol and by Postmark API. More importantly it also allows checking email delivery by IMAP protocol, or by folder if you have a local mailbox.
@@ -195,7 +197,7 @@ Once email sending is finished, you can check sending result by looking at: `ema
195
197
 
196
198
  ### License
197
199
 
198
- MailHandler Library is licensed under the [MIT](http://www.opensource.org/licenses/mit-license.php "Read more about the MIT license form") license. Refere to the [LICENSE](https://github.com/wildbit/mailhandler/blob/master/LICENSE) file for more information.
200
+ MailHandler Library is licensed under the [MIT](http://www.opensource.org/licenses/mit-license.php "Read more about the MIT license form") license. Refere to the [LICENSE](https://github.com/ActiveCampaign/mailhandler/blob/master/LICENSE) file for more information.
199
201
 
200
202
 
201
203
 
@@ -13,7 +13,7 @@ describe MailHandler::Sending::PostmarkBatchAPISender do
13
13
  aggregate_failures 'init details' do
14
14
  expect(sender.api_token).to eq api_token
15
15
  expect(sender.type).to eq :postmark_api
16
- expect(sender.use_ssl).to be false
16
+ expect(sender.use_ssl).to be true
17
17
  expect(sender.host).to eq 'api.postmarkapp.com'
18
18
  end
19
19
  end
@@ -13,7 +13,7 @@ describe MailHandler::Sending::PostmarkAPISender do
13
13
  aggregate_failures 'init details' do
14
14
  expect(sender.api_token).to eq api_token
15
15
  expect(sender.type).to eq :postmark_api
16
- expect(sender.use_ssl).to be false
16
+ expect(sender.use_ssl).to be true
17
17
  expect(sender.host).to eq 'api.postmarkapp.com'
18
18
  end
19
19
  end
@@ -32,7 +32,7 @@ describe MailHandler::Sending::SMTPSender do
32
32
  end
33
33
 
34
34
  it 'use ssl' do
35
- expect(smtp_sender.new.use_ssl).to be false
35
+ expect(smtp_sender.new.use_ssl).to be true
36
36
  end
37
37
 
38
38
  it 'authentication' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailhandler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.57
4
+ version: 1.0.60
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Balos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-15 00:00:00.000000000 Z
11
+ date: 2022-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mail
@@ -42,20 +42,21 @@ description: Use this gem to send emails through SMTP and Postmark API and check
42
42
  email arrived.
43
43
  email:
44
44
  - ibalosh@gmail.com
45
- - igor@wildbit.com
45
+ - ibalos@activecampaign.com
46
46
  executables: []
47
47
  extensions: []
48
48
  extra_rdoc_files: []
49
49
  files:
50
+ - ".circleci/config.yml"
50
51
  - ".gitignore"
51
52
  - ".rubocop.yml"
52
- - ".travis.yml"
53
53
  - Gemfile
54
54
  - LICENSE
55
55
  - Rakefile
56
56
  - lib/mailhandler.rb
57
57
  - lib/mailhandler/errors.rb
58
58
  - lib/mailhandler/extensions/mail/imap.rb
59
+ - lib/mailhandler/extensions/mail/smtp.rb
59
60
  - lib/mailhandler/receiver.rb
60
61
  - lib/mailhandler/receiving/base.rb
61
62
  - lib/mailhandler/receiving/filelist/base.rb
@@ -75,6 +76,7 @@ files:
75
76
  - lib/mailhandler/sending/smtp.rb
76
77
  - lib/mailhandler/version.rb
77
78
  - mailhandler.gemspec
79
+ - postmark.png
78
80
  - readme.md
79
81
  - spec/data/email-uni1.txt
80
82
  - spec/data/email-uni2.txt
@@ -93,7 +95,7 @@ files:
93
95
  - spec/unit/mailhandler/sending/sender_api_spec.rb
94
96
  - spec/unit/mailhandler/sending/sender_smtp_spec.rb
95
97
  - spec/unit/mailhandler_spec.rb
96
- homepage: https://github.com/wildbit/mailhandler
98
+ homepage: https://github.com/ActiveCampaign/mailhandler
97
99
  licenses:
98
100
  - MIT
99
101
  metadata: {}
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.0.0
4
- - 2.1.6
5
- - 2.2.2
6
-
7
- script: bundle exec rake