ishapi 0.1.8.294 → 0.1.8.296

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb5a51286eeecf1dee4e39e0d2d44036c5742b3882da47f40c63499af4665c0a
4
- data.tar.gz: cbd4c3e159da811dd7a1934500631fe6520cc2e514f32772587bb0a3d76bb106
3
+ metadata.gz: 9aadcd60851b4155d5692ed824345f159f0b0cc419bff9c7ae98fff5d786dbb0
4
+ data.tar.gz: e16ec2b4fef36f3429c6ad3db888e32a601a79840cbdf62aef22a81c03a7df9e
5
5
  SHA512:
6
- metadata.gz: 04c4841782096b5057b2b6ecba91b06de8309104847149f473654ed3b009c0bd19b2eee54b0c5104f92c090a57bbe4cbd1f04f6461580dc1313707df2220a8f8
7
- data.tar.gz: 5a45e7c3183bb1a26b0c9716c99841ee479bc2b832565c4ae6008046b9d1416f74c09c4cda26ca81bf6fed359f3a7279369e19d8d29b4b9ea0bcc13cd2a42847
6
+ metadata.gz: 275a4f20802fd724a2c9ca0bed415dda0642dbde4ab20e07baff3757a3702e447f39c6118d10798910f6a808cfdb8a434104e72450d9c550d888f1bc054c7402
7
+ data.tar.gz: ad1241027783f12ae4dd80b861f003987e60850ca4f477635e56314e919e59aec94d2335613c3af7de107f18f27f384068210ade056cd749c06265236f348ab5
@@ -14,7 +14,7 @@ module Ishapi
14
14
  visits: @obf.visits + [ visit_time ],
15
15
  })
16
16
 
17
- if Rails.application.config.debug
17
+ if DEBUG
18
18
  render and return
19
19
  end
20
20
 
@@ -134,9 +134,11 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
134
134
 
135
135
  if the_mail.parts.length == 0
136
136
  body = the_mail.body.decoded.encode('UTF-8', invalid: :replace, undef: :replace, replace: '?')
137
- if the_mail.content_type.include?('text/html')
137
+ if the_mail.content_type&.include?('text/html')
138
138
  @message.part_html = body
139
- elsif the_mail.content_type.include?('text/plain')
139
+ elsif the_mail.content_type&.include?('text/plain')
140
+ @message.part_txt = body
141
+ elsif the_mail.content_type.blank?
140
142
  @message.part_txt = body
141
143
  else
142
144
  throw "mail body of unknown type: #{the_mail.content_type}"
@@ -196,13 +198,13 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
196
198
  email_filters.each do |filter|
197
199
  if ( filter.from_regex.blank? || @message.from.match( filter.from_regex ) ) &&
198
200
  ( filter.from_exact.blank? || @message.from.downcase.include?( filter.from_exact&.downcase ) ) &&
199
- ( filter.body_exact.blank? || @message.part_html.include?( filter.body_exact ) ) &&
201
+ ( filter.body_exact.blank? || @message.part_html&.include?( filter.body_exact ) ) &&
200
202
  ( filter.subject_regex.blank? || @message.subject.match( filter.subject_regex ) ) &&
201
203
  ( filter.subject_exact.blank? || @message.subject.downcase.include?( filter.subject_exact&.downcase ) )
202
204
 
203
205
  # || MiaTagger.analyze( @message.part_html, :is_spammy_recruite ).score > .5
204
206
 
205
- # puts! "applying filter #{filter} to conv #{conv}" if DEBUG
207
+ puts! "applying filter #{filter} to conv #{conv}" if DEBUG
206
208
 
207
209
  @message.apply_filter( filter )
208
210
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ishapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.294
4
+ version: 0.1.8.296
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-25 00:00:00.000000000 Z
11
+ date: 2023-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails