Skip to content

Instantly share code, notes, and snippets.

@ckhung
Last active September 15, 2015 06:55
Show Gist options
  • Save ckhung/e76a64b62e5f800bd668 to your computer and use it in GitHub Desktop.
Save ckhung/e76a64b62e5f800bd668 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl -w
# http://newtoypia.blogspot.com/2015/09/gmail-mbox.html
# 備份/清空 gmail, 以及命令列查詢/切割 mbox 格式檔案
use MIME::Base64;
while (<STDIN>) {
foreach $kw (@ARGV) {
next unless (($line) = /^$kw:\s*(.*)/);
$line = decode_base64($1)
if $line =~ /=\?utf-8\?\w+\?(.*)/i;
print "$kw: $line\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment