GithubHelp home page GithubHelp logo

Mark an email as spam about node-imap HOT 4 CLOSED

mscdex avatar mscdex commented on July 17, 2024
Mark an email as spam

from node-imap.

Comments (4)

mscdex avatar mscdex commented on July 17, 2024 1

For gmail, to mark a message as spam, you should do this:

imap.move(msgId, '[Gmail]/Spam', function(err) {
  /* do something here */
});

To mark a message as not spam, you'd open the '[Gmail]/Spam' mailbox, find the message id (or sequence number -- if you're using the imap.seqno.*-based commands), and then move it back to INBOX:

imap.openBox('[Gmail]/Spam', function(err) {
  if (!err) {
    // first find your message id, and then ....
    imap.move(msgId, 'INBOX', function(err) {
      /* do something here */
    });
  }
});

from node-imap.

mscdex avatar mscdex commented on July 17, 2024

What provider are you using?

Gmail is a special beast. Although it's about Opera's mail client, there's a table of Gmail processes and how they translate to IMAP, and some other useful information here: http://files.myopera.com/burnout426/files/gmail_imap_table.html

from node-imap.

AndreLigeiro avatar AndreLigeiro commented on July 17, 2024

I'm using Gmail,

In my code I put after imap connect and before openbox:
function(result) { imap.getBoxes('INBOX',function(error,inbox){
console.log(require('util').inspect(inbox));
}); }

And I get: {INBOX: {attribs:[ ], delim: '/', children: null, parent:null}}
How can I get a [Gmail]' children folders ('All Mail', 'Drafts', ...).

Tanks

from node-imap.

AndreLigeiro avatar AndreLigeiro commented on July 17, 2024

Thanks a lot.

from node-imap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.