]> git.friedersdorff.com Git - max/dotfiles.git/commitdiff
View AU mail offline
authorMaximilian Friedersdorff <max@friedersdorff.com>
Thu, 26 Apr 2018 16:38:52 +0000 (17:38 +0100)
committerMaximilian Friedersdorff <max@friedersdorff.com>
Thu, 26 Apr 2018 16:38:52 +0000 (17:38 +0100)
aber_offline_mail/.local/bin/aber_mutt [new file with mode: 0755]
aber_offline_mail/.mbsync.aber [new file with mode: 0644]
aber_offline_mail/.mutt/colors.mutt [new file with mode: 0644]
aber_offline_mail/.mutt/gpg.rc [new file with mode: 0644]
aber_offline_mail/.mutt/mutt.uk.ac.aber.maf54 [new file with mode: 0644]

diff --git a/aber_offline_mail/.local/bin/aber_mutt b/aber_offline_mail/.local/bin/aber_mutt
new file mode 100755 (executable)
index 0000000..4c50459
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+
+PASS_FILE="/dev/shm/max_aber_passwd"
+PID="/dev/shm/max_mbsync_loop_pid"
+LOG="/dev/shm/max_mail_log"
+touch $LOG
+
+clean_up()
+{
+  kill -TERM $(cat $PID)
+  rm $PID
+
+  sync_mailboxes
+  rm $PASS_FILE
+  exit
+}
+
+trap clean_up SIGTERM SIGHUP SIGINT
+
+sync_mailboxes()
+{
+  /usr/bin/mbsync -c /home/max/.mbsync.aber -a >> $LOG 2>&1
+}
+
+sync_mailboxes_loop()
+{
+  while true
+  do
+    sync_mailboxes
+
+    sleep 20
+  done
+}
+
+
+rm -f $PASS_FILE
+
+touch $PASS_FILE
+chown max:max $PASS_FILE
+chmod 600 $PASS_FILE
+pass Aber/Main | head -n 1 > $PASS_FILE
+
+sync_mailboxes_loop& >> $LOG 2>&1
+echo $! > $PID
+/usr/bin/mutt -F ~/.mutt/mutt.uk.ac.aber.maf54
+
+clean_up
diff --git a/aber_offline_mail/.mbsync.aber b/aber_offline_mail/.mbsync.aber
new file mode 100644 (file)
index 0000000..748aa26
--- /dev/null
@@ -0,0 +1,22 @@
+IMAPAccount aber
+Host outlook.office365.com 
+User maf54@aber.ac.uk 
+PassCmd "cat /dev/shm/max_aber_passwd"
+SSLType STARTTLS
+CertificateFile /etc/ssl/certs/ca-certificates.crt
+
+IMAPStore aber-remote
+Account aber
+
+MaildirStore aber-local
+Path ~/mail_aber/
+Inbox ~/mail_aber/Inbox
+SubFolders Verbatim
+
+Channel aber 
+Master :aber-remote:
+Slave :aber-local:
+Patterns "INBOX" "Sent" "Trash" "Junk E-Mail" "Lists/centos-sec" "Lists/ibers-all" "Lists/ubuntu-sec" "Notifications/NPPC" "Notifications/NPPC/Updates" "Notifications/NPPC/Uptime" "Notifications/NPPC/Icinga" "Notifications/ibers-cs" "UCU" "Suppliers/BrightComputing" "Suppliers/ClusterVision"
+Create Both
+SyncState *
+Expunge Both
diff --git a/aber_offline_mail/.mutt/colors.mutt b/aber_offline_mail/.mutt/colors.mutt
new file mode 100644 (file)
index 0000000..4f97f8b
--- /dev/null
@@ -0,0 +1,22 @@
+# vim: filetype=muttrc
+
+color normal        brightyellow    default         
+color error         red             default         
+color tilde         black           default         
+color message       cyan            default         
+color markers       red             white           
+color attachment    white           default         
+color search        brightmagenta   default         
+color status        brightyellow    black           
+color indicator     brightblack     yellow          
+color tree          yellow          default # arrow in threads
+
+color index         brightmagenta   default         "~Q"                        # messages that have been replied to
+color index         blue            default         "~U"                        # unread messages
+color index         blue            default         "~U~$"                      # unread, unreferenced messages
+color index         black           red             "~D"                        # deleted messages
+
+# Sidebar
+color sidebar_indicator default color17
+color sidebar_highlight default color238
+color sidebar_new green default
diff --git a/aber_offline_mail/.mutt/gpg.rc b/aber_offline_mail/.mutt/gpg.rc
new file mode 100644 (file)
index 0000000..b2cca5b
--- /dev/null
@@ -0,0 +1,9 @@
+set crypt_autosign
+set crypt_autopgp
+set crypt_replyencrypt
+set crypt_replysign
+set crypt_replysignencrypted
+set crypt_timestamp
+set crypt_use_gpgme
+set pgp_use_gpg_agent
+set pgp_auto_decode
diff --git a/aber_offline_mail/.mutt/mutt.uk.ac.aber.maf54 b/aber_offline_mail/.mutt/mutt.uk.ac.aber.maf54
new file mode 100644 (file)
index 0000000..880fa11
--- /dev/null
@@ -0,0 +1,88 @@
+macro index 'c' '<change-folder>?<change-dir><home>^K+<enter>'
+
+# Source the passwords file
+#source "gpg2 -dq ~/.mutt/passwords.gpg |"
+set my_aber_password=`pass Aber/Main | head -n 1`
+
+# Automatically render html emails.  Not sure if this is a good idea
+auto_view text/html
+alternative_order text/plain text/enriched text/html
+
+# use abook for aliases
+set alias_file=~/.aliases
+set sort_alias= alias
+source $alias_file
+set query_command = "abook --mutt-query '%s'" 
+macro index,pager A "<pipe-message>abook --add-email-quiet<return>" "add the sender address to abook"
+
+# View urls more easily with urlview
+macro index \cb   "|urlview\n"
+macro pager \cb   "|urlview\n"
+
+macro pager \cb        "\
+:set my_tmp_pipe_decode=\$pipe_decode\n\
+:set pipe_decode\n\
+|urlview\n\
+:set pipe_decode=\$my_tmp_pipe_decode\n\
+:unset my_tmp_pipe_decode\n" \
+# call urlview to extract URLS out of a message
+
+set text_flowed=yes
+set reflow_text=yes
+set editor="vim -v +':set textwidth=72' +'set fo=aw'"
+
+# Encryption
+source ~/.mutt/gpg.rc
+
+# Speed up folder switch
+set sleep_time=0 
+
+# Mutt colors
+source ~/.mutt/colors.mutt
+
+set sort=threads
+set sort_aux=last-date-received
+
+set fast_reply=yes
+
+# Show message some message headers when reading mail
+set pager_index_lines=10
+
+# Show some context when paging through email
+set pager_context=5
+
+# Stop at the end of the email
+set pager_stop=yes
+
+# Remove all headers by default
+ignore *
+unignore from date subject to cc
+
+# Use sidebar
+set mail_check_stats
+set sidebar_visible=yes
+set sidebar_width=25
+set sidebar_folder_indent=yes
+set sidebar_short_path=yes
+set sidebar_divider_char='│'
+set sidebar_format='%B%* %N'
+
+bind index,pager \CP sidebar-prev
+bind index,pager \CN sidebar-next
+bind index,pager \CO sidebar-open
+unmailboxes *
+
+# Mailbox specific settings
+set smtp_url = "smtp://maf54@aber.ac.uk@smtp.office365.com:587"
+set smtp_pass = $my_aber_password
+set from = "maf54@aber.ac.uk"
+set realname = "Maximilian Friedersdorff"
+set folder = "~/mail_aber"
+set spoolfile = "+Inbox"
+set postponed = "+Drafts"
+set trash = "+Trash"
+set record = "+Sent"
+
+set pgp_sign_as="0x251C939D"
+
+mailboxes "+Inbox" "+Lists" "+Lists/ibers-all" "+Lists/centos-sec" "+Lists/ubuntu-sec" "+Notifications" "+Notifications/ibers-cs" "+Notifications/NPPC" "+Notifications/NPPC/Updates" "+Notifications/NPPC/Uptime" "+Notifications/NPPC/Icinga" "+UCU" "+Suppliers" "+Suppliers/BrightComputing" "+Suppliers/ClusterVision"