Sha256: b9ac73b812e9832d7eb8376889dac21abcf3372f3e9494a7bf533fd0e90d0dd2

Contents?: true

Size: 452 Bytes

Versions: 5

Compression:

Stored size: 452 Bytes

Contents

#!/usr/bin/ruby

if ARGV.length != 3 && ARGV.length != 4
  puts "Usage: dkimsign.rb DOMAIN SELECTOR KEYFILE [MAILFILE]"
  exit 0
end

require 'dkim'

domain, selector, keyfile, mailfile = ARGV

keyfile  = File.open(keyfile)
mailfile = mailfile ? File.open(mailfile) : STDIN

mail = mailfile.read.gsub(/\r?\n/, "\r\n")
key  = keyfile.read

Dkim::domain = domain
Dkim::selector = selector
Dkim::private_key = key

print Dkim::SignedMail.new(mail).to_s


Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dkim-1.1.0 bin/dkimsign.rb
dkim-1.0.1 bin/dkimsign.rb
dkim-1.0.0 bin/dkimsign.rb
dkim-0.2.0 bin/dkimsign.rb
dkim-0.1.0 bin/dkimsign.rb