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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9aadcd60851b4155d5692ed824345f159f0b0cc419bff9c7ae98fff5d786dbb0
|
4
|
+
data.tar.gz: e16ec2b4fef36f3429c6ad3db888e32a601a79840cbdf62aef22a81c03a7df9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
137
|
+
if the_mail.content_type&.include?('text/html')
|
138
138
|
@message.part_html = body
|
139
|
-
elsif the_mail.content_type
|
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
|
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
|
-
|
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.
|
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-
|
11
|
+
date: 2023-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|