mail: Initial commit

This commit is contained in:
Marty Oehme 2020-09-14 10:47:02 +02:00
parent 27728b07db
commit 7871442bcd
Signed by: Marty
GPG key ID: B7538B8F50A1C800
9 changed files with 458 additions and 0 deletions

View file

@ -1,3 +1,4 @@
aerc
alacritty
an2linuxserver-git
anki
@ -57,6 +58,7 @@ lynx
man-db
man-pages
masterpdfeditor-free
mbsync
mimeo
moreutils
mosh

View file

@ -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 <marty.oehme@gmail.com>
copy-to = Sent

191
mail/.config/aerc/aerc.conf Normal file
View file

@ -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

View file

@ -0,0 +1,110 @@
# Binds are of the form <key sequence> = <command to run>
# To use '=' in a key sequence, substitute it with "Eq": "<Ctrl+Eq>"
# If you wish to bind #, you can wrap the key sequence in quotes: "#" = quit
<C-p> = :prev-tab<Enter>
<C-n> = :next-tab<Enter>
<C-t> = :term<Enter>
[messages]
q = :quit<Enter>
j = :next<Enter>
<Down> = :next<Enter>
<C-d> = :next 50%<Enter>
<C-f> = :next 100%<Enter>
<PgDn> = :next -s 100%<Enter>
k = :prev<Enter>
<Up> = :prev<Enter>
<C-u> = :prev 50%<Enter>
<C-b> = :prev 100%<Enter>
<PgUp> = :prev -s 100%<Enter>
gg = :select 0<Enter>
G = :select -1<Enter>
J = :next-folder<Enter>
<C-n> = :next-folder<Enter>
K = :prev-folder<Enter>
<C-p> = :prev-folder<Enter>
gi = :cf INBOX<Enter>
ga = :cf [Google Mail]/All Mail<Enter>
gt = :cf [Google Mail]/Trash<Enter>
v = :mark -t<Enter>
V = :mark -v<Enter>
<Enter> = :view<Enter>
l = :view<Enter>
D = :prompt 'Really delete this message?' 'delete-message'<Enter>
d = :mv [Google Mail]/Trash<Enter>
a = :mv [Google Mail]/All Mail<Enter>
A = :mv [Google Mail]/All Mail<Enter>
C = :compose<Enter>
rr = :reply -a<Enter>
rq = :reply -aq<Enter>
Rr = :reply<Enter>
Rq = :reply -q<Enter>
c = :cf<space>
$ = :term<space>
! = :term<space>
| = :pipe<space>
/ = :search<space>
\ = :filter<space>
n = :next-result<Enter>
N = :prev-result<Enter>
[view]
q = :close<Enter>
| = :pipe<space>
D = :delete<Enter>
S = :save<space>
A = :archive flat<Enter>
f = :forward<Enter>
rr = :reply -a<Enter>
rq = :reply -aq<Enter>
Rr = :reply<Enter>
Rq = :reply -q<Enter>
H = :toggle-headers<Enter>
<C-n> = :prev-part<Enter>
<C-p> = :next-part<Enter>
J = :next<Enter>
K = :prev<Enter>
[compose]
# Keybindings used when the embedded terminal is not selected in the compose
# view
$ex = <C-x>
<C-k> = :prev-field<Enter>
<C-j> = :next-field<Enter>
<tab> = :next-field<Enter>
[compose::editor]
# Keybindings used when the embedded terminal is selected in the compose view
$noinherit = true
$ex = <C-x>
<C-k> = :prev-field<Enter>
<C-j> = :next-field<Enter>
<C-p> = :prev-tab<Enter>
<C-n> = :next-tab<Enter>
[compose::review]
# Keybindings used when reviewing a message to be sent
y = :send<Enter>
n = :abort<Enter>
p = :postpone<Enter>
q = :abort<Enter>
e = :edit<Enter>
a = :attach<space>
[terminal]
$noinherit = true
$ex = <C-x>
<C-p> = :prev-tab<Enter>
<C-n> = :next-tab<Enter>

View file

@ -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 *

View file

@ -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

View file

@ -0,0 +1,3 @@
#!/bin/sh
alias mbsync='mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc'

View file

@ -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"

15
mail/README.md Normal file
View file

@ -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.