Module: Sisimai::RFC3464::ThirdParty
- Defined in:
- lib/sisimai/rfc3464/thirdparty.rb
Defined Under Namespace
Modules: PowerMTA
Constant Summary collapse
- ThirdParty =
{ #"Aol" => ["X-Outbound-Mail-Relay-"], # X-Outbound-Mail-Relay-(Queue-ID|Sender) "PowerMTA" => ["X-PowerMTA-"], # X-PowerMTA-(VirtualMTA|BounceCategory) #"Yandex" => ["X-Yandex-"], # X-Yandex-(Queue-ID|Sender) }.freeze
Class Method Summary collapse
-
.is3rdparty(argv1 = "") ⇒ Object
is3rdparty() returns true if the argument is a line generated by a MTA which have fields defined in RFC3464 inside of a bounce mail the MTA returns.
-
.returnedby(argv1 = "") ⇒ Object
returnedby() returns an MTA name of the 3rd party.
-
.xfield(argv1 = "") ⇒ Object
xfield() returns rfc1894.Field() compatible slice for the specific field of the 3rd party MTA.
Class Method Details
.is3rdparty(argv1 = "") ⇒ Object
is3rdparty() returns true if the argument is a line generated by a MTA which have fields defined in RFC3464 inside of a bounce mail the MTA returns
15 16 17 18 19 |
# File 'lib/sisimai/rfc3464/thirdparty.rb', line 15 def is3rdparty(argv1 = "") cv = Sisimai::RFC3464::ThirdParty.returnedby(argv1) return false if cv.empty? return true end |
.returnedby(argv1 = "") ⇒ Object
returnedby() returns an MTA name of the 3rd party
24 25 26 27 28 29 30 31 32 |
# File 'lib/sisimai/rfc3464/thirdparty.rb', line 24 def returnedby(argv1 = "") return "" if argv1.nil? || argv1.start_with?("X-") == false ThirdParty.each_key do |e| # Does the argument include the 3rd party specific field? return e if argv1.start_with?(ThirdParty[e][0]) end return "" end |
.xfield(argv1 = "") ⇒ Object
xfield() returns rfc1894.Field() compatible slice for the specific field of the 3rd party MTA
38 39 40 41 42 |
# File 'lib/sisimai/rfc3464/thirdparty.rb', line 38 def xfield(argv1 = "") return [] if argv1.nil? || argv1.empty? party = Sisimai::RFC3464::ThirdParty.returnedby(argv1); return [] if party.empty? return Module.const_get("Sisimai::RFC3464::ThirdParty::#{party}").xfield(argv1) end |