Re:Gmailctl – Declarative Configuration for Gmail Filters
by mehrdadn on Sunday March 29, 2020 @01:42AM
(#22716722)
Oh cool! Version control is useful. I might give it a shot sometime. I didn't have anything of the sort.
If you're curious, the tool I came up with had a DSL like this:
$excom = from:example.com
$exorg = from:(example.org OR example.net)
if ($excom AND $exorg) AND -(to:me OR in:spam)
archive
if cc:person
label "Person"
end
end
if (from:example.com from:{example.org example.net}) -{to:me in:spam}
archive
end
if (from:example.com from:{example.org example.net}) -{to:me in:spam} cc:person
label "Person"
end
It didn't treat the filter as a blob (it actually parsed it and removed quotes etc. if appropriate) but it also didn't really change the underlying language either.
But it had variable and did let you nest conditions which made it easier to write some things. (Or so I hoped. In the end I didn't feel it was worth it...)
If you're curious, the tool I came up with had a DSL like this:
and it'd auto-translate to this: which it would translate back to this: It didn't treat the filter as a blob (it actually parsed it and removed quotes etc. if appropriate) but it also didn't really change the underlying language either.But it had variable and did let you nest conditions which made it easier to write some things. (Or so I hoped. In the end I didn't feel it was worth it...)