ishapi 0.1.8.263 → 0.1.8.265
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 +4 -4
- data/app/jobs/ishapi/email_message_intake_job.rb +20 -14
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a31b2c1c59195d40beaf2848baab7c6d12d8f87e392c1519d5fc48110ea4b50
|
4
|
+
data.tar.gz: 29b9d3bbf71997d4be3482bdf05b63ac97c7c68410878baff1a8bd64275f8147
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00044fe45a41a9725338383f7e24877b74c683cb77a16b926532953c363d0b57937607444b3da062ec75cf3cab8a5d2ea6dd2d923852f685bd469af8cefb48a4
|
7
|
+
data.tar.gz: 896b906e06de86b0223624c27b796d1302c9706d10d43614879619fd001a9efab24b3a4c5c3bda249561088c13a18e4165e845da83e622c8efe2556a989c5eef
|
@@ -19,25 +19,27 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
|
|
19
19
|
# "image/jpeg; name=TX_DL_2.jpg"
|
20
20
|
# "text/plain; charset=UTF-8"
|
21
21
|
def churn_subpart message, part
|
22
|
-
if part.
|
23
|
-
|
22
|
+
if part.content_disposition&.include?('attachment')
|
23
|
+
## @TODO: attachments !
|
24
|
+
;
|
25
|
+
else
|
26
|
+
if part.content_type.include?("multipart/related") ||
|
27
|
+
part.content_type.include?("multipart/alternative")
|
24
28
|
|
25
|
-
|
26
|
-
|
27
|
-
|
29
|
+
part.parts.each do |subpart|
|
30
|
+
churn_subpart( message, subpart )
|
31
|
+
end
|
28
32
|
|
29
|
-
|
30
|
-
|
33
|
+
elsif part.content_type.include?('text/html')
|
34
|
+
message.part_html = part.decoded
|
31
35
|
|
32
|
-
|
33
|
-
|
36
|
+
elsif part.content_type.include?("text/plain")
|
37
|
+
message.part_txt = part.decoded
|
34
38
|
|
35
|
-
|
36
|
-
|
37
|
-
|
39
|
+
else
|
40
|
+
puts! part.content_type, '444 No action for a part with this content_type'
|
41
|
+
end
|
38
42
|
end
|
39
|
-
|
40
|
-
return nil
|
41
43
|
end
|
42
44
|
|
43
45
|
def perform id
|
@@ -60,6 +62,10 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
|
|
60
62
|
in_reply_to_id = the_mail.header['in-reply-to']&.to_s
|
61
63
|
email_inbox_tag_id = WpTag.emailtag(WpTag::INBOX).id
|
62
64
|
|
65
|
+
if !the_mail.to
|
66
|
+
the_mail.to = [ 'NO-RECIPIENT' ]
|
67
|
+
end
|
68
|
+
|
63
69
|
@message = ::Office::EmailMessage.where( message_id: message_id ).first
|
64
70
|
@message ||= ::Office::EmailMessage.new
|
65
71
|
@message.assign_attributes({
|
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.265
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|