Skip to content

Commit

Permalink
WIP Add gmail-britta
Browse files Browse the repository at this point in the history
  • Loading branch information
573 committed Oct 5, 2024
1 parent 24d6648 commit efc55b5
Show file tree
Hide file tree
Showing 9 changed files with 286 additions and 30 deletions.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ poetry2nix.inputs.nixpkgs.follows = "unstable";
;
inherit
(nixpkgs.nixVersions)
nix_2_20
nix_2_24
;
};

Expand Down
4 changes: 2 additions & 2 deletions flake/builders/mkDevenvRubyNix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pkgs.mkShell {
};

shellHook = ''
echo testfile
${rootPath}/home/misc/britta-filter.sh
chmod +x ${rootPath}/home/misc/britta-filter.rb
${rootPath}/home/misc/britta-filter.rb
'';
}
13 changes: 7 additions & 6 deletions home/base/general.nix
Original file line number Diff line number Diff line change
Expand Up @@ -134,20 +134,16 @@ in
backblaze-b2
attr

# poc
age

nix-inspect
zellij
# zellij
viddy
zoxide
;

inherit
(unstable)
eza
yazi
cyme
# yazi
;

}; # replaces with pkgs; [], i. e. because nixd catches duplicates this way
Expand Down Expand Up @@ -227,6 +223,11 @@ in
strace
lineselect
git-annex
cyme

# poc
age

#git-annex-remote-googledrive
#haskellPackages.feedback
#haskellPackages.pushme # broken
Expand Down
176 changes: 176 additions & 0 deletions home/misc/britta-filter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
#!/usr/bin/env -S ruby -W0

#require 'bundler/setup'
require 'gmail-britta'

if File.exist?(File.expand_path("~/.gmail-britta.personal.rb"))
require "~/.gmail-britta.personal.rb"
end


