Author: Amazon.cn [eweekly@amazon.cn]
Subject: (AD)家居家电大清仓1折起,宿舍用品特惠总动员,考试参考书底价登场。
#!/bin/bash
username="你的GMAIL用户名"
password='你的GMAIL密码'
SHOW_COUNT=5 #输出头 5 封未读邮件
echo
curl-u $username:$password --silent "https://mail.google.com/mail/feed/atom" | \
tr -d '\n' | sed 's:</entry>:\n:g' | \
sed 's/.*<title>\(.*\)<\/title.*<author><name>\([^<]*\)<\/name><email>\([^<]*\).*/Author: \2 [\3] \nSubject: \1\n/' | \
head -n $(( $SHOW_COUNT * 3 ))
[beyes@beyes gmail]$ sh getmail.sh
Author: Google+ 小组 [noreply-daa26fef@plus.google.com]
Subject: 开始使用 Google+
Author: Amazon.cn [eweekly@amazon.cn]
Subject: (AD)家居家电大清仓1折起,宿舍用品特惠总动员,考试参考书底价登场。
Author: Amazon.cn [eweekly@amazon.cn]
Subject: (AD)学生生活用品促销季!家居冬季品清仓1.5折!容声迷你洗衣机279元!42寸全能LED直降900元!
Author: GoDaddy.com [offers@godaddy.com]
Subject: What's not to love?
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |