Skip to content

Instantly share code, notes, and snippets.

@jacobian
Created April 15, 2015 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacobian/db6bc455e84f2ff3b4ff to your computer and use it in GitHub Desktop.
Save jacobian/db6bc455e84f2ff3b4ff to your computer and use it in GitHub Desktop.
require 'gmail-britta'
ME = %w{jacob@heroku.com jkaplan-moss@salesforce.com jacob@jacobian.org}
puts(GmailBritta.filterset(:me=>ME) do
# sputnik - label, keep in inbox; these are alerts
filter {
has ['from:sputnik']
label 'alert/sputnik'
never_spam
}
# heroku mailing lists
%w{
announcements
customer-notes
discussion
engineers
engmanagers
fun
giving
justice
managers
meta
remote
speakers
}.each do |ml|
filter {
has ["#{ml}.heroku.com"]
label "lists/#{ml}"
}.archive_unless_directed
end
# security mailing lists are special because legacy
filter {
has [:or => %w{
list:abuse.heroku.com
list:security.heroku.com
list:security-team.heroku.com
}]
label "lists/security"
}.archive_unless_directed
# security-core - label, but keep in inbox
filter {
has %w{list:security-core.heroku.com}
label "lists/security-core"
}
# sfdc announce lists
%w{employeesuccess marcb}.each do |ml|
filter {
has ["from:(#{ml}@salesforce.exacttarget.com)"]
label "lists/sfdc/#{ml}"
}.archive_unless_directed
end
# trustteam mailing list
filter {
has ["list:trustteam.salesforce.com"]
label "lists/sfdc/trustteam"
}.archive_unless_directed
# notifications
filter {
has ["from:(emailreminderservice@concursolutions.com)"]
label "notifications/concur"
archive
}
filter {
has ["from:(ec2-abuse@amazon.com)"]
label "notifications/ec2-abuse"
archive
}
filter {
has ["from:(hipchat@heroku.com)"]
label "notifications/hipchat"
archive
}
filter {
has :or => %w{
from:(noreply@chatter.salesforce.com)
from:(success-notif@salesforce.com)
}
label "notifications/chatter"
archive
}
filter {
has %w{from:(support@heroku.com)}
label "notifications/tickets"
# don't archive - keep in the inbox so I see them
}
# billing
filter {
has ["from:(AmericanExpress@welcome.aexp.com)"]
label "billing/amex"
archive
}
# *plonk*
filter {
has %w{from:(alerts@logentries.com) subject:([heroku])}
delete_it
}
filter {
has %w{from:(noreply@newrelic.com) subject:(performance report)}
delete_it
}
filter {
has %w{from:(support@papertrailapp.com) subject:([heroku])}
delete_it
}
end.generate)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment