Curl not marking mail as read!!

raj sourabh <[email protected]>
Newsgroups gmane.linux.redhat.general
Message-ID <CAHxMG41eN7tE0Au0vJfcO4We5PB5aKRogkZtU0vzHZgfqqejuA@mail.gmail.com>
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
-- 
redhat-list mailing list
unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.