From 9d80ed2af3b8f945b4aaa60e17e2c2580a18c5f3 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Thu, 8 Aug 2024 23:29:23 -0400 Subject: [PATCH] Removed mbsync --- mbsync/authinfo.template | 2 -- mbsync/file | 2 -- mbsync/makefile | 39 --------------------------------------- mbsync/mbsyncrc | 26 -------------------------- mbsync/mk_authinfo | 35 ----------------------------------- 5 files changed, 104 deletions(-) delete mode 100644 mbsync/authinfo.template delete mode 100644 mbsync/file delete mode 100644 mbsync/makefile delete mode 100644 mbsync/mbsyncrc delete mode 100755 mbsync/mk_authinfo diff --git a/mbsync/authinfo.template b/mbsync/authinfo.template deleted file mode 100644 index 8c7587f..0000000 --- a/mbsync/authinfo.template +++ /dev/null @@ -1,2 +0,0 @@ -machine 127.0.0.1 login james@jpatrick.io port 1143 password PASSWORD_PROVIDED_BY_BRIDGE -machine 127.0.0.1 login james@jpatrick.io port 1025 password PASSWORD_PROVIDED_BY_BRIDGE diff --git a/mbsync/file b/mbsync/file deleted file mode 100644 index 113cf61..0000000 --- a/mbsync/file +++ /dev/null @@ -1,2 +0,0 @@ -machine 127.0.0.1 login USERNAME_HERE@protonmail.com port 1143 password aaa -machine 127.0.0.1 login USERNAME_HERE@protonmail.com port 1025 password aaa diff --git a/mbsync/makefile b/mbsync/makefile deleted file mode 100644 index c58971d..0000000 --- a/mbsync/makefile +++ /dev/null @@ -1,39 +0,0 @@ -# -*- mode: makefile-gmake; -*- -SRC := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) - -include ../lib/shared.mk -TARGET := $(XDG_DIR)/mbsync -RC_TARGET := ~/.mbsyncrc -TRANSIENT_DIR := $(SRC)/transient - -up: - if (( $$+commands[mbsync] )) ; then - $(report) header "Setting up mbsync" - $(mk_link) $(SRC) $(TARGET) - $(mk_link) $(SRC)/mbsyncrc $(RC_TARGET) - $(MAKE) -C $(SRC) update_cert - [[ ! -e ~/.authinfo.gpg ]] \ - && $(report) "warn" "You need to setup the authinfo.gpg run \n > $(SRC)/mk_authinfo" \ - || $(report) "debug" "authinfo.gpg already installed" - else - $(report) debug "mbsync not installed. Skipping." - fi - -update_cert: - if [[ ! -e $(TRANSIENT_DIR) ]] ; then - $(report) debug "$(TRANSIENT_DIR) didn't exist. Creating one." - mkdir $(TRANSIENT_DIR) - fi - echo "" \ - | openssl s_client -starttls imap --connect 127.0.0.1:1143 -showcerts 2>/dev/null \ - | sed -n -e '/BEGIN\ CERTIFICATE/,/END\ CERTIFICATE/ p' \ - > $(TRANSIENT_DIR)/bridge.crt \ - && $(report) pass "Cert from proton bridge downloaded." \ - || $(report) error "Error while fetching cert. Is bridge running?" - -down: - $(report) header "Removing mbsync" - $(rm_link) $(TARGET) - rm -rf $(TRANSIENT_DIR) ; $(report) "Deleting $(TRANSIENT_DIR)" - $(rm_link) $(RC_TARGET) - rm ~/.authinfo.gpg ; $(report) "Deleting authinfo" diff --git a/mbsync/mbsyncrc b/mbsync/mbsyncrc deleted file mode 100644 index 2eff049..0000000 --- a/mbsync/mbsyncrc +++ /dev/null @@ -1,26 +0,0 @@ -# These settings can also go under an "Account" section, but then the -# "IMAPStore" section needs to reference the account. This is not -# needed for just one store per account. -IMAPStore mailbox-remote -Host 127.0.0.1 -Port 1143 -User james@jpatrick.io -PassCmd "gpg2 -q -d ~/.authinfo.gpg | awk 'FNR == 1 {print $8}'" -SSLType STARTTLS -CertificateFile ~/.config/mbsync/transient/bridge.crt - -MaildirStore mailbox-local -Path ~/.mail/ -Inbox ~/.mail/INBOX -SubFolders Verbatim - -Channel mailbox -Master :mailbox-remote: -Slave :mailbox-local: -Patterns * -Create Slave -#Expunge Both -SyncState * - -Group protonmail -Channel inbox diff --git a/mbsync/mk_authinfo b/mbsync/mk_authinfo deleted file mode 100755 index ef37ad2..0000000 --- a/mbsync/mk_authinfo +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env zsh - - -function cleanup(){ - if (( $+commands[shred] )) ; then - shred transient/authinfo* - elif (( $+commands[srm] )) ; then - srm transient/authinfo* - elif ; then - echo UNABLE TO FIND A WAY TO SECURELY DELETE THIS. - exit -1 - fi - rm transient/authinfo* -} - -trap cleanup EXIT - - - -cd $(dirname $0) -if [[ ! -e ./transient ]] ; then - mkdir transient -fi - -if [[ ! -e ~/transient/authinfo ]] ; then - echo "Hello. I need the bridge password for this to work." - read _password\?"password: " asdaD - sed "s/PASSWORD_PROVIDED_BY_BRIDGE/${_password}/g" authinfo.template \ - > transient/authinfo - unset _password -fi - -gpg -e -r james@jpatrick.io transient/authinfo -mv transient/authinfo.gpg ~/.authinfo.gpg -