tempmail_sdk 1.3.4 → 1.3.5

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.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/tempmail_sdk/channels.rb +29 -7
  4. data/lib/tempmail_sdk/channels_data.rb +29 -7
  5. data/lib/tempmail_sdk/providers/clawdemail.rb +122 -0
  6. data/lib/tempmail_sdk/providers/crazymailing.rb +114 -0
  7. data/lib/tempmail_sdk/providers/firetempmail.rb +86 -0
  8. data/lib/tempmail_sdk/providers/flybymail.rb +93 -0
  9. data/lib/tempmail_sdk/providers/generator_email.rb +146 -0
  10. data/lib/tempmail_sdk/providers/huskmail.rb +132 -0
  11. data/lib/tempmail_sdk/providers/internxt.rb +176 -0
  12. data/lib/tempmail_sdk/providers/linshi_xyz.rb +79 -0
  13. data/lib/tempmail_sdk/providers/mailmomy.rb +1 -1
  14. data/lib/tempmail_sdk/providers/mailticking.rb +139 -0
  15. data/lib/tempmail_sdk/providers/mtempmail.rb +140 -0
  16. data/lib/tempmail_sdk/providers/nowtempmail.rb +112 -0
  17. data/lib/tempmail_sdk/providers/noxen_de5_net.rb +392 -0
  18. data/lib/tempmail_sdk/providers/nukemail.rb +188 -0
  19. data/lib/tempmail_sdk/providers/nullmail.rb +95 -0
  20. data/lib/tempmail_sdk/providers/shadowmail.rb +174 -0
  21. data/lib/tempmail_sdk/providers/shitpost_email.rb +85 -0
  22. data/lib/tempmail_sdk/providers/smails.rb +128 -0
  23. data/lib/tempmail_sdk/providers/temp_mail_gg.rb +362 -0
  24. data/lib/tempmail_sdk/providers/tempmail100.rb +148 -0
  25. data/lib/tempmail_sdk/providers/tempmail_ee.rb +373 -0
  26. data/lib/tempmail_sdk/providers/tempmailportal.rb +131 -0
  27. data/lib/tempmail_sdk/providers/tempmails_io.rb +89 -0
  28. data/lib/tempmail_sdk/providers/tempmailto.rb +312 -0
  29. data/lib/tempmail_sdk/providers/temporarymail_com.rb +184 -0
  30. data/lib/tempmail_sdk/providers/tenmin_app.rb +100 -0
  31. data/lib/tempmail_sdk/providers/thirty_min_email.rb +90 -0
  32. data/lib/tempmail_sdk/providers/tmpkit.rb +129 -0
  33. data/lib/tempmail_sdk/providers/zerodrop.rb +90 -0
  34. data/lib/tempmail_sdk/registry.rb +129 -29
  35. data/lib/tempmail_sdk/types.rb +13 -0
  36. data/lib/tempmail_sdk/version.rb +1 -1
  37. data/lib/tempmail_sdk.rb +1 -1
  38. metadata +31 -7
  39. data/lib/tempmail_sdk/providers/gonebox_email.rb +0 -89
  40. data/lib/tempmail_sdk/providers/mohmal.rb +0 -208
  41. data/lib/tempmail_sdk/providers/temp_mail_now.rb +0 -103
  42. data/lib/tempmail_sdk/providers/webmailtemp.rb +0 -108
