aantix
aantix

Reputation: 499

Ruby and Tmail; Hostname of relaying server?

I am using Ruby and Tmail to retrieve a series of emails from the server.

Is there any way to determine the hostname of the server that relayed the email message?

Upvotes: 0

Views: 193

Answers (1)

splattael
splattael

Reputation: 836

It's TMail::ReceivedHeader#by.

mail = TMail::Mail.parse(File.read("mail"))
mail["received"].each do |received|
  puts "Received by: #{received.by}"
end

Upvotes: 0

Related Questions