I setup mutt so I can access my Gmail account from terminal.
Now I want to get all the email subjects in bash terminal (not inside mutt)so I can analyze it later.
I tried this:
寫道: |
curl -u username:password --silent "https://mail.google.com/mail/feed/atom" | tr -d '\n' | awk -F '<entry>' '{for (i=2; i<=NF; i++) {print $i}}' | sed -n "s/<title>\(.*\)<\/title.*name>\(.*\)<\/name>.*/\2 - \1/p"
|
This one has a problem: Gmail automatically put related email under one subject. So if I send a new email sometime it won't show up.
Any suggestion?
Thanks.
可以考慮用pop3或者imap協議下載subject list
I did it with IMAP after connected with openssl.