smtp_mock 1.1.0 → 1.2.0

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: 6609f9f6630224a07d5f7326e569a4dede87bd77d68a06ce5087a3aed8e2e7cb
4
- data.tar.gz: 16f4fdd27fa57274e8768e4111c4710d04640c0624a9f34b6caf0e4bc07b82ab
3
+ metadata.gz: 61d44a5dae5f6ba3f2a8b9dfea9ef79f66d87cc229d0f2b67351e93898e81c99
4
+ data.tar.gz: 211930e92b9075fb4d0afbb70729814344752ceb5a8839408f4d0e24449cae0e
5
5
  SHA512:
6
- metadata.gz: 715a635bd7592994cd52a99b8b3cc638eec058720ebe6fd846d58d2ebfc73404908044f51149a5a9138e3fbf1ba595c1a03de1b64af228218d1a11e4ffdf7218
7
- data.tar.gz: a2fe9ea5c0769b9796dd9117ff2290047a48f61b145276fc6bedb64e775ac1cc57c9fc56abe028adb5891b8021f0eda53e20162e86309617824152c444ba4a3f
6
+ metadata.gz: 8d3615059b8c883c0cb3fb71be0bcabb7bdd1c31489d2e2c2585aaa81823f83f6386dfaff15b17854bc22ffd7224514e15765a52556c8e5a08cc6d55d969da3c
7
+ data.tar.gz: 4a58ac1a1e53a7b04f204dae54ee57d572189d02f2a09b0c73cd3d3e76ccddd86bd7dda95dc1e00a10b7411cbb704c8801c7e8285507bda915a0f8538dd0761e
data/.circleci/config.yml CHANGED
@@ -6,7 +6,7 @@ defaults: &defaults
6
6
  - image: cimg/ruby:<< parameters.ruby-version >>
7
7
 
8
8
  orbs:
9
- ruby: circleci/ruby@1.7.1
9
+ ruby: circleci/ruby@1.8.0
10
10
 
11
11
  references:
12
12
  restore_bundle_cache: &restore_bundle_cache
@@ -122,7 +122,7 @@ jobs:
122
122
  - checkout
123
123
  - <<: *use_compatible_gemspec
124
124
  - ruby/install-deps:
125
- bundler-version: "2.3.13"
125
+ bundler-version: "2.3.18"
126
126
  with-cache: false
127
127
  path: './vendor/custom_bundle'
128
128
  - <<: *system_dependencies
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
 
32
32
  spec.add_runtime_dependency 'dry-struct', '~> 1.4'
33
33
 
34
- spec.add_development_dependency 'bundler-audit', '~> 0.9.0.1'
34
+ spec.add_development_dependency 'bundler-audit', '~> 0.9.1'
35
35
  spec.add_development_dependency 'fasterer', '~> 0.10.0'
36
36
  spec.add_development_dependency 'ffaker', '~> 2.21'
37
37
  spec.add_development_dependency 'net-smtp', '~> 0.3.1'
@@ -40,8 +40,8 @@ Gem::Specification.new do |spec|
40
40
  spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
41
41
  spec.add_development_dependency 'reek', '~> 6.1', '>= 6.1.1'
42
42
  spec.add_development_dependency 'rspec', '~> 3.11'
43
- spec.add_development_dependency 'rubocop', '~> 1.29', '>= 1.29.1'
44
- spec.add_development_dependency 'rubocop-performance', '~> 1.13', '>= 1.13.3'
45
- spec.add_development_dependency 'rubocop-rspec', '~> 2.10'
43
+ spec.add_development_dependency 'rubocop', '~> 1.32'
44
+ spec.add_development_dependency 'rubocop-performance', '~> 1.14', '>= 1.14.3'
45
+ spec.add_development_dependency 'rubocop-rspec', '~> 2.12', '>= 2.12.1'
46
46
  spec.add_development_dependency 'simplecov', '~> 0.21.2'
47
47
  end
data/.codeclimate.yml CHANGED
@@ -7,7 +7,7 @@ checks:
7
7
  plugins:
8
8
  rubocop:
9
9
  enabled: true
10
- channel: rubocop-1-29
10
+ channel: rubocop-1-32
11
11
 
12
12
  reek:
13
13
  enabled: true
data/.rubocop.yml CHANGED
@@ -6,6 +6,9 @@ AllCops:
6
6
  DisplayCopNames: true
7
7
  DisplayStyleGuide: true
8
8
  TargetRubyVersion: 2.5
9
+ NewCops: enable
10
+
11
+ # Metrics ---------------------------------------------------------------------
9
12
 
10
13
  Metrics/ClassLength:
11
14
  Max: 150
@@ -22,6 +25,8 @@ Metrics/CyclomaticComplexity:
22
25
  Metrics/PerceivedComplexity:
23
26
  Enabled: false
24
27
 
28
+ # Naming ----------------------------------------------------------------------
29
+
25
30
  Naming/VariableNumber:
26
31
  Enabled: false
27
32
 
@@ -31,8 +36,7 @@ Naming/RescuedExceptionsVariableName:
31
36
  Naming/InclusiveLanguage:
32
37
  Enabled: false
33
38
 
34
- Naming/BlockForwarding:
35
- Enabled: true
39
+ # Style -----------------------------------------------------------------------
36
40
 
37
41
  Style/Documentation:
38
42
  Enabled: false
@@ -49,147 +53,11 @@ Style/ParallelAssignment:
49
53
  Style/RescueStandardError:
50
54
  Enabled: false
51
55
 
52
- Style/HashEachMethods:
53
- Enabled: true
54
-
55
- Style/HashTransformKeys:
56
- Enabled: true
57
-
58
- Style/HashTransformValues:
59
- Enabled: true
60
-
61
- Style/AccessorGrouping:
62
- Enabled: true
63
-
64
- Style/ArrayCoercion:
65
- Enabled: true
66
-
67
- Style/BisectedAttrAccessor:
68
- Enabled: true
69
-
70
- Style/CaseLikeIf:
71
- Enabled: true
72
-
73
- Style/ExponentialNotation:
74
- Enabled: true
75
-
76
- Style/HashAsLastArrayItem:
77
- Enabled: true
78
-
79
- Style/HashLikeCase:
80
- Enabled: true
81
-
82
- Style/RedundantAssignment:
83
- Enabled: true
84
-
85
- Style/RedundantFetchBlock:
86
- Enabled: true
87
-
88
- Style/RedundantFileExtensionInRequire:
89
- Enabled: true
90
-
91
- Style/RedundantRegexpCharacterClass:
92
- Enabled: true
93
-
94
- Style/RedundantRegexpEscape:
95
- Enabled: true
96
-
97
- Style/SlicingWithRange:
98
- Enabled: true
99
-
100
- Style/ArgumentsForwarding:
101
- Enabled: true
102
-
103
- Style/CollectionCompact:
104
- Enabled: true
105
-
106
- Style/DocumentDynamicEvalDefinition:
107
- Enabled: true
108
-
109
- Style/NegatedIfElseCondition:
110
- Enabled: true
111
-
112
- Style/NilLambda:
113
- Enabled: true
114
-
115
- Style/RedundantArgument:
116
- Enabled: true
117
-
118
- Style/SwapValues:
119
- Enabled: true
120
-
121
- Style/EndlessMethod:
122
- Enabled: true
123
-
124
- Style/HashExcept:
125
- Enabled: true
126
-
127
- Style/IfWithBooleanLiteralBranches:
128
- Enabled: true
129
-
130
- Style/HashConversion:
131
- Enabled: true
132
-
133
- Style/StringChars:
134
- Enabled: true
135
-
136
- Style/InPatternThen:
137
- Enabled: true
138
-
139
- Style/MultilineInPatternThen:
140
- Enabled: true
141
-
142
- Style/QuotedSymbols:
143
- Enabled: true
144
-
145
- Style/RedundantSelfAssignmentBranch:
146
- Enabled: true
147
-
148
- Style/NumberedParameters:
149
- Enabled: true
150
-
151
- Style/NumberedParametersLimit:
152
- Enabled: true
153
-
154
- Style/SelectByRegexp:
155
- Enabled: true
156
-
157
- Style/FileRead:
158
- Enabled: true
159
-
160
- Style/FileWrite:
161
- Enabled: true
162
-
163
- Style/MapToHash:
164
- Enabled: true
165
-
166
- Style/OpenStructUse:
167
- Enabled: true
168
-
169
- Style/NestedFileDirname:
170
- Enabled: true
171
-
172
- Style/EnvHome:
173
- Enabled: true
174
-
175
- Style/FetchEnvVar:
176
- Enabled: true
177
-
178
- Style/ObjectThen:
179
- Enabled: true
180
-
181
- Style/RedundantInitialize:
182
- Enabled: true
56
+ # Layout ----------------------------------------------------------------------
183
57
 
