Giter VIP home page Giter VIP logo

Comments (3)

mbrt avatar mbrt commented on September 21, 2024

From a cursory glance this looks OK.

To simplify, you should probably reduce chainFilters to a minimum. There's no need to chain rules if there's no overlap (i.e. no if-else-if-else). For example from:amazon and from:paypal will never be true at the same time. This means that you can just have them as separate rules and simplify the resulting filters:

  rules: [
    {
      filter: { from: "[email protected] OR [email protected]" },
      actions: { markSpam: false },
    },
    {
      filter: { from: "Amazon" },
      actions: { archive: true, markSpam: false, labels: [ "Amazon" ] },
    },
    {
      filter: { from: "Paypal" },
      actions: { archive: true, markSpam: false, labels: [ "Paypal" ] },
    },
  ]

  + lib.chainFilters([
    {
      filter: { to: me_mail1 },
      actions: { archive: true, markSpam: false, labels: [ "(1) Mail1" ] },
    },
    {
      filter: { to: me_mail2 },
      actions: { archive: true, markSpam: false, labels: [ "(2) Mail2" ] },
    },
  ]),
}

Perhaps this is true also for other rules you're chaining. In practice chainFilters are necessary only in rare cases. I personally never really had to use them.

from gmailctl.

DerDominik avatar DerDominik commented on September 21, 2024

OK. Thanks for the hint.
At the weekend I'll try to change my config and then test it :-)

from gmailctl.

github-actions avatar github-actions commented on September 21, 2024

This issue is stale because it has been open for 30 days without activity.
This will be closed in 7 days, unless you add the 'lifecycle/keep-alive' label or comment.

from gmailctl.

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.