Skip to content

Instantly share code, notes, and snippets.

@eatnumber1
Created May 6, 2014 18:42
Show Gist options
  • Save eatnumber1/87cbdb07c753980be90f to your computer and use it in GitHub Desktop.
Save eatnumber1/87cbdb07c753980be90f to your computer and use it in GitHub Desktop.
Mail filters:
Process this with m4 to produce copy & pasteable output.
Keep in mind that multiple filters without an operator between them actually means logical and.
dnl
changequote(`[', `]')dnl
define([filter],
[patsubst(
translit([$1], [
], [ ]),
[ +], [ ])])dnl
Name:
Sent by humans, doesn't match Name Prod.
filter(
-from:[email protected]
-list:[email protected]
(
list:[email protected] OR
list:[email protected] OR
list:[email protected] OR
(list:[email protected]
-to:[email protected]
-to:[email protected]
-to:[email protected]
-from:[email protected]
-from:[email protected]
-list:[email protected]
dnl Aggrivatingly, these emails are to foo@bar and from foo@bar
dnl and have no additional information.
-subject:[email protected])
OR
(list:[email protected]
-from:[email protected]
-from:[email protected])
OR
(list:[email protected]
-to:[email protected])
)
)
Name Prod:
Sent by humans, relevant to oncaller.
filter(
(list:[email protected]
-from:[email protected]
-to:[email protected]
-to:[email protected]
-to:[email protected]
-to:[email protected]
-to:[email protected]
-to:[email protected]
-to:[email protected]
-to:[email protected])
OR
(list:[email protected]
-from:[email protected]
-from:[email protected])
OR
list:[email protected]
)
Robots:
Automated mail. Should be conceptually equivalent to ~(Name ∪ Name Prod).
filter(
(list:[email protected]
(to:[email protected] OR
to:[email protected] OR
to:[email protected] OR
from:[email protected] OR
dnl Aggrivatingly, these emails are to [email protected] and from [email protected]
dnl and have no additional information.
subject:[email protected]))
OR
(list:[email protected]
(to:[email protected] OR
to:[email protected] OR
to:[email protected] OR
to:[email protected] OR
to:[email protected] OR
to:[email protected] OR
to:[email protected] OR
to:[email protected]))
OR
(list:[email protected]
from:[email protected])
OR
(list:[email protected]
to:[email protected])
OR
list:[email protected] OR
from:[email protected]
)
Bugs:
Description goes here
filter(
from:[email protected]
(list:[email protected] OR
list:[email protected] OR
list:[email protected])
)
Reviews:
Code reviews
filter(
(list:[email protected]
list:[email protected])
OR
list:[email protected]
)
dnl vim:ft=m4 tw=100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment