It seems that it doesn’t recognize from the second command onward.
So basically I’m able to perform just the first “helo my email
address”, but I’m don’t receive any answer for an eventual “mail
from:<email>” or “rcpt to:<email>”.
Do you mean DNS reverse lookup? You can do that with this script:
require ‘resolv’
Resolv::DNS.open do |dns|
res = dns.getresources ARGV.shift, Resolv::DNS::Resource::IN::MX
exchanges = {}
res.each do |r|
exchanges[r.exchange] = r.preference
end
forward = Hash.new { |h, k| h[k] = [] }
exchanges.each_key do |exchange|
res = dns.getresources exchange, Resolv::DNS::Resource::IN::A
res.each do |r|
forward[exchange] << r.address
end
end
forward.each do |exchange, addresses|
addresses.each do |address|
res = dns.getresources address.to_name,
Resolv::DNS::Resource::IN::PTR
res.each do |r|
puts "MX #{exchange} #{exchanges[exchange]}"
puts "\thas address #{address}"
puts "\twith reverse #{r.name}"
end
end
-> “550-5.7.1 [178.190.40.208] The IP you’re using to send mail is not
authorized to\r\n”
-> “550-5.7.1 send email directly to our servers. Please use the SMTP
relay at your\r\n”
-> “550-5.7.1 service provider instead.”
-> “550-5.7.1 [178.190.40.208] The IP you’re using to send mail is not
authorized to\r\n”
-> “550-5.7.1 send email directly to our servers. Please use the SMTP
relay at your\r\n”
-> “550-5.7.1 service provider instead.”
Sounds like too much spam comes from your ISP
If you’re using the script I posted or something like it to do spammy
things I imagine it will block you before long.
Ok got it, thank you very much all.
So, to do a DNS reverse lookup the ruby’s gem telnet is not the best
tool. But then I’m wondering : what is useful to?
It seems that it doesn’t recognize from the second command onward.
So basically I’m able to perform just the first “helo my email
address”, but I’m don’t receive any answer for an eventual “mail
from:<email>” or “rcpt to:<email>”.
Any idea?
This script uses Net::SMTP and can send mail to gmail.com accounts
smtp.start ‘example’ do
smtp.mailfrom ‘[email protected]’
smtp.rcptto ‘[email protected]’
smtp.data do |body|
body.puts “Subject: test from net/smtp”
body.puts “From: [email protected]”
body.puts “Date: #{Time.now.rfc2822}”
body.puts
body.puts “This is how net/smtp works:”
body.puts
IO.readlines(FILE).each do |line|
body.puts " #{line}"
end
end
end
Ok got it, thank you very much all.
So, to do a DNS reverse lookup the ruby’s gem telnet is not the best
tool. But then I’m wondering : what is useful to?