Sha256: 613192b93a4726c5e3e0a406e9dc760dc7a536ace5c64aa686546abb0d6b30ea

Contents?: true

Size: 452 Bytes

Versions: 2

Compression:

Stored size: 452 Bytes

Contents

#!/usr/bin/ruby

if ARGV.length != 2 && ARGV.length != 3
  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

2 entries across 2 versions & 1 rubygems

Version Path
dkim-0.0.3 bin/dkimsign.rb
dkim-0.0.2 bin/dkimsign.rb