Curl not marking mail as read!!

raj sourabh rajsourabh1 at gmail.com
Mon Aug 20 19:44:23 UTC 2012


Hi All,

I am trying to write a script which respond to all the mails received on my
gmail account. I am able to get the sender's email address successfully
using curl (check below). But the problem here is, this is not marking the
mail as read and/or it is fetching all the email addresses everytime the
script runs.

Is there anyway i can make curl to fetch only the new mails and once only.

*#!/bin/bash*
*
*
*var=$(curl -u gmail_username:gmail_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.*email>\(.*\)<\/email>.*/\2 /p')*
*
*
*for i in $var*
*do*
*echo $i*
*done*


Please suggest.

Thanks for help.
Raj



More information about the redhat-list mailing list