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

Version Path
japetheape-tmail-1.2.3.4 sample/from-check.rb
ledermann-tmail-1.2.5 sample/from-check.rb
lonbaker-tmail-1.2.3.1 sample/from-check.rb
valodzka-tmail-1.2.3.2 sample/from-check.rb
valodzka-tmail-1.2.3.3 sample/from-check.rb
valodzka-valodzka-tmail-1.2.3.2 sample/from-check.rb
sa-tmail-1.2.5.1 sample/from-check.rb
tmail-1.2.3.1 sample/from-check.rb
tmail-1.2.3 sample/from-check.rb
tmail-1.2.2 sample/from-check.rb
tmail-1.2.1 sample/from-check.rb
tmail-1.2.0 sample/from-check.rb
tmail-1.1.1 sample/from-check.rb