184
58
  Layout/LineLength:
185
59
  Max: 150
186
60
 
187
- Layout/EmptyLinesAroundAttributeAccessor:
188
- Enabled: true
189
-
190
- Layout/SpaceAroundMethodCallOperator:
191
- Enabled: true
192
-
193
61
  Layout/ClassStructure:
194
62
  Enabled: true
195
63
  Categories:
@@ -209,164 +77,17 @@ Layout/ClassStructure:
209
77
  Layout/EmptyLineAfterGuardClause:
210
78
  Enabled: false
211
79
 
212
- Layout/SpaceBeforeBrackets:
213
- Enabled: true
214
-
215
- Layout/LineEndStringConcatenationIndentation:
216
- Enabled: true
217
-
218
- Lint/NonDeterministicRequireOrder:
219
- Enabled: true
220
-
221
- Lint/DeprecatedOpenSSLConstant:
222
- Enabled: true
223
-
224
- Lint/DuplicateElsifCondition:
225
- Enabled: true
226
-
227
- Lint/MixedRegexpCaptureTypes:
228
- Enabled: true
229
-
230
- Lint/RaiseException:
231
- Enabled: true
232
-
233
- Lint/StructNewOverride:
234
- Enabled: true
235
-
236
- Lint/DuplicateBranch:
237
- Enabled: true
238
-
239
- Lint/DuplicateRegexpCharacterClassElement:
240
- Enabled: true
241
-
242
- Lint/EmptyBlock:
243
- Enabled: true
244
-
245
- Lint/EmptyClass:
246
- Enabled: true
247
-
248
- Lint/NoReturnInBeginEndBlocks:
249
- Enabled: true
250
-
251
- Lint/ToEnumArguments:
252
- Enabled: true
253
-
254
- Lint/UnexpectedBlockArity:
255
- Enabled: true
256
-
257
- Lint/AmbiguousAssignment:
258
- Enabled: true
259
-
260
- Lint/DeprecatedConstants:
261
- Enabled: true
262
-
263
- Lint/LambdaWithoutLiteralBlock:
264
- Enabled: true
265
-
266
- Lint/RedundantDirGlobSort:
267
- Enabled: true
268
-
269
- Lint/UnmodifiedReduceAccumulator:
270
- Enabled: true
271
-
272
- Lint/NumberedParameterAssignment:
273
- Enabled: true
274
-
275
- Lint/OrAssignmentToConstant:
276
- Enabled: true
277
-
278
- Lint/SymbolConversion:
279
- Enabled: true
280
-
281
- Lint/TripleQuotes:
282
- Enabled: true
283
-
284
- Lint/EmptyInPattern:
285
- Enabled: true
286
-
287
- Lint/AmbiguousRange:
288
- Enabled: true
289
-
290
- Lint/AmbiguousOperatorPrecedence:
291
- Enabled: true
292
-
293
- Lint/IncompatibleIoSelectWithFiberScheduler:
294
- Enabled: true
295
-
296
- Lint/RequireRelativeSelfPath:
297
- Enabled: true
298
-
299
- Lint/RefinementImportMethods:
300
- Enabled: true
301
-
302
- Lint/UselessRuby2Keywords:
303
- Enabled: true
304
-
305
- Gemspec/DateAssignment:
306
- Enabled: true
80
+ # Gemspec ---------------------------------------------------------------------
307
81
 
308
82
  Gemspec/RequireMFA:
309
83
  Enabled: false
310
84
 
311
- Security/IoMethods:
312
- Enabled: true
313
-
314
- Security/CompoundHash:
315
- Enabled: true
316
-
317
- Performance/AncestorsInclude:
318
- Enabled: true
319
-
320
- Performance/BigDecimalWithNumericArgument:
321
- Enabled: true
322
-
323
- Performance/RedundantSortBlock:
324
- Enabled: true
325
-
326
- Performance/RedundantStringChars:
327
- Enabled: true
328
-
329
- Performance/ReverseFirst:
330
- Enabled: true
331
-
332
- Performance/SortReverse:
333
- Enabled: true
334
-
335
- Performance/Squeeze:
336
- Enabled: true
337
-
338
- Performance/StringInclude:
339
- Enabled: true
340
-
341
- Performance/BlockGivenWithExplicitBlock:
342
- Enabled: true
343
-
344
- Performance/CollectionLiteralInLoop:
345
- Enabled: true
346
-
347
- Performance/ConstantRegexp:
348
- Enabled: true
85
+ # Performance -----------------------------------------------------------------
349
86
 
350
87
  Performance/MethodObjectAsBlock:
351
88
  Enabled: false
352
89
 
353
- Performance/Sum:
354
- Enabled: true
355
-
356
- Performance/RedundantEqualityComparisonBlock:
357
- Enabled: true
358
-
359
- Performance/RedundantSplitRegexpArgument:
360
- Enabled: true
361
-
362
- Performance/MapCompact:
363
- Enabled: true
364
-
365
- Performance/ConcurrentMonotonicTime:
366
- Enabled: true
367
-
368
- Performance/StringIdentifierArgument:
369
- Enabled: true
90
+ # RSpec -----------------------------------------------------------------------
370
91
 
371
92
  RSpec/ExampleLength:
372
93
  Enabled: false
@@ -398,26 +119,5 @@ RSpec/MultipleMemoizedHelpers:
398
119
  RSpec/StubbedMock:
399
120
  Enabled: false
400
121
 
401
- RSpec/IdenticalEqualityAssertion:
402
- Enabled: true
403
-
404
- RSpec/Rails/AvoidSetupHook:
405
- Enabled: true
406
-
407
- RSpec/ExcessiveDocstringSpacing:
408
- Enabled: true
409
-
410
- RSpec/SubjectDeclaration:
411
- Enabled: true
412
-
413
- RSpec/FactoryBot/SyntaxMethods:
414
- Enabled: true
415
-
416
- RSpec/BeEq:
417
- Enabled: true
418
-
419
- RSpec/BeNil:
420
- Enabled: true
421
-
422
122
  RSpec/VerifiedDoubleReference:
423
123
  Enabled: false
data/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
4
 
5
+ ## [1.2.0] - 2022-07-27
6
+
7
+ ### Added
8
+
9
+ - Ability to use `RSET` SMTP command
10
+ - Ability to configure multiple message receiving flow during one session
11
+ - Ability to configure SMTP command delay responses
12
+
13
+ ### Updated
14
+
15
+ - Updated gemspecs
16
+ - Updated tests
17
+ - Updated rubocop/codeclimate/circleci configs
18
+ - Updated gem development dependencies
19
+ - Updated gem documentation, version
5
20
 
6
21
  ## [1.1.0] - 2022-05-17
7
22
 
data/README.md CHANGED
@@ -95,10 +95,18 @@ This gem includes easy system dependency manager. Run `bundle exec smtp_mock` wi
95
95
  | `session_timeout: 60` | Session timeout in seconds. It's equal to 30 seconds by default |
96
96
  | `shutdown_timeout: 5` | Graceful shutdown timeout in seconds. It's equal to 1 second by default |
97
97
  | `fail_fast: true` | Enables fail fast scenario. Disabled by default |
98
+ | `multipleMessageReceiving: true` | Enables multiple message receiving scenario. Disabled by default |
98
99
  | `blacklisted_helo_domains: %w[a.com b.com]` | Blacklisted `HELO` domains |
99
100
  | `blacklisted_mailfrom_emails: %w[a@a.com b@b.com]` | Blacklisted `MAIL FROM` emails |
100
101
  | `blacklisted_rcptto_emails: %w[c@c.com d@d.com]` | blacklisted `RCPT TO` emails |
101
102
  | `not_registered_emails: %w[e@e.com f@f.com]` | Not registered (non-existent) `RCPT TO` emails |
103
+ | `response_delay_helo: 2` | `HELO` response delay in seconds. It's equal to 0 seconds by default |
104
+ | `response_delay_mailfrom: 2` | `MAIL FROM` response delay in seconds. It's equal to 0 seconds by default |
105
+ | `response_delay_rcptto: 2` | `RCPT TO` response delay in seconds. It's equal to 0 seconds by default |
106
+ | `response_delay_data: 2` | `DATA` response delay in seconds. It's equal to 0 seconds by default |
107
+ | `response_delay_message: 2` | Message response delay in seconds. It's equal to 0 seconds by default |
108
+ | `response_delay_rset: 2` | `RSET` response delay in seconds. It's equal to 0 seconds by default |
109
+ | `response_delay_quit: 2` | `QUIT` response delay in seconds. It's equal to 0 seconds by default |
102
110
  | `msg_size_limit: 42` | Message body size limit in bytes. It's equal to 10485760 bytes by default |
103
111
  | `msg_greeting: 'Greeting message'` | Custom server greeting message |
104
112
  | `msg_invalid_cmd: 'Invalid command message'` | Custom invalid command message |
@@ -118,7 +126,9 @@ This gem includes easy system dependency manager. Run `bundle exec smtp_mock` wi
118
126
  | `msg_invalid_cmd_data_sequence: 'Invalid command DATA sequence message'` | Custom invalid command `DATA` sequence message |
119
127
  | `msg_data_received: 'DATA received message'` | Custom `DATA` received message |
120
128
  | `msg_msg_size_is_too_big: 'Message size is too big'` | Custom size is too big message |
121
- | `msg_msg_received: 'Message has been received'` | Custom received message body message |
129
+ | `msg_invalid_cmd_rset_sequence: 'Invalid command RSET sequence message'` | Custom invalid command `RSET` sequence message |
130
+ | `msg_invalid_cmd_rset_arg: 'Invalid command RSET argument message'` | Custom invalid command `RSET` argument message |
131
+ | `msg_rset_received: 'RSET received message'` | Custom `RSET` received message |
122
132
  | `msg_quit_cmd: 'Quit command message'` | Custom quit command message |
123
133
 
124
134
  #### Example of usage
data/lib/smtp_mock/cli.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  module SmtpMock
4
4
  module Cli
5
5
  Command = ::Struct.new(:install_path, :sudo, :success, :message) do
6
- include Resolver
6
+ include SmtpMock::Cli::Resolver
7
7
  end
8
8
 
9
9
  def self.call(command_line_args, command = SmtpMock::Cli::Command)
@@ -14,11 +14,18 @@ module SmtpMock
14
14
  blacklisted_rcptto_emails
15
15
  not_registered_emails
16
16
  ].freeze,
17
- SmtpMock::Types::Bool.constrained(eql: true) => %i[log fail_fast].freeze,
17
+ SmtpMock::Types::Bool.constrained(eql: true) => %i[log fail_fast multiple_message_receiving].freeze,
18
18
  SmtpMock::Types::Integer.constrained(gteq: 1) => %i[
19
19
  port
20
20
  session_timeout
21
21
  shutdown_timeout
22
+ response_delay_helo
23
+ response_delay_mailfrom
24
+ response_delay_rcptto
25
+ response_delay_data
26
+ response_delay_message
27
+ response_delay_rset
28
+ response_delay_quit
22
29
  msg_size_limit
23
30
  ].freeze,
24
31
  SmtpMock::Types::String => %i[
@@ -41,6 +48,9 @@ module SmtpMock
41
48
  msg_data_received
42
49
  msg_msg_size_is_too_big
43
50
  msg_msg_received
51
+ msg_invalid_cmd_rset_sequence
52
+ msg_invalid_cmd_rset_arg
53
+ msg_rset_received
44
54
  msg_quit_cmd
45
55
  ].freeze
46
56
  }.freeze
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SmtpMock
4
- VERSION = '1.1.0'
4
+ VERSION = '1.2.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smtp_mock
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladislav Trotsenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-17 00:00:00.000000000 Z
11
+ date: 2022-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct
@@ -153,8 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  - !ruby/object:Gem::Version
154
154
  version: '0'
155
155
  requirements: []
156
- rubyforge_project:
157
- rubygems_version: 2.7.3
156
+ rubygems_version: 3.2.20
158
157
  signing_key:
159
158
  specification_version: 4
160
159
  summary: smtp_mock