aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2020-06-25 14:41:17 +0200
committerKarel Kočí <cynerd@email.cz>2020-06-25 14:41:17 +0200
commit5b32edcf88fe0b952100547b1b26f2eda15d47f1 (patch)
tree96b48c68405607451b14cb9e7ea091be1a4a9bcd
parentc76a1f17761b8b0787a8f142ca73dd69d6737387 (diff)
downloadmyconfigs-5b32edcf88fe0b952100547b1b26f2eda15d47f1.tar.gz
myconfigs-5b32edcf88fe0b952100547b1b26f2eda15d47f1.tar.bz2
myconfigs-5b32edcf88fe0b952100547b1b26f2eda15d47f1.zip
Replace offlineimap with isync
-rwxr-xr-xconfig/offlineimap/config22
-rwxr-xr-xinstall31
-rwxr-xr-xlocal/bin/allsync20
-rwxr-xr-xlocal/sbin/syncemail48
m---------private0
5 files changed, 34 insertions, 87 deletions
diff --git a/config/offlineimap/config b/config/offlineimap/config
deleted file mode 100755
index 6853963..0000000
--- a/config/offlineimap/config
+++ /dev/null
@@ -1,22 +0,0 @@
-# vim: set ft=config:
-[general]
-accounts = email
-maxsyncaccounts = 4
-
-[Repository email-remote]
-type = IMAP
-remotehost = imap.seznam.cz
-remoteuser = cynerd@email.cz
-ssl = yes
-sslcacertfile = /etc/ssl/certs/ca-certificates.crt
-
-[Repository email-local]
-type = Maildir
-localfolders = ~/.mail/email
-
-[Account email]
-localrepository = email-local
-remoterepository = email-remote
-autorefresh = 1
-postsynchook = ~/.local/sbin/newmail-notify
-
diff --git a/install b/install
index d9a551c..230801a 100755
--- a/install
+++ b/install
@@ -60,13 +60,10 @@ if ask "dev" "Development tools configuration"; then
inst pylintrc ~/.pylintrc
fi
-if ask "email-sync" "Install email synchronization"; then
- inst local/bin/email-unread ~/.local/bin/email-unread
- inst local/sbin/newmail-notify ~/.local/sbin/newmail-notify
- inst_email_sync
- # Contains:
- # inst local/sbin/syncemail ~/.local/sbin/
- # inst config/offlineimap/ ~/.config/offlineimap
+if ask "cal" "Install calendar and contacts"; then
+ inst config/khal/config ~/.config/khal/config
+ inst config/khard/khard.conf ~/.config/khard/khard.conf
+ inst private/vdirsyncer/ ~/.vdirsyncer
fi
if ask "mutt" "Install mutt configuration"; then
@@ -74,13 +71,19 @@ if ask "mutt" "Install mutt configuration"; then
inst lynxrc ~/.lynxrc
inst mutt/mailcap ~/.mutt/
inst mutt/color ~/.mutt/
- inst_mutt_conf
- # Contains:
- # inst mutt/ ~/.mutt
- # inst msmtprc ~/.msmtprc
+ inst private/mutt/ ~/.mutt
+ inst private/msmtprc ~/.msmtprc
mkdir -p ~/.cache/mutt # directory for temporaly html files
fi
+if ask "sync" "Install synchronization"; then
+ inst local/bin/allsync ~/.local/bin/allsync
+ inst local/bin/email-unread ~/.local/bin/email-unread
+ inst local/sbin/newmail-notify ~/.local/sbin/newmail-notify
+ inst private/mbsyncrc ~/.mbsyncrc
+ inst_sync
+fi
+
if ask "desktop" "Install desktop generic"; then
# Theme
inst gtk-2.0/gtkrc ~/.gtkrc-2.0
@@ -106,12 +109,6 @@ if ask "wayland" "Install Wayland (sway)"; then
inst config/swaylock/ ~/.config/swaylock
fi
-if ask "cal" "Install calendar and contacts"; then
- inst config/khal/config ~/.config/khal/config
- inst config/khard/khard.conf ~/.config/khard/khard.conf
- inst private/vdirsyncer/ ~/.vdirsyncer
-fi
-
if ask "surf" "Install Surf configuration"; then
inst surf/script.js ~/.surf/script.js
inst surf/styles/default.css ~/.surf/styles/default.css
diff --git a/local/bin/allsync b/local/bin/allsync
new file mode 100755
index 0000000..b475460
--- /dev/null
+++ b/local/bin/allsync
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+sec() {
+ echo -e '\e[1;34m==========' "$@" '==========\e[0m'
+}
+
+
+run() {
+ sec "Mail"
+ mbsync -a
+ ~/.local/sbin/newmail-notify
+
+ sec "Calendar and contacts"
+ vdirsyncer sync
+}
+
+
+
+
+run
diff --git a/local/sbin/syncemail b/local/sbin/syncemail
deleted file mode 100755
index 3cb56a4..0000000
--- a/local/sbin/syncemail
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/python2
-# This starts offlineimap, but first it requests passwords from pass
-import os
-import sys
-import subprocess
-import daemon
-import lockfile
-import syslog
-from offlineimap import OfflineImap
-
-pidfile = '/tmp/syncemail-%d.pid' % os.getuid()
-
-# Check if not already running
-def check_running():
- if os.access(pidfile, os.F_OK):
- with open(pidfile, "r") as f:
- pid = f.readline()
- if os.path.exists('/proc/%s' % pid):
- sys.exit(0)
-check_running()
-
-
-accounts = [
- ["email", "mail/cynerd@email.cz"],
- ]
-
-for acc in accounts:
- pproc = subprocess.Popen("pass " + acc[1],
- stdout=subprocess.PIPE, shell=True)
- output = pproc.stdout.read().rstrip()
- if pproc.wait() != 0:
- print("Password receive failed.")
- sys.exit(1)
- sys.argv.append('-k')
- sys.argv.append('Repository_' + acc[0] + '-remote:remotepass=' + output)
-
-# Define out logger and redirect stdout and stderr to it
-class logstd:
- def write(self, data):
- syslog.syslog(data)
-
-with daemon.DaemonContext():
- check_running()
- with open(pidfile, "w") as f:
- f.write("%s" % os.getpid())
- syslog.openlog('syncemail')
- sys.stderr = sys.stdout = logstd()
- OfflineImap().run()
diff --git a/private b/private
-Subproject c8c98ced6f1ddeab043d8017f4bd5c64184a68f
+Subproject dfa038cf131612c96ffa859bd0b7added2bd249