@@ -0,0 +1,129 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+
5
+ module TempmailSdk
6
+ module Providers
7
+ # Tmpkit 渠道实现(tmpkit.com,Next.js tRPC 前端 + Go-Guerrilla SMTP 后端)
8
+ #
9
+ # 流程:
10
+ # POST /api/rpc/tempmail/initSession(body 为 tRPC 包裹 {"json":{}})建箱,
11
+ # 响应 session.sessionId 与 session.email(sessionId 同值 Set-Cookie)
12
+ # POST /api/rpc/tempmail/getEmails({"json":{"offset":0,"limit":20}} +
13
+ # Cookie tempmail_session=<sessionId>)列信(列表键 mailId,无 id)
14
+ # POST /api/rpc/tempmail/getEmailDetail({"json":{"mailId":<数字>}})取正文
15
+ # 会话粘性:token 保存 sessionId(tempMailSession=<sid>),读信显式携带
16
+ # Cookie 请求头,防并行会话串箱。
17
+ module Tmpkit
18
+ CHANNEL = "tmpkit"
19
+ BASE_URL = "https://tmpkit.com"
20
+ RPC_PREFIX = "#{BASE_URL}/api/rpc/tempmail"
21
+
22
+ USER_AGENT = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 " \
23
+ "(KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36"
24
+
25
+ module_function
26
+
27
+ # tRPC 调用请求头(Content-Type JSON、Accept 通配、同站 Origin/Referer)
28
+ # @param cookie [String] sessionId,非空时携带 tempmail_session Cookie
29
+ # @return [Hash]
30
+ def rpc_headers(cookie = "")
31
+ hdrs = {
32
+ "User-Agent" => USER_AGENT,
33
+ "Accept" => "*/*",
34
+ "Content-Type" => "application/json",
35
+ "Origin" => BASE_URL,
36
+ "Referer" => "#{BASE_URL}/en"
37
+ }
38
+ hdrs["Cookie"] = "tempmail_session=#{cookie}" unless cookie.empty?
39
+ hdrs
40
+ end
41
+
42
+ # 对 tmpkit 发起 rpc 调用(tRPC 包裹 {"json":<reqBody>})
43
+ # 响应外层 {"json":{...}} 解析为 Hash 返回。
44
+ # @param procedure [String] rpc 过程名
45
+ # @param req_body [Hash] 过程参数
46
+ # @param cookie [String] sessionId
47
+ # @return [Hash]
48
+ def rpc(procedure, req_body, cookie = "")
49
+ resp = Http.post("#{RPC_PREFIX}/#{procedure}",
50
+ headers: rpc_headers(cookie),
51
+ body: JSON.generate({ json: req_body }),
52
+ timeout: 15)
53
+ resp.raise_for_status
54
+ outer = resp.json
55
+ payload = outer.is_a?(Hash) ? outer["json"] : nil
56
+ raise "tmpkit: #{procedure} 响应缺 json 载荷" unless payload.is_a?(Hash)
57
+
58
+ payload
59
+ end
60
+
61
+ # 创建 tmpkit.com 临时邮箱
62
+ # 调 initSession(tRPC 包裹 {"json":{}}),sessionId 与邮箱地址同返。
63
+ # @return [EmailInfo]
64
+ def generate_email
65
+ data = rpc("initSession", {})
66
+ sess = data["session"]
67
+ raise "tmpkit: 创建会话响应缺 session 字段" unless sess.is_a?(Hash)
68
+
69
+ email = sess["email"].to_s.strip
70
+ session_id = sess["sessionId"].to_s.strip
71
+ raise "tmpkit: 创建会话响应缺少必要字段(email/sessionId)" if email.empty? || session_id.empty? || !email.include?("@")
72
+
73
+ EmailInfo.new(channel: CHANNEL, email: email,
74
+ token: "tempMailSession=#{session_id}")
75
+ end
76
+
77
+ # 获取 tmpkit.com 邮件列表
78
+ # getEmails(offset 0 / limit 20)取摘要,逐封 getEmailDetail 拉详情并
79
+ # 将详情键并入摘要;详情失败回退列表摘要。getEmails 返回的 session.email
80
+ # 与收信邮箱不符时报错,防止会话被覆盖。
81
+ # @param email [String] 邮箱地址
82
+ # @param token [String] 会话凭据串(tempMailSession=<sessionId>)
83
+ # @return [Array<Email>]
84
+ def get_emails(email, token)
85
+ raw = token.to_s.strip
86
+ mailbox = raw.start_with?("tempMailSession=") ? raw.delete_prefix("tempMailSession=") : raw
87
+ raise "tmpkit: 会话 token 为空" if mailbox.empty?
88
+
89
+ data = rpc("getEmails", { offset: 0, limit: 20 }, mailbox)
90
+
91
+ # 会话指向校验:getEmails 响应自带 session.email(无 Cookie 时
92
+ # session 为 null,同样视为会话失效)
93
+ sess = data["session"]
94
+ if sess.is_a?(Hash)
95
+ got = sess["email"].to_s.strip
96
+ raise "tmpkit: 会话邮箱不匹配(响应 #{got},请求 #{email})" if !got.empty? && got != email
97
+ else
98
+ raise "tmpkit: 会话已失效(getEmails 返回空会话)"
99
+ end
100
+
101
+ list = data["emails"]
102
+ raise "tmpkit: 邮件列表响应缺 emails 字段" unless list.is_a?(Array)
103
+
104
+ list.map do |item|
105
+ next unless item.is_a?(Hash)
106
+
107
+ m = item.dup
108
+ # mailId 为数字:合法时逐封拉详情(详情键并入摘要,跳过会话类键)
109
+ mail_id = m["mailId"]
110
+ if mail_id.is_a?(Numeric) && mail_id.positive?
111
+ begin
112
+ detail = rpc("getEmailDetail", { mailId: mail_id.to_i }, mailbox)
113
+ if detail.is_a?(Hash)
114
+ detail.each do |k, v|
115
+ next if %w[session emails total error].include?(k)
116
+
117
+ m[k] = v
118
+ end
119
+ end
120
+ rescue StandardError
121
+ # 详情失败回退列表摘要
122
+ end
123
+ end
124
+ Normalize.normalize_email(m, email)
125
+ end.compact
126
+ end
127
+ end
128
+ end
129
+ end
@@ -0,0 +1,90 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "uri"
4
+
5
+ module TempmailSdk
6
+ module Providers
7
+ # Zerodrop 渠道实现(zerodrop.dev)
8
+ #
9
+ # 无认证 REST:建箱无需请求,本地生成 "sdk"+8 位随机名,地址为 <名>@zerodrop-sandbox.online;
10
+ # 读信 GET /api/inbox/{name}?source=sdk,响应形如 {"emails":[...],"count":N}。
11
+ # 平台邮件对象只有 id/from/to/subject/receivedAt/raw/otp/magicLink,正文仅存在于
12
+ # raw(完整 MIME 原文),需剥离头部提取纯文本 body。
13
+ module Zerodrop
14
+ CHANNEL = "zerodrop"
15
+ BASE_URL = "https://zerodrop.dev"
16
+ DOMAIN = "zerodrop-sandbox.online"
17
+
18
+ HEADERS = {
19
+ "Accept" => "application/json",
20
+ "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 " \
21
+ "(KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36 Edg/146.0.0.0"
22
+ }.freeze
23
+
24
+ module_function
25
+
26
+ # 生成 "sdk"+8 位 [a-z0-9] 随机本地名
27
+ CHARS = ("a".."z").to_a + ("0".."9").to_a
28
+ def random_name
29
+ "sdk" + Array.new(8) { CHARS.sample }.join
30
+ end
31
+
32
+ # 从 raw(完整 MIME 原文)提取纯文本正文:
33
+ # 定位首个空行(RFC 5322 头部/正文分隔,\r\n\r\n 或 \n\n),其后部分即 body
34
+ # @param raw [String] MIME 原文
35
+ # @return [String]
36
+ def raw_body(raw)
37
+ idx = raw.index("\r\n\r\n")
38
+ return raw[(idx + 4)..] if idx
39
+
40
+ idx = raw.index("\n\n")
41
+ return raw[(idx + 2)..] if idx
42
+
43
+ ""
44
+ end
45
+
46
+ # 创建临时邮箱
47
+ # 建箱无需请求,本地生成随机名,token 复用完整地址以便收件箱回查
48
+ # @return [EmailInfo]
49
+ def generate_email
50
+ email = "#{random_name}@#{DOMAIN}"
51
+ EmailInfo.new(channel: CHANNEL, email: email, token: email)
52
+ end
53
+
54
+ # 读取收件箱
55
+ # GET /api/inbox/{name}?source=sdk
56
+ # @param email [String] 邮箱地址
57
+ # @param _token [String] 令牌(本渠道忽略,以邮箱为准)
58
+ # @return [Array<Email>]
59
+ def get_emails(email, _token)
60
+ addr = email.to_s.strip
61
+ parts = addr.split("@", 2)
62
+ raise "zerodrop: 非 #{DOMAIN} 域邮箱地址" unless parts.size == 2 && parts[1] == DOMAIN
63
+
64
+ url = "#{BASE_URL}/api/inbox/#{URI.encode_www_form_component(parts[0])}?source=sdk"
65
+ resp = Http.get(url, headers: HEADERS, timeout: 15)
66
+ resp.raise_for_status
67
+ data = resp.json
68
+ emails = data.is_a?(Hash) ? data["emails"] : nil
69
+ return [] unless emails.is_a?(Array)
70
+
71
+ emails.filter_map do |m|
72
+ next unless m.is_a?(Hash)
73
+
74
+ row = {
75
+ "id" => m["id"],
76
+ "from" => m["from"],
77
+ "to" => addr,
78
+ "subject" => m["subject"],
79
+ "date" => m["receivedAt"] || m["date"]
80
+ }
81
+ # 正文仅存在于 raw(完整 MIME 原文):提取纯文本 body 作 text
82
+ raw = m["raw"].to_s
83
+ body = raw_body(raw)
84
+ row["text"] = body unless body.empty?
85
+ Normalize.normalize_email(row, addr)
86
+ end
87
+ end
88
+ end
89
+ end
90
+ end
@@ -18,20 +18,20 @@ module TempmailSdk
18
18
  Mailforspam: "mailforspam", FakeLegal: "fake_legal", TenminuteOne: "tenminute_one",
19
19
  Zhujump: "zhujump", Anonymmail: "anonymmail", Byom: "byom", Cleantempmail: "cleantempmail",
20
20
  DevmailUk: "devmail_uk", DropmailClick: "dropmail_click", FakeEmailSite: "fake_email_site",
21
- Fmail: "fmail", Freecustom: "freecustom", GoneboxEmail: "gonebox_email",
21
+ Fmail: "fmail", Freecustom: "freecustom",
22
22
  Harakirimail: "harakirimail", Inboxes: "inboxes", M2u: "m2u", Mail10s: "mail10s",
23
23
  Mail123: "mail123", Mffac: "mffac", Tempmailc: "tempmailc", NeighboursSh: "neighbours_sh",
24
24
  Temporam: "temporam", Neighbours: "neighbours", TempyEmail: "tempy_email", Ockito: "ockito",
25
25
  Tempmail365: "tempmail365", Tempinbox: "tempinbox", MailSunls: "mail_sunls",
26
26
  Smailpro: "smailpro", MailholeDe: "mailhole_de", Nimail: "nimail", Rootsh: "rootsh",
27
- ShittyEmail: "shitty_email", TaEasy: "ta_easy", TempMailNow: "temp_mail_now",
27
+ ShittyEmail: "shitty_email", TaEasy: "ta_easy",
28
28
  TempMailOrg: "temp_mail_org", TempemailCo: "tempemail_co", TempemailInfo: "tempemail_info",
29
29
  TempemailsNet: "tempemails_net", Tempfastmail: "tempfastmail", Tempgmailer: "tempgmailer",
30
30
  TempgoEmail: "tempgo_email", TempmailFish: "tempmail_fish", TempmailFyi: "tempmail_fyi",
31
31
  TempmailLolV2: "tempmail_lol_v2", Tempmailpro: "tempmailpro", Tempmailten: "tempmailten",
32
32
  TempMails: "tempp_mails", TenMinuteMailNet: "ten_minute_mail_net",
33
33
  Throwawaymail: "throwawaymail", TmailLink: "tmail_link",
34
- Uncorreotemporal: "uncorreotemporal", Webmailtemp: "webmailtemp", XkxMe: "xkx_me",
34
+ Uncorreotemporal: "uncorreotemporal", XkxMe: "xkx_me",
35
35
  Altmails: "altmails", Apihz: "apihz", Awamail: "awamail", BestTempMail: "best_temp_mail",
36
36
  ChatgptOrgUk: "chatgpt_org_uk", Disposablemail: "disposablemail",
37
37
  DisposablemailApp: "disposablemail_app", Email10min: "email10min",
@@ -41,11 +41,21 @@ module TempmailSdk
41
41
  TempmailCn: "tempmail_cn", Linshiyou: "linshiyou", Mailnesia: "mailnesia",
42
42
  Dropmail: "dropmail", SmailPw: "smail_pw", Vip215: "vip_215",
43
43
  Tempgbox: "tempgbox", Anonbox: "anonbox", Eyepaste: "eyepaste",
44
- Lroid: "lroid", Haribu: "haribu", Mohmal: "mohmal", Mailgolem: "mailgolem",
44
+ Lroid: "lroid", Haribu: "haribu", Mailgolem: "mailgolem",
45
45
  MytempmailCc: "mytempmail_cc", MailtempCc: "mailtemp_cc", Minuteinbox: "minuteinbox",
46
46
  Mailcatch: "mailcatch", MaildropCc: "maildrop_cc", TenminutemailNet: "tenminutemail_net",
47
47
  Openinbox: "openinbox", MailcatAi: "mailcat_ai", DropmailMe: "dropmail_me",
48
- TwentyfourmailChacuo: "twentyfourmail_chacuo"
48
+ TwentyfourmailChacuo: "twentyfourmail_chacuo",
49
+ TempmailsIo: "tempmails_io", ShitpostEmail: "shitpost_email", Smails: "smails",
50
+ Tempmailportal: "tempmailportal", Huskmail: "huskmail", Zerodrop: "zerodrop",
51
+ Firetempmail: "firetempmail", Nullmail: "nullmail", TenminApp: "tenmin_app",
52
+ Mtempmail: "mtempmail", TempmailEe: "tempmail_ee", Mailticking: "mailticking",
53
+ TemporarymailCom: "temporarymail_com", ThirtyMinEmail: "thirty_min_email",
54
+ LinshiXyz: "linshi_xyz", Crazymailing: "crazymailing", NoxenDe5Net: "noxen_de5_net",
55
+ Nukemail: "nukemail", Shadowmail: "shadowmail", Flybymail: "flybymail",
56
+ Nowtempmail: "nowtempmail", Clawdemail: "clawdemail", Tempmail100: "tempmail100",
57
+ Tempmailto: "tempmailto", TempMailGg: "temp_mail_gg",
58
+ Tmpkit: "tmpkit", Internxt: "internxt", GeneratorEmail: "generator_email"
49
59
  }.freeze
50
60
 
51
61
  PROVIDER_AUTOLOADS.each do |mod_name, file|
@@ -463,10 +473,6 @@ module TempmailSdk
463
473
  get_emails: ->(e, t) { p::Getnada.get_emails(require_token(t, "getnada"), e) }
464
474
  },
465
475
  # mailmomy 家族:mailmomy 主渠道从域名池随机选域,其余为固定域名变体(同后端 API)
466
- "16888888-cyou" => {
467
- generate: ->(_o) { with_channel(p::Mailmomy.generate_email("16888888.cyou"), "16888888-cyou") },
468
- get_emails: ->(e, _t) { p::Mailmomy.get_emails(e) }
469
- },
470
476
  "17666688-shop" => {
471
477
  generate: ->(_o) { with_channel(p::Mailmomy.generate_email("17666688.shop"), "17666688-shop") },
472
478
  get_emails: ->(e, _t) { p::Mailmomy.get_emails(e) }
@@ -487,10 +493,6 @@ module TempmailSdk
487
493
  generate: ->(_o) { with_channel(p::Mailmomy.generate_email("easyme.pro"), "easyme-pro") },
488
494
  get_emails: ->(e, _t) { p::Mailmomy.get_emails(e) }
489
495
  },
490
- "evergreenco-shop" => {
491
- generate: ->(_o) { with_channel(p::Mailmomy.generate_email("evergreenco.shop"), "evergreenco-shop") },
492
- get_emails: ->(e, _t) { p::Mailmomy.get_emails(e) }
493
- },
494
496
  "layueming-pics" => {
495
497
  generate: ->(_o) { with_channel(p::Mailmomy.generate_email("layueming.pics"), "layueming-pics") },
496
498
  get_emails: ->(e, _t) { p::Mailmomy.get_emails(e) }
@@ -914,10 +916,6 @@ module TempmailSdk
914
916
  generate: ->(_o) { p::Freecustom.generate_email },
915
917
  get_emails: ->(e, t) { p::Freecustom.get_emails(t.to_s.empty? ? e : t) }
916
918
  },
