Better API support for message filters

(Originally posted here)

The Mail APIs all list under action:
There’s no add_header on this list; however, the web panel gives that option. Trying to set action=add_header gives an invalid_action error. What gives?

Also, rank is listed as optional, but not including it gives a no_rank_1 error.

Ok, this is an old thread, but just today I stumbled upon this very same problem.
I build a program to create mail filters programatically, but there is no add_header action!

When I listed all my filters using the API, many of them had the add_header action.
Following that, I deleted all of them, and tried to rebuild them from the list.
And alas: I can’t because this action is not implemented!

Now I have a VERY broken filter list that I must reconstruct by hand.
And, even more important: add_header is the only way to flag messages in a compatible manner.
Without this option, the API for mail filters is way too restricted, and almost useless.

Am I typing the action correctly? Is there a workaround?
Will this be implemented?

Please, shed a light!
Thanks a lot!

The lack of the “add_header” action in the API is probably a bug. I’ll take a look.

Yep; looks like we forgot to expose that action in the API. I’ve got a fix on the way.

That’s very good news!
Thanks a lot!

And… done. :slight_smile:

Tested and… it’s working!