diff --git a/bootstrap/packages.txt b/bootstrap/packages.txt index c956948..11f8a11 100644 --- a/bootstrap/packages.txt +++ b/bootstrap/packages.txt @@ -1,3 +1,4 @@ +aerc alacritty an2linuxserver-git anki @@ -57,6 +58,7 @@ lynx man-db man-pages masterpdfeditor-free +mbsync mimeo moreutils mosh diff --git a/mail/.config/aerc/accounts.conf b/mail/.config/aerc/accounts.conf new file mode 100644 index 0000000..09905e3 --- /dev/null +++ b/mail/.config/aerc/accounts.conf @@ -0,0 +1,8 @@ +[Personal] +source = maildir://~/documents/mail +outgoing = smtp+plain://marty.oehme%40gmail.com@smtp.gmail.com:587 +outgoing-cred-cmd = pass 'misc/aerc-gmail-app-password' | head -1 +default = Inbox +smtp-starttls = yes +from = Marty Oehme +copy-to = Sent diff --git a/mail/.config/aerc/aerc.conf b/mail/.config/aerc/aerc.conf new file mode 100644 index 0000000..d83831c --- /dev/null +++ b/mail/.config/aerc/aerc.conf @@ -0,0 +1,191 @@ +# +# aerc main configuration + +[ui] +# +# Describes the format for each row in a mailbox view. This field is compatible +# with mutt's printf-like syntax. +# +# Default: %D %-17.17n %Z %s +index-format=%D %-30.30n %Z %s + +# +# See time.Time#Format at https://godoc.org/time#Time.Format +# +# Default: 2006-01-02 03:04 PM (ISO 8601 + 12 hour time) +# timestamp-format=2006-01-02 03:04 PM +timestamp-format=06 Mon Jan 02 15:04 + +# +# Width of the sidebar, including the border. +# +# Default: 20 +sidebar-width=20 + +# +# Message to display when viewing an empty folder. +# +# Default: (no messages) +empty-message=(no messages) + +# Message to display when no folders exists or are all filtered +# +# Default: (no folders) +empty-dirlist=(no folders) + +# Enable mouse events in the ui, e.g. clicking and scrolling with the mousewheel +# +# Default: false +mouse-enabled=true + +# +# Ring the bell when new messages are received +# +# Default: true +new-message-bell=true + +# Marker to show before a pinned tab's name. +# +# Default: ` +pinned-tab-marker='`' + +# Describes the format string to use for the directory list +# +# Default: %n %>r +dirlist-format=%n %>r + +# List of space-separated criteria to sort the messages by, see *sort* +# command in *aerc*(1) for reference. Prefixing a criterion with "-r " +# reverses that criterion. +# +# Example: "from -r date" +# +# Default: "" +sort=-r date + +# Moves to next message when the current message is deleted +# +# Default: true +next-message-on-delete=true + +[viewer] +# +# Specifies the pager to use when displaying emails. Note that some filters +# may add ANSI codes to add color to rendered emails, so you may want to use a +# pager which supports ANSI codes. +# +# Default: less -R +pager=less -R + +# +# If an email offers several versions (multipart), you can configure which +# mimetype to prefer. For example, this can be used to prefer plaintext over +# html emails. +# +# Default: text/plain,text/html +alternatives=text/plain,text/html + +# +# Default setting to determine whether to show full headers or only parsed +# ones in message viewer. +# +# Default: false +show-headers=false + +# +# Layout of headers when viewing a message. To display multiple headers in the +# same row, separate them with a pipe, e.g. "From|To". Rows will be hidden if +# none of their specified headers are present in the message. +# +# Default: From|To,Cc|Bcc,Date,Subject +header-layout=From|To,Cc|Bcc,Date,Subject + +# Whether to always show the mimetype of an email, even when it is just a single part +# +# Default: false +always-show-mime=false + +# How long to wait after the last input before auto-completion is triggered. +# +# Default: 250ms +completion-delay=0ms + +# +# Global switch for completion popovers +# +# Default: true +completion-popovers=true + +[compose] +# +# Specifies the command to run the editor with. It will be shown in an embedded +# terminal, though it may also launch a graphical window if the environment +# supports it. Defaults to $EDITOR, or vi. +editor= + +# +# Default header fields to display when composing a message. To display +# multiple headers in the same row, separate them with a pipe, e.g. "To|From". +# +# Default: To|From,Subject +header-layout=To|From,Subject,Cc|Bcc + +# +# Specifies the command to be used to tab-complete email addresses. Any +# occurrence of "%s" in the address-book-cmd will be replaced with what the +# user has typed so far. +# +# The command must output the completions to standard output, one completion +# per line. Each line must be tab-delimited, with an email address occurring as +# the first field. Only the email address field is required. The second field, +# if present, will be treated as the contact name. Additional fields are +# ignored. +address-book-cmd= + +[filters] +# +# Filters allow you to pipe an email body through a shell command to render +# certain emails differently, e.g. highlighting them with ANSI escape codes. +# +# The first filter which matches the email's mimetype will be used, so order +# them from most to least specific. +# +# You can also match on non-mimetypes, by prefixing with the header to match +# against (non-case-sensitive) and a comma, e.g. subject,text will match a +# subject which contains "text". Use header,~regex to match against a regex. +subject,~^\[PATCH=awk -f /usr/share/aerc/filters/hldiff +text/html=/usr/share/aerc/filters/html +text/*=awk -f /usr/share/aerc/filters/plaintext +image/*=feh - +application/pdf=zathura - + +[triggers] +# +# Triggers specify commands to execute when certain events occur. +# +# Example: +# new-email=exec notify-send "New email from %n" "%s" + +# +# Executed when a new email arrives in the selected folder +new-email= + +[templates] +# Templates are used to populate email bodies automatically. +# + +# The directories where the templates are stored. It takes a colon-separated +# list of directories. +# +# default: /usr/share/aerc/templates/ +template-dirs=/usr/share/aerc/templates/ + +# The template to be used for quoted replies. +# +# default: quoted_reply +quoted-reply=quoted_reply + +# The template to be used for forward as body. +# +# default: forward_as_body +forwards=forward_as_body diff --git a/mail/.config/aerc/binds.conf b/mail/.config/aerc/binds.conf new file mode 100644 index 0000000..c47f729 --- /dev/null +++ b/mail/.config/aerc/binds.conf @@ -0,0 +1,110 @@ +# Binds are of the form = +# To use '=' in a key sequence, substitute it with "Eq": "" +# If you wish to bind #, you can wrap the key sequence in quotes: "#" = quit + = :prev-tab + = :next-tab + = :term + +[messages] +q = :quit + +j = :next + = :next + = :next 50% + = :next 100% + = :next -s 100% + +k = :prev + = :prev + = :prev 50% + = :prev 100% + = :prev -s 100% +gg = :select 0 +G = :select -1 + +J = :next-folder + = :next-folder +K = :prev-folder + = :prev-folder +gi = :cf INBOX +ga = :cf [Google Mail]/All Mail +gt = :cf [Google Mail]/Trash + +v = :mark -t +V = :mark -v + + = :view +l = :view +D = :prompt 'Really delete this message?' 'delete-message' +d = :mv [Google Mail]/Trash +a = :mv [Google Mail]/All Mail +A = :mv [Google Mail]/All Mail + +C = :compose + +rr = :reply -a +rq = :reply -aq +Rr = :reply +Rq = :reply -q + +c = :cf +$ = :term +! = :term +| = :pipe + +/ = :search +\ = :filter +n = :next-result +N = :prev-result + +[view] +q = :close +| = :pipe +D = :delete +S = :save +A = :archive flat + +f = :forward +rr = :reply -a +rq = :reply -aq +Rr = :reply +Rq = :reply -q + +H = :toggle-headers + = :prev-part + = :next-part +J = :next +K = :prev + +[compose] +# Keybindings used when the embedded terminal is not selected in the compose +# view +$ex = + = :prev-field + = :next-field + = :next-field + +[compose::editor] +# Keybindings used when the embedded terminal is selected in the compose view +$noinherit = true +$ex = + = :prev-field + = :next-field + = :prev-tab + = :next-tab + +[compose::review] +# Keybindings used when reviewing a message to be sent +y = :send +n = :abort +p = :postpone +q = :abort +e = :edit +a = :attach + +[terminal] +$noinherit = true +$ex = + + = :prev-tab + = :next-tab diff --git a/mail/.config/isync/mbsyncrc b/mail/.config/isync/mbsyncrc new file mode 100644 index 0000000..d6e6447 --- /dev/null +++ b/mail/.config/isync/mbsyncrc @@ -0,0 +1,37 @@ +# documentation: https://wiki.archlinux.org/index.php/isync + +IMAPAccount gmail +# Address to connect to +Host imap.gmail.com +UserCmd "pass show misc/aerc-gmail-app-password | grep username | cut -d: -f2" +PassCmd "pass show misc/aerc-gmail-app-password | head -n1" +# To store the password in an encrypted file use PassCmd instead of Pass +# PassCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.mailpass.gpg" +# +# Use SSL +SSLType IMAPS +# The following line should work. If get certificate errors, uncomment the two following lines and read the "Troubleshooting" section. +CertificateFile /etc/ssl/certs/ca-certificates.crt +#CertificateFile ~/.cert/imap.gmail.com.pem +#CertificateFile ~/.cert/Equifax_Secure_CA.pem + +IMAPStore gmail-remote +Account gmail + +MaildirStore gmail-local +Subfolders Verbatim +# The trailing "/" is important +Path ~/documents/mail/ +Inbox ~/documents/mail/Inbox + +Channel gmail +Far :gmail-remote: +Near :gmail-local: +# Exclude everything under the internal [Gmail] folder, except the interesting folders +Patterns * ![Gmail]* "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" +# Or include everything +#Patterns * +# Automatically create missing mailboxes, both locally and on the server +Create Both +# Save the synchronization state files in the relevant directory +SyncState * diff --git a/mail/.config/notmuch/config b/mail/.config/notmuch/config new file mode 100644 index 0000000..f898572 --- /dev/null +++ b/mail/.config/notmuch/config @@ -0,0 +1,88 @@ +# .notmuch-config - Configuration file for the notmuch mail system +# +# For more information about notmuch, see https://notmuchmail.org + +# Database configuration +# +# The only value supported here is 'path' which should be the top-level +# directory where your mail currently exists and to where mail will be +# delivered in the future. Files should be individual email messages. +# Notmuch will store its database within a sub-directory of the path +# configured here named ".notmuch". +# +[database] +path=documents/mail + +# User configuration +# +# Here is where you can let notmuch know how you would like to be +# addressed. Valid settings are +# +# name Your full name. +# primary_email Your primary email address. +# other_email A list (separated by ';') of other email addresses +# at which you receive email. +# +# Notmuch will use the various email addresses configured here when +# formatting replies. It will avoid including your own addresses in the +# recipient list of replies, and will set the From address based on the +# address to which the original email was addressed. +# +[user] +name=Marty Oehme +primary_email=marty.oehme@gmail.com +other_email=mo82rimu@studserv.uni-leipzig.de;moehme@ruc.dk; + +# Configuration for "notmuch new" +# +# The following options are supported here: +# +# tags A list (separated by ';') of the tags that will be +# added to all messages incorporated by "notmuch new". +# +# ignore A list (separated by ';') of file and directory names +# that will not be searched for messages by "notmuch new". +# +# NOTE: *Every* file/directory that goes by one of those +# names will be ignored, independent of its depth/location +# in the mail store. +# +[new] +tags=unread;inbox; +ignore= + +# Search configuration +# +# The following option is supported here: +# +# exclude_tags +# A ;-separated list of tags that will be excluded from +# search results by default. Using an excluded tag in a +# query will override that exclusion. +# +[search] +exclude_tags=deleted;spam; + +# Maildir compatibility configuration +# +# The following option is supported here: +# +# synchronize_flags Valid values are true and false. +# +# If true, then the following maildir flags (in message filenames) +# will be synchronized with the corresponding notmuch tags: +# +# Flag Tag +# ---- ------- +# D draft +# F flagged +# P passed +# R replied +# S unread (added when 'S' flag is not present) +# +# The "notmuch new" command will notice flag changes in filenames +# and update tags, while the "notmuch tag" and "notmuch restore" +# commands will notice tag changes and update flags in filenames +# +[maildir] +synchronize_flags=true diff --git a/mail/.config/sh/alias.d/mbsync-xdg.sh b/mail/.config/sh/alias.d/mbsync-xdg.sh new file mode 100644 index 0000000..80a590d --- /dev/null +++ b/mail/.config/sh/alias.d/mbsync-xdg.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +alias mbsync='mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc' diff --git a/mail/.config/sh/env.d/notmuch-xdg.sh b/mail/.config/sh/env.d/notmuch-xdg.sh new file mode 100644 index 0000000..74def55 --- /dev/null +++ b/mail/.config/sh/env.d/notmuch-xdg.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +# Make notmuch config comply with xdg base dir specification + +export NOTMUCH_CONFIG="${XDG_CONFIG_HOME:-~/.config}/notmuch/config" diff --git a/mail/README.md b/mail/README.md new file mode 100644 index 0000000..b8c16e5 --- /dev/null +++ b/mail/README.md @@ -0,0 +1,15 @@ +# e-mail module + +[aerc](https://aerc-mail.org/) - terminal mail client +[isync](https://isync.sourceforge.io/mbsync.html) - mirror your Imapped mail directory locally with two way synchronization +[notmuch](https://notmuchmail.org/) - index and search your mail + +The current mail setup uses `mbsync` (from the isync project) to locally mirror the GMail imap folder. +It, as of now, needs to be manually run by invoking `mbsync gmail` -- which expects your username and password to reside in a [`pass`](/pass) accessible file called `misc/aerc-gmail-app-password`. +In other words --- this is very specific to my setup and if transferring the options, please customize to your needs. + +Then, `notmuch` can be run on the local maildir to generate and indexed full-text search engine. +Right now, `notmuch` can only be used through its cli, it is not yet connected to `aerc`. + +`aerc` picks up the maildir created by `mbsync` in `~/documents/mail` and works on it. +`mbsync` syncs any changes made back to the remote imap directory.