4 ms·
I use this to check my gmail from the command line (they don't include gmail in the examples). Ugly but fun: alias gm1='curl -u USERNAME:PASSWORD --silent
by 10ren 16y ago
I use this to check my gmail from the command line (they don't include gmail in the examples). Ugly but fun:
alias gm1='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" |
sed '\''s/</>/g'\'' '
EDIT and send mail by setting the headers (including MAIL FROM:<USERNAME@gmail.com>) and body (using uuencode for attachments) in email, and then:
echo "$email" | netcat ISPs_MAILSERVER 25
- stretchwithme 16y agoNow that is a hacker! excellent.
- Groxx 16y agoInteresting and fun, but it doesn't spit out any info for me, despite the atom having an email appearing in it. I'll poke into it when I get more time. I quite like the idea :)
- surki 16y agoI use wget for the same. I usually call it from gnu screen, to update the status line with the no. of unread mails unread="$(wget --secure-protocol=TLSv1 --timeout=3 -t 1 -q -O - \ https://${gmail_login}:${gmail_password}@mail.google.com/mail/feed/atom | sed -n "s/<fullcount>\(.*\)<\/fullcount>/\1/p")" unread=${unread:-0} echo $unread And also worth checking out http://groups.google.com/group/emacs-g-client?pli=1 http://groups.google.com/group/emacs-g-client?pli=1 if you are into emacs side of the things.