Why Gmail Filter Import is Silently Failing

gmailgmail-filtersimport

Import of Gmail filters started to silently fail and I am looking for way to fix that. I am using an option on https://mail.google.com/mail/u/0/?hl=pl&shva=1#settings/filters („Import filters”, „Browse” button to select file „Open file” to open the file, „Create filters” to create filters.

enter image description here

In the past it caused all my filters to appear in order in Gmail filters. Nowadays only random subset of my filters appears in random order is imported. In addition Gmail is not reporting problems during upload process.

Hopefully it is not caused by problem with my setup, I tried on a completely different laptop and still 62 filters from 779 silently failed. What worse, some my filter rely on a specifi processing order, and after import order is no longer kept.

In the past it worked correctly. I thought that the problem was caused by ever-increasing number of filters. But I tried importing smaller group of them – that some time ago worked perfectly – and some filters still failed to appear.

Is there a way to upload large number of gmail filters (for example 1000) with all of them appearing in the same order as specified in the xml file? Or at least get an error message once something goes wrong?

enter image description here

After import I sometimes get yellow box with error #102 leading to https://support.google.com/mail/answer/7036382 that recommends to check

So what I can do to at least get an useful error?

Best Answer

For reordering filters part - according to my research there is no viable way to avoid that. Gmail filters must be designed to allow any order of execution, and in many cases it is achievable.

For the silent failure part - currently as a workaround I have test.xml file with desirable filters. I import this filters to Gmail, export created filter to a file that I save as gmail.xml.

After that I run a script that detects filterers present in Gmail, not present in test.xml. Filters not present in Gmail are saved to a file that I import into Gmail again.

If someone would consider such script as useful - let me know in comments and I will publish it on a Github.