917
- "gonebox-email" => {
918
- generate: ->(_o) { p::GoneboxEmail.generate_email },
919
- get_emails: ->(e, t) { p::GoneboxEmail.get_emails(t.to_s, e) }
920
- },
921
919
  "harakirimail" => {
922
920
  generate: ->(_o) { p::Harakirimail.generate_email },
923
921
  get_emails: ->(e, _t) { p::Harakirimail.get_emails(e) }
@@ -1004,10 +1002,6 @@ module TempmailSdk
1004
1002
  generate: ->(_o) { p::TaEasy.generate_email },
1005
1003
  get_emails: ->(e, t) { p::TaEasy.get_emails(e, require_token(t, "ta-easy")) }
1006
1004
  },
1007
- "temp-mail-now" => {
1008
- generate: ->(_o) { p::TempMailNow.generate_email },
1009
- get_emails: ->(e, t) { p::TempMailNow.get_emails(require_token(t, "temp-mail-now"), e) }
1010
- },
1011
1005
  "temp-mail-org" => {
1012
1006
  generate: ->(_o) { p::TempMailOrg.generate_email },
1013
1007
  get_emails: ->(e, t) { p::TempMailOrg.get_emails(require_token(t, "temp-mail-org"), e) }
@@ -1076,10 +1070,6 @@ module TempmailSdk
1076
1070
  generate: ->(_o) { p::Uncorreotemporal.generate_email },
1077
1071
  get_emails: ->(e, t) { p::Uncorreotemporal.get_emails(require_token(t, "uncorreotemporal"), e) }
1078
1072
  },
1079
- "webmailtemp" => {
1080
- generate: ->(_o) { p::Webmailtemp.generate_email },
1081
- get_emails: ->(e, t) { p::Webmailtemp.get_emails(require_token(t, "webmailtemp"), e) }
1082
- },
1083
1073
  "xkx-me" => {
1084
1074
  generate: ->(_o) { p::XkxMe.generate_email },
1085
1075
  get_emails: ->(e, t) { p::XkxMe.get_emails(require_token(t, "xkx-me"), e) }
@@ -1132,10 +1122,6 @@ module TempmailSdk
1132
1122
  generate: ->(_o) { p::Haribu.generate_email },
1133
1123
  get_emails: ->(e, t) { p::Haribu.get_emails(require_token(t, "haribu"), e) }
1134
1124
  },
1135
- "mohmal" => {
1136
- generate: ->(_o) { p::Mohmal.generate_email },
1137
- get_emails: ->(e, t) { p::Mohmal.get_emails(e, require_token(t, "mohmal")) }
1138
- },
1139
1125
  "mailgolem" => {
1140
1126
  generate: ->(_o) { p::Mailgolem.generate_email },
1141
1127
  get_emails: ->(e, t) { p::Mailgolem.get_emails(e, require_token(t, "mailgolem")) }
@@ -1232,6 +1218,120 @@ module TempmailSdk
1232
1218
  generate: ->(_o) { p::Email10min.generate_email },
1233
1219
  get_emails: ->(e, t) { p::Email10min.get_emails(e, require_token(t, "email10min")) }
1234
1220
  },
1221
+ # 渠道追加批次:与 baseline 尾部 11 个新增渠道一一对应(顺序固定)
1222
+ "tempmails-io" => {
1223
+ generate: ->(_o) { p::TempmailsIo.generate_email },
1224
+ get_emails: ->(e, t) { p::TempmailsIo.get_emails(e, require_token(t, "tempmails-io")) }
1225
+ },
1226
+ "shitpost-email" => {
1227
+ generate: ->(_o) { p::ShitpostEmail.generate_email },
1228
+ get_emails: ->(e, t) { p::ShitpostEmail.get_emails(e, require_token(t, "shitpost-email")) }
1229
+ },
1230
+ "smails" => {
1231
+ generate: ->(_o) { p::Smails.generate_email },
1232
+ get_emails: ->(e, t) { p::Smails.get_emails(require_token(t, "smails"), e) }
1233
+ },
1234
+ "tempmailportal" => {
1235
+ generate: ->(_o) { p::Tempmailportal.generate_email },
1236
+ get_emails: ->(e, t) { p::Tempmailportal.get_emails(require_token(t, "tempmailportal"), e) }
1237
+ },
1238
+ "huskmail" => {
1239
+ generate: ->(_o) { p::Huskmail.generate_email },
1240
+ get_emails: ->(e, t) { p::Huskmail.get_emails(require_token(t, "huskmail"), e) }
1241
+ },
1242
+ "zerodrop" => {
1243
+ generate: ->(_o) { p::Zerodrop.generate_email },
1244
+ get_emails: ->(e, t) { p::Zerodrop.get_emails(e, t) }
1245
+ },
1246
+ "firetempmail" => {
1247
+ generate: ->(_o) { p::Firetempmail.generate_email },
1248
+ get_emails: ->(e, t) { p::Firetempmail.get_emails(e, t) }
1249
+ },
1250
+ "nullmail" => {
1251
+ generate: ->(_o) { p::Nullmail.generate_email },
1252
+ get_emails: ->(e, t) { p::Nullmail.get_emails(e, t) }
1253
+ },
1254
+ "tenmin-app" => {
1255
+ generate: ->(_o) { p::TenminApp.generate_email },
1256
+ get_emails: ->(e, t) { p::TenminApp.get_emails(e, require_token(t, "tenmin-app")) }
1257
+ },
1258
+ "mtempmail" => {
1259
+ generate: ->(_o) { p::Mtempmail.generate_email },
1260
+ get_emails: ->(e, t) { p::Mtempmail.get_emails(e, t) }
1261
+ },
1262
+ "tempmail-ee" => {
1263
+ generate: ->(_o) { p::TempmailEe.generate_email },
1264
+ get_emails: ->(e, t) { p::TempmailEe.get_emails(e, require_token(t, "tempmail-ee")) }
1265
+ },
1266
+ "mailticking" => {
1267
+ generate: ->(_o) { p::Mailticking.generate_email },
1268
+ get_emails: ->(e, t) { p::Mailticking.get_emails(e, require_token(t, "mailticking")) }
1269
+ },
1270
+ # 渠道追加批次:与 baseline 尾部 11 个新增渠道一一对应(顺序固定)
1271
+ "temporarymail-com" => {
1272
+ generate: ->(_o) { p::TemporarymailCom.generate_email },
1273
+ get_emails: ->(e, t) { p::TemporarymailCom.get_emails(e, require_token(t, "temporarymail-com")) }
1274
+ },
1275
+ "30minemail" => {
1276
+ generate: ->(_o) { p::ThirtyMinEmail.generate_email },
1277
+ get_emails: ->(e, t) { p::ThirtyMinEmail.get_emails(e, require_token(t, "30minemail")) }
1278
+ },
1279
+ "linshi-xyz" => {
1280
+ generate: ->(_o) { p::LinshiXyz.generate_email },
1281
+ get_emails: ->(e, t) { p::LinshiXyz.get_emails(e, require_token(t, "linshi-xyz")) }
1282
+ },
1283
+ "crazymailing" => {
1284
+ generate: ->(_o) { p::Crazymailing.generate_email },
1285
+ get_emails: ->(e, t) { p::Crazymailing.get_emails(e, require_token(t, "crazymailing")) }
1286
+ },
1287
+ "noxen-de5-net" => {
1288
+ generate: ->(o) { p::NoxenDe5Net.generate_email(o.domain) },
1289
+ get_emails: ->(e, t) { p::NoxenDe5Net.get_emails(e, require_token(t, "noxen-de5-net")) }
1290
+ },
1291
+ "nukemail" => {
1292
+ generate: ->(_o) { p::Nukemail.generate_email },
1293
+ get_emails: ->(e, t) { p::Nukemail.get_emails(e, require_token(t, "nukemail")) }
1294
+ },
1295
+ "shadowmail" => {
1296
+ generate: ->(_o) { p::Shadowmail.generate_email },
1297
+ get_emails: ->(e, t) { p::Shadowmail.get_emails(e, require_token(t, "shadowmail")) }
1298
+ },
1299
+ "flybymail" => {
1300
+ generate: ->(_o) { p::Flybymail.generate_email },
1301
+ get_emails: ->(e, t) { p::Flybymail.get_emails(e, require_token(t, "flybymail")) }
1302
+ },
1303
+ "nowtempmail" => {
1304
+ generate: ->(_o) { p::Nowtempmail.generate_email },
1305
+ get_emails: ->(e, t) { p::Nowtempmail.get_emails(e, require_token(t, "nowtempmail")) }
1306
+ },
1307
+ "clawdemail" => {
1308
+ generate: ->(_o) { p::Clawdemail.generate_email },
1309
+ get_emails: ->(e, t) { p::Clawdemail.get_emails(e, require_token(t, "clawdemail")) }
1310
+ },
1311
+ "tempmail100" => {
1312
+ generate: ->(_o) { p::Tempmail100.generate_email },
1313
+ get_emails: ->(e, t) { p::Tempmail100.get_emails(e, require_token(t, "tempmail100")) }
1314
+ },
1315
+ "tempmailto" => {
1316
+ generate: ->(_o) { p::Tempmailto.generate_email },
1317
+ get_emails: ->(e, t) { p::Tempmailto.get_emails(e, require_token(t, "tempmailto")) }
1318
+ },
1319
+ "temp-mail-gg" => {
1320
+ generate: ->(_o) { p::TempMailGg.generate_email },
1321
+ get_emails: ->(e, t) { p::TempMailGg.get_emails(e, require_token(t, "temp-mail-gg")) }
1322
+ },
1323
+ "tmpkit" => {
1324
+ generate: ->(_o) { p::Tmpkit.generate_email },
1325
+ get_emails: ->(e, t) { p::Tmpkit.get_emails(e, require_token(t, "tmpkit")) }
1326
+ },
1327
+ "internxt" => {
1328
+ generate: ->(_o) { p::Internxt.generate_email },
1329
+ get_emails: ->(e, t) { p::Internxt.get_emails(e, require_token(t, "internxt")) }
1330
+ },
1331
+ "generator-email" => {
1332
+ generate: ->(_o) { p::GeneratorEmail.generate_email },
1333
+ get_emails: ->(e, t) { p::GeneratorEmail.get_emails(e, require_token(t, "generator-email")) }
1334
+ },
1235
1335
  }
1236
1336
  end
1237
1337
 
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "time"
4
+
3
5
  module TempmailSdk
4
6
  # 创建临时邮箱后返回的邮箱信息
5
7
  # Token 等认证信息由 SDK 内部维护,不对外暴露(token 通过私有读取器访问)
@@ -78,6 +80,17 @@ module TempmailSdk
78
80
  end
79
81
  # rubocop:enable Metrics/ParameterLists
80
82
 
83
+ # 发信地址的域名部分;无法从 from_addr 提取时返回空串
84
+ # @return [String]
85
+ def from_domain
86
+ addr = from_addr.to_s
87
+ if (m = addr.match(/<?([^@\s<>]+)@([^@\s<>]+)>?/))
88
+ return m[2]
89
+ end
90
+
91
+ ""
92
+ end
93
+
81
94
  def to_h
82
95
  {
83
96
  id: @id, from_addr: @from_addr, to: @to, subject: @subject,
@@ -2,5 +2,5 @@
2
2
 
3
3
  module TempmailSdk
4
4
  # SDK 版本号
5
- VERSION = "1.3.4"
5
+ VERSION = "1.3.5"
6
6
  end
data/lib/tempmail_sdk.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # 临时邮箱 SDK (Ruby)
4
- # 聚合 279 个第三方临时邮箱渠道,所有渠道返回统一标准化格式。
4
+ # 聚合 296 个第三方临时邮箱渠道,所有渠道返回统一标准化格式。
5
5
  # 与 Go / npm / Rust / Python / C / PHP 各端共享相同的渠道标识与顺序。
6
6
 
7
7
  require_relative "tempmail_sdk/version"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tempmail_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - tempmail-sdk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-23 00:00:00.000000000 Z
11
+ date: 2026-09-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 五端(Go/npm/Rust/Python/C)之外的 Ruby 版临时邮箱 SDK,共享相同的渠道标识与顺序,提供统一的 Email 结构、渠道
14
14
  fallback、代理/超时/TLS/遥测配置。
@@ -36,7 +36,9 @@ files:
36
36
  - lib/tempmail_sdk/providers/byom.rb
37
37
  - lib/tempmail_sdk/providers/catchmail.rb
38
38
  - lib/tempmail_sdk/providers/chatgpt_org_uk.rb
39
+ - lib/tempmail_sdk/providers/clawdemail.rb
39
40
  - lib/tempmail_sdk/providers/cleantempmail.rb
41
+ - lib/tempmail_sdk/providers/crazymailing.rb
40
42
  - lib/tempmail_sdk/providers/devmail_uk.rb
41
43
  - lib/tempmail_sdk/providers/disposablemail.rb
42
44
  - lib/tempmail_sdk/providers/disposablemail_app.rb
@@ -52,16 +54,21 @@ files:
52
54
  - lib/tempmail_sdk/providers/fake_email_site.rb
53
55
  - lib/tempmail_sdk/providers/fake_legal.rb
54
56
  - lib/tempmail_sdk/providers/fakemail.rb
57
+ - lib/tempmail_sdk/providers/firetempmail.rb
58
+ - lib/tempmail_sdk/providers/flybymail.rb
55
59
  - lib/tempmail_sdk/providers/fmail.rb
56
60
  - lib/tempmail_sdk/providers/freecustom.rb
61
+ - lib/tempmail_sdk/providers/generator_email.rb
57
62
  - lib/tempmail_sdk/providers/getnada.rb
58
- - lib/tempmail_sdk/providers/gonebox_email.rb
59
63
  - lib/tempmail_sdk/providers/guerrillamail.rb
60
64
  - lib/tempmail_sdk/providers/guerrillamail_mirrors.rb
61
65
  - lib/tempmail_sdk/providers/harakirimail.rb
62
66
  - lib/tempmail_sdk/providers/haribu.rb
67
+ - lib/tempmail_sdk/providers/huskmail.rb
63
68
  - lib/tempmail_sdk/providers/inboxes.rb
64
69
  - lib/tempmail_sdk/providers/inboxkitten.rb
70
+ - lib/tempmail_sdk/providers/internxt.rb
71
+ - lib/tempmail_sdk/providers/linshi_xyz.rb
65
72
  - lib/tempmail_sdk/providers/linshiyou.rb
66
73
  - lib/tempmail_sdk/providers/linshiyouxiang_net.rb
67
74
  - lib/tempmail_sdk/providers/lroid.rb
@@ -83,26 +90,34 @@ files:
83
90
  - lib/tempmail_sdk/providers/mailmomy.rb
84
91
  - lib/tempmail_sdk/providers/mailnesia.rb
85
92
  - lib/tempmail_sdk/providers/mailtemp_cc.rb
93
+ - lib/tempmail_sdk/providers/mailticking.rb
86
94
  - lib/tempmail_sdk/providers/mffac.rb
87
95
  - lib/tempmail_sdk/providers/minuteinbox.rb
88
96
  - lib/tempmail_sdk/providers/moakt.rb
89
- - lib/tempmail_sdk/providers/mohmal.rb
97
+ - lib/tempmail_sdk/providers/mtempmail.rb
90
98
  - lib/tempmail_sdk/providers/mytempmail_cc.rb
91
99
  - lib/tempmail_sdk/providers/neighbours.rb
92
100
  - lib/tempmail_sdk/providers/neighbours_sh.rb
93
101
  - lib/tempmail_sdk/providers/nimail.rb
102
+ - lib/tempmail_sdk/providers/nowtempmail.rb
103
+ - lib/tempmail_sdk/providers/noxen_de5_net.rb
104
+ - lib/tempmail_sdk/providers/nukemail.rb
105
+ - lib/tempmail_sdk/providers/nullmail.rb
94
106
  - lib/tempmail_sdk/providers/ockito.rb
95
107
  - lib/tempmail_sdk/providers/one_sec_mail.rb
96
108
  - lib/tempmail_sdk/providers/openinbox.rb
97
109
  - lib/tempmail_sdk/providers/restmail_net.rb
98
110
  - lib/tempmail_sdk/providers/rootsh.rb
111
+ - lib/tempmail_sdk/providers/shadowmail.rb
112
+ - lib/tempmail_sdk/providers/shitpost_email.rb
99
113
  - lib/tempmail_sdk/providers/shitty_email.rb
100
114
  - lib/tempmail_sdk/providers/smail_pw.rb
101
115
  - lib/tempmail_sdk/providers/smailpro.rb
116
+ - lib/tempmail_sdk/providers/smails.rb
102
117
  - lib/tempmail_sdk/providers/socketio_mail.rb
103
118
  - lib/tempmail_sdk/providers/ta_easy.rb
119
+ - lib/tempmail_sdk/providers/temp_mail_gg.rb
104
120
  - lib/tempmail_sdk/providers/temp_mail_io.rb
105
- - lib/tempmail_sdk/providers/temp_mail_now.rb
106
121
  - lib/tempmail_sdk/providers/temp_mail_org.rb
107
122
  - lib/tempmail_sdk/providers/tempemail_co.rb
108
123
  - lib/tempmail_sdk/providers/tempemail_info.rb
@@ -113,29 +128,38 @@ files:
113
128
  - lib/tempmail_sdk/providers/tempgo_email.rb
114
129
  - lib/tempmail_sdk/providers/tempinbox.rb
115
130
  - lib/tempmail_sdk/providers/tempmail.rb
131
+ - lib/tempmail_sdk/providers/tempmail100.rb
116
132
  - lib/tempmail_sdk/providers/tempmail365.rb
117
133
  - lib/tempmail_sdk/providers/tempmail_cn.rb
134
+ - lib/tempmail_sdk/providers/tempmail_ee.rb
118
135
  - lib/tempmail_sdk/providers/tempmail_fish.rb
119
136
  - lib/tempmail_sdk/providers/tempmail_fyi.rb
120
137
  - lib/tempmail_sdk/providers/tempmail_lol.rb
121
138
  - lib/tempmail_sdk/providers/tempmail_lol_v2.rb
122
139
  - lib/tempmail_sdk/providers/tempmail_plus.rb
123
140
  - lib/tempmail_sdk/providers/tempmailc.rb
141
+ - lib/tempmail_sdk/providers/tempmailportal.rb
124
142
  - lib/tempmail_sdk/providers/tempmailpro.rb
143
+ - lib/tempmail_sdk/providers/tempmails_io.rb
125
144
  - lib/tempmail_sdk/providers/tempmailten.rb
145
+ - lib/tempmail_sdk/providers/tempmailto.rb
126
146
  - lib/tempmail_sdk/providers/temporam.rb
147
+ - lib/tempmail_sdk/providers/temporarymail_com.rb
127
148
  - lib/tempmail_sdk/providers/tempp_mails.rb
128
149
  - lib/tempmail_sdk/providers/tempy_email.rb
129
150
  - lib/tempmail_sdk/providers/ten_minute_mail_net.rb
151
+ - lib/tempmail_sdk/providers/tenmin_app.rb
130
152
  - lib/tempmail_sdk/providers/tenminute_one.rb
131
153
  - lib/tempmail_sdk/providers/tenminutemail_net.rb
154
+ - lib/tempmail_sdk/providers/thirty_min_email.rb
132
155
  - lib/tempmail_sdk/providers/throwawaymail.rb
133
156
  - lib/tempmail_sdk/providers/tmail_link.rb
157
+ - lib/tempmail_sdk/providers/tmpkit.rb
134
158
  - lib/tempmail_sdk/providers/twentyfourmail_chacuo.rb
135
159
  - lib/tempmail_sdk/providers/uncorreotemporal.rb
136
160
  - lib/tempmail_sdk/providers/vip_215.rb
137
- - lib/tempmail_sdk/providers/webmailtemp.rb
138
161
  - lib/tempmail_sdk/providers/xkx_me.rb
162
+ - lib/tempmail_sdk/providers/zerodrop.rb
139
163
  - lib/tempmail_sdk/providers/zhujump.rb
140
164
  - lib/tempmail_sdk/registry.rb
141
165
  - lib/tempmail_sdk/retry.rb
@@ -166,5 +190,5 @@ requirements: []
166
190
  rubygems_version: 3.4.19
167
191
  signing_key:
168
192
  specification_version: 4
169
- summary: 临时邮箱 SDK,聚合 279 个第三方临时邮箱渠道,返回统一标准化格式
193
+ summary: 临时邮箱 SDK,聚合 296 个第三方临时邮箱渠道,返回统一标准化格式
170
194
  test_files: []