puts(GmailBritta.filterset(:me => MY_EMAILS) do
to_me = MY_EMAILS.map{|address| "to:#{address}"}
from_me = MY_EMAILS.map{|address| "from:#{address}"}

filter {
has [{:or => BFF.map{|e| "from:#{e}"}}, {:or => to_me}]
label BFF_LABEL
never_spam
}.otherwise {
has [{:or => from_me}, {:or => BFF.map{|e| "to:#{e}"}}]
label BFF_LABEL
never_spam
}.archive_unless_directed

filter {
has [{:or => SPOUSE.map{|e| "from:#{e}"}}, {:or => to_me}]
label SPOUSE_LABEL
mark_important
never_spam
}.otherwise {
has [{:or => from_me}, {:or => SPOUSE.map{|e| "to:#{e}"}}]
label SPOUSE_LABEL
mark_important
never_spam
}.archive_unless_directed

filter {
has [{:or => NOT_MY.map{|e| "to:#{e}"}}]
label ID_SCAM_LABEL
archive
mark_read
}

filter {
has AUTHORITIES
label 'authorities'
archive
mark_read
mark_important
}

# Archive all mailman mail except confirmation ones
filter {
has %w{from:mailman subject:confirm}
label 'bulk'
smart_label 'notifications'
}.otherwise {
has %w{from:mailman}
label 'bulk'
smart_label 'notifications'
archive
}

filter {
has [{:or => ['from:noreply@humblebundle.com', 'from:support@skillsfaster.com']}]
label PURCHASES_LABEL
archive
}.otherwise {
has [{:and => ['from:contact@humblebundle.com', 'subject:"Your Humble Bundle order is ready"']}]
label PURCHASES_LABEL
archive
}

# Stuff from the bank:
filter {
has BANK_EMAILS
label 'banking'
mark_important
}

filter {
has V_EMAILS
label '♥♛'
mark_important
never_spam
}

filter {
has ['from:no-reply@researchgate.net']
label 'bulk/researchgate'
smart_label 'social'
}.otherwise {
# Mail from web services I don't care about THAT much:
bacon_senders = %w{sender@mailer.33mail.com store-news@amazon.com thisweek@yelp.com no-reply@vimeo.com
no-reply@mail.goodreads.com *@carsonified.com *@crossmediaweek.org updates@linkedin.com
tordotcom@mail.macmillan.com noreply@myopenid.com tor-forge@mail.macmillan.com announce@mailer.evernote.com
info@getsatisfaction.com Transport_for_London@info.tfl.gov.uk legendsofzork@joltonline.com news@xing.com
noreply@couchsurfing.com noreply@couchsurfing.org newsletter@getsatisfaction.com store-offers@amazon.com
gameware@letter.eyepin.com info@busymac.com engage@mail.communications.sun.com *@dotnetsolutions.co.uk
office@runtasia.at noreply@cellulare.net support@heroku.com team@mixcloud.com automailer@wikidot.com
no-reply@hi.im linkedin@em.linkedin.com chromium@googlecode.com
noreply@comixology.com support@plancast.com *@*.boinx.com news@plug.at newsletter@gog.com service@youtube.com
email@online.cvs.com info@mail.shoprunner.com yammer@yammer.com info@meetup.com support@boostblogtraffic.com
info@mailer.netflix.com help@otherinbox.com lush.vida@gmail.com udemy@email.udemy.com
mail@enews.uniqlo-usa.com news@emailnews.meinfernbus.de topangebote@newsletter.voyages-sncf.de
inquire@mrquikhomeservices.co apress@news.springer.com newsletter@news.fressnapf.de mail@family-newsletter.de
ticketnews@service.eventim.de noreply@ladyvlondon.com email.campaign@sg.booking.com info@twitter.com
info@fonografie.de newsletter@hearthis.at mailer@experteer.de newsletter@newsletter.srv2.de
kundenservice@oyakankerbank.de inquire@mrquikhomeservices.com noreply@finanzcheck.de service@santander.de
verizon-info@verizon.com medimops@info.medimops.de *@hoerspielsommer.de mailstrom@410labs.com
noreply@bandcamp.com noreply@congstarnews.de no-reply@info.twitter.com website@remobjects.com
newsletter@sounds-exclusive.com no-reply@portal.appdynamics.com info@neues.ebay-kleinanzeigen.de
ticketalarm@service.eventim.de do-not-reply@amazon.com bestellbestaetigung@amazon.de
notifications-noreply@linkedin.com noreply@medium.com bestellung@deichmann.com contact@packtpub.com
karten-online@cinestar.de no-reply@mendeley.com service@glyde.com noreply@jpberlin.de schuenemann-verlag.de
appintelligence@appdynamics.com mricci@allaboutjazz.com contact@humblebundle.com lieferservice@newsletter.rewe.de
newsletter@teilauto.net cmail20.com support@smartblogger.com mailer@infusionmail.com noreply@zenva.com
mail249.suw12.mcsv.net}

has [{:or => "from:(#{bacon_senders.join("|")})"}]
archive
label 'bulk'
smart_label 'notifications'
}.otherwise {
to_me = me.map {|address| "to:#{address}"}
has [{:or => to_me}]
label '⚓'
}

filter {
has [{:or => ['from:ship-confirm@amazon.com', 'from:auto-confirm@amazon.com']}, {:or => ['subject:"shipped"', 'subject:"tracking number"']}]
label 'bulk/packages'
smart_label 'notifications'
forward_to AMAZON_PACKAGE_TRACKING_EMAIL
}

filter {
has %w{from:support@dnsimple.com}
archive
label 'bulk/admin'
smart_label 'notifications'
}

filter {
has %w{from:notifications@github.com}
archive
label 'github'
smart_label 'notifications'
}

filter {
has %w{from:stadtbib@leipzig.de}
label 'bulk'
smart_label 'notifications'
}

filter {
has %w{from:dsl-kundenservice@cc.o2online.de}
label 'bulk'
smart_label 'notifications'
}

filter {
has ['from:do-not-reply@stackexchange.com', {:or => ['subject:"French Language Weekly Newsletter"', 'subject:"English Language Learners Weekly Newsletter"']}]
label 'bulk/languages'
smart_label 'forums'
}

filter {
has CALENDAR_EMAILS
label 'calendar timer'
mark_important
never_spam
}

end.generate)
3 changes: 0 additions & 3 deletions home/misc/britta-filter.sh

This file was deleted.

1 change: 1 addition & 0 deletions home/programs/emacs-novelist.nix
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ let
pname = "default.el";
version = "0";
src = pkgs.writeText "default.el" ''
;; FIXME https://github.com/Gavinok/emacs.d/blob/main/init.el#L725
(use-package gcmh
:ensure t
:diminish
Expand Down
Loading

0 comments on commit efc55b5

Please sign in to comment.