Skip to content

Instantly share code, notes, and snippets.

@ziadoz
Last active December 24, 2015 16:38
Show Gist options
  • Save ziadoz/6829018 to your computer and use it in GitHub Desktop.
Save ziadoz/6829018 to your computer and use it in GitHub Desktop.
Unzip GMVault Compressed Emails
#!/usr/bin/env ruby
# GMVault: http://gmvault.org/
# Unzips GMVault compressed emails (.eml.gz).
# Enter an absolute path, e.g., /Users/Username/gmvault-db/db
print 'Enter the directory path containing the zip files: '
path = STDIN.gets.chomp.chomp('/')
path = path + '/**/*.eml.gz'
require 'shellwords'
Dir.glob(path).each do |gzip|
puts 'Extracting Email: ' + gzip
system "gunzip #{Shellwords.escape(gzip)}"
end
puts 'Completed!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment