SpiderStrategies / node-gmail-api

Node module to interact with the gmail api
ISC License
154 stars 29 forks source link

Gmail API date range doesn't return all the mails #17

Closed naveenpaul closed 8 years ago

naveenpaul commented 8 years ago

My date range is - after:2015/12/24 before:2016/3/25

but the API returns me only for the past few days and it completely misses the beginning dates. I get 51 emails.

But using the same date range in the Gmail web app, I get 225 emails.

I do have emails for those dates and they are never returned by the API. What am I missing here?

I parse the payload this way

ar s = gmail.messages(filter);

   s.on('data', function (d) {
            if(common.checkRequired(d) && common.checkRequired(d.payload) && common.checkRequired(d.payload.headers)){
                if(d.payload.headers.length > 0){
                    var headers = d.payload.headers;
                    var email = parseEmailHeader(d.id,headers);

I'm struggling to get it right from few days. Any help would be grateful.

nathanbowser commented 8 years ago

Sounds like there could be a bug. PR welcome.

naveenpaul commented 8 years ago

I was using 0.3.0 version. Updating to version 0.6.0 solved the problem.