ishapi 0.1.8.295 → 0.1.8.296

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: 83bbae29db0d25ca84377c33c217f1669f171fe681258d03f7dfb444c76f8ca4
4
- data.tar.gz: 27f096be2856487e4ece31ec980828315b5062c45cec739b293812421a0361f6
3
+ metadata.gz: 9aadcd60851b4155d5692ed824345f159f0b0cc419bff9c7ae98fff5d786dbb0
4
+ data.tar.gz: e16ec2b4fef36f3429c6ad3db888e32a601a79840cbdf62aef22a81c03a7df9e
5
5
  SHA512:
6
- metadata.gz: ee3ba6302f6d26c6c1e3936d2407039003cd1173b1a4fae35eeced8b3f62b6a2fa14d11fc3d0f9a4b4c12d50046c3c838129db30a438e7e91a86a061bcff035a
7
- data.tar.gz: c0031bbb7a303931a1b6807ee4a5d70d9c743361880dc6af83e55dcf47d6110fbc523c0f9aa0529466d3bc2934e6e7c680e5523eb1a980970276fcbf59744c84
6
+ metadata.gz: 275a4f20802fd724a2c9ca0bed415dda0642dbde4ab20e07baff3757a3702e447f39c6118d10798910f6a808cfdb8a434104e72450d9c550d888f1bc054c7402
7
+ data.tar.gz: ad1241027783f12ae4dd80b861f003987e60850ca4f477635e56314e919e59aec94d2335613c3af7de107f18f27f384068210ade056cd749c06265236f348ab5
@@ -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.295
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