aboutsummaryrefslogtreecommitdiff
path: root/offlineimap
diff options
context:
space:
mode:
authorgxlin <[email protected]>2021-07-15 08:58:04 +0800
committergxlin <[email protected]>2021-07-15 08:58:04 +0800
commit36f249e1a7250e24f0c415b5bc53ba1b2f5806d4 (patch)
treea1bfe9cba154b75c2e7d628f6eb09ea04373c9e8 /offlineimap
parentb731482680df4fcd19cb3627180bbe4ea2372820 (diff)
downloaddotfiles-36f249e1a7250e24f0c415b5bc53ba1b2f5806d4.tar.gz
dotfiles-36f249e1a7250e24f0c415b5bc53ba1b2f5806d4.tar.bz2
dotfiles-36f249e1a7250e24f0c415b5bc53ba1b2f5806d4.zip
Remove config of offlineimap
Diffstat (limited to 'offlineimap')
-rw-r--r--offlineimap/.offlineimaprcbin1284 -> 0 bytes
-rw-r--r--offlineimap/offlineimap.py13
-rwxr-xr-xofflineimap/postsynchook.sh46
3 files changed, 0 insertions, 59 deletions
diff --git a/offlineimap/.offlineimaprc b/offlineimap/.offlineimaprc
deleted file mode 100644
index 575342e..0000000
--- a/offlineimap/.offlineimaprc
+++ /dev/null
Binary files differ
diff --git a/offlineimap/offlineimap.py b/offlineimap/offlineimap.py
deleted file mode 100644
index c304ef4..0000000
--- a/offlineimap/offlineimap.py
+++ /dev/null
@@ -1,13 +0,0 @@
-import re
-
-def gmail_nametrans(foldername):
- return re.sub('^\[gmail\].', '',
- re.sub('all_mail', 'archive',
- re.sub('sent_mail', 'sent',
- re.sub('starred', 'flagged',
- re.sub('bin', 'trash',
- re.sub(' ', '_', foldername.lower()))))))
-
-def gmail_folderfilter(foldername):
- return foldername in ('INBOX', '[Gmail]/Starred',
- '[Gmail]/Drafts', '[Gmail]/All Mail')
diff --git a/offlineimap/postsynchook.sh b/offlineimap/postsynchook.sh
deleted file mode 100755
index 7262a50..0000000
--- a/offlineimap/postsynchook.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/env bash
-
-clean () {
- sed "s/^\[/\\\[/g" | sed "s/\"/'/g" | sed 's/\!/❕/g'
-}
-
-get_sender () {
- grep -o '^From: \(.*\)$' $1 | sed "s/^From: //g" | clean
-}
-
-get_subject () {
- grep -o '^Subject: \(.*\)$' $1 | sed "s/^Subject: //g" | perl -pe 'use MIME::Words(decode_mimewords); $_=decode_mimewords($_);' | clean
-}
-
-notify () {
- account=$1
- previous_messages=/tmp/offlineimap-$account-messages
- maildir="$HOME/.mail/$account/inbox/new"
-
- if [ ! -e $previous_messages ]; then
- touch $previous_messages
- fi
-
- for file in $maildir/*; do
- if [ ! -f $file ]; then
- continue
- fi
-
- filename=$(basename $file)
- if grep -Fxq $filename $previous_messages; then
- : echo "seen"
- else
- echo $filename >> $previous_messages
- sender="`get_sender $file`"
- subject=`get_subject $file`
- message="New message for $account"
-
- if [ -e /usr/local/bin/terminal-notifier ]; then
- terminal-notifier -title $subject -subtitle $sender -message $message -sender 'org.gnu.Emacs' -activate 'org.gnu.Emacs'
- fi
- fi
- done
-}
-
-mu index
-notify $1