chadxz / imap-simple

Wrapper over node-imap, providing a simpler api for common use cases
MIT License
243 stars 80 forks source link

Delete and Expunge Feature #58

Closed synox closed 4 years ago

synox commented 5 years ago

I would like to implement delete(uids) as a convenience function to addFlags(uids, '\\Deleted') Moreover I would expose the expunge() function.

Any tips what to look out for? Can I start?

I am using this in my new application (https://github.com/synox/void-mail). So far i just use connection.imap to access the underlying implementation, but this is not clean. 👍

chadxz commented 5 years ago

Hey @synox, thanks for reaching out.

I would expect a method named "delete" to actually delete the messages with the specified uids, without having to call a second expunge() method. Don't you think?

If you are wanting to expose a delete() method, wouldn't it be better to do both addFlags and expunge in the same call?

synox commented 5 years ago

You are right, i'll do that. :)

Felipedelima123 commented 5 years ago

Hey guys, thanks for this lib, it really help me. There is any way of use this on fetchOptions? Like:

const fetchOptions = {
            bodies: ['HEADER', 'TEXT'],
            markSeen: true,
            markDeleted: true,
        };
synox commented 5 years ago

I think we could merge this?