Sha256: d31594818d38260d20d89bdf4e66d7112f4b679868f0918bb2e9404ecbfa8ad3
Contents?: true
Size: 528 Bytes
Versions: 13
Compression:
Stored size: 528 Bytes
Contents
# # checking mail From: header # require 'tmail' unless ARGV[0] then $stderr.puts "usage: ruby fromcheck.rb <mhdir>" exit 1 end table = {} # from-addr-spec => [count, friendly-from] ld = TMail::MhLoader.new( ARGV[0] ) ld.each_port do |port| mail = TMail::Mail.new( port ) addr, = mail.from_addrs if addr then (table[addr.spec] ||= [0, mail.friendly_from])[0] += 1 end end table.to_a.sort {|a,b| b[1][0] <=> a[1][0] }.each_with_index do |(spec,(n,from)), i| printf "%3d %-33s %d\n", i+1, from, n end
Version data entries
13 entries across 13 versions & 7 rubygems