Removed mbsync
This commit is contained in:
parent
29ba1caac3
commit
9d80ed2af3
|
@ -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
|
|
|
@ -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
|
|
|
@ -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"
|
|
|
@ -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
|
|
|
@ -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
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user