mscdex / node-imap

An IMAP client module for node.js.
MIT License
2.15k stars 380 forks source link

fetch without openBox #576

Open pqvst opened 7 years ago

pqvst commented 7 years ago

I believe it isn't possible to fetch (by uid) without opening a box?

The readme states:

Fetches message(s) in the currently open mailbox.

However, the code doesn't do a check for an open box. Bug?

mscdex commented 7 years ago

You cannot fetch messages without opening a mailbox, you can only gather some mailbox stats from a mailbox without opening it (.status()).

pqvst commented 7 years ago

That's what I thought. So should there be a mailbox check in fetch, or is there any reason why that was left out?

if (!this._box)
      throw new Error('No mailbox specified or currently selected');
mscdex commented 7 years ago

No reason that I remember. Besides _fetch(), there should also be if (this._box === undefined) checks for expunge() and _thread().