Last active
September 15, 2015 06:55
-
-
Save ckhung/e76a64b62e5f800bd668 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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