From 4d4c0e81a0caace3dc035ff9010ee01ac162ec86 Mon Sep 17 00:00:00 2001 From: Philip Wittamore Date: Sat, 10 May 2025 18:48:35 +0200 Subject: update --- accounts/philip.rc | 51 ++++++++++ accounts/philip.sig.rc | 3 + bin/add_to_calcurse | 25 +++++ bin/display_filter.sh | 53 ++++++++++ bin/get-mailboxes.sh | 17 ++++ bin/mutt-trim | 171 +++++++++++++++++++++++++++++++++ bin/mutt_bgrun | 114 ++++++++++++++++++++++ bin/mutt_version | 5 + bin/print_unicode.sh | 37 +++++++ mailcap | 11 +++ mutt-128.png | Bin 0 -> 9929 bytes mutt.svg | 255 +++++++++++++++++++++++++++++++++++++++++++++++++ neomuttrc | 171 +++++++++++++++++++++++++++++++++ themes/venelles.rc | 78 +++++++++++++++ 14 files changed, 991 insertions(+) create mode 100644 accounts/philip.rc create mode 100644 accounts/philip.sig.rc create mode 100755 bin/add_to_calcurse create mode 100755 bin/display_filter.sh create mode 100755 bin/get-mailboxes.sh create mode 100755 bin/mutt-trim create mode 100755 bin/mutt_bgrun create mode 100755 bin/mutt_version create mode 100755 bin/print_unicode.sh create mode 100644 mailcap create mode 100644 mutt-128.png create mode 100644 mutt.svg create mode 100644 neomuttrc create mode 100644 themes/venelles.rc diff --git a/accounts/philip.rc b/accounts/philip.rc new file mode 100644 index 0000000..96a0cf5 --- /dev/null +++ b/accounts/philip.rc @@ -0,0 +1,51 @@ +# @File Name : philip.rc + +# base +set realname = "Philip Wittamore" +set from = "philip@wittamore.com" +set use_from = "yes" +set envelope_from = "yes" + +# +set sendmail = "/usr/bin/msmtp -a philip" +set mbox_type = Maildir + +# folders +set folder=~/.mail/philip/ +set spoolfile = "+Inbox" +set trash = "+Trash" +set postponed = "+Drafts" +set record = "+Sent" + +# dsn +set dsn_notify = "failure,delay" +set dsn_return = hdrs + +# sidebar +unmailboxes * +mailboxes `~/neomutt/bin/get-mailboxes.sh ~/.mail/philip` + +# GPG +#set crypt_use_gpgme=yes +#set crypt_reply_sign=yes +#set crypt_reply_encrypt=yes +#set crypt_reply_sign_encrypted=yes +#set crypt_autosign=yes +#set crypt_verify_sig=yes + +#set pgp_default_key="9FD4104BF8734069C65C9E7062C85864C0420C9A" +#set pgp_autosign=yes +#set pgp_replyencrypt=yes +#set pgp_replysign=yes +#set pgp_timeout=1800 + +# signature +set sig_on_top = yes +set sig_dashes = yes +set signature = "iconv -f utf-8 ~/neomutt/accounts/philip.sig.rc|" + +# +subscribe neomutt-users + +# macros +macro index "mbsync philip" diff --git a/accounts/philip.sig.rc b/accounts/philip.sig.rc new file mode 100644 index 0000000..35f6165 --- /dev/null +++ b/accounts/philip.sig.rc @@ -0,0 +1,3 @@ +Philip Wittamore +https://wittamore.com + diff --git a/bin/add_to_calcurse b/bin/add_to_calcurse new file mode 100755 index 0000000..4807854 --- /dev/null +++ b/bin/add_to_calcurse @@ -0,0 +1,25 @@ +#!/bin/bash +# +# Import text/calendar files from mutt +# to calcurse. +# + +# Make sure calcurse is running +if [ ! -f "$HOME/.calcurse/.calcurse.pid" ]; then + exit 1 +fi + +# Extract the attachments +TEMPDIR=$(mktemp -d add-to-calcurse.XXXXXXXX) +cat "$@" | uudeview -i -m -n -q -p $TEMPDIR - > /dev/null 2>&1 + +# Add the calendar file (last attachment) to calcurse +# bartimoonboots update +FILE=$(file $TEMPDIR/* | grep vCalendar | cut -d: -f1 | head -1) +calcurse -i $FILE > /dev/null 2>&1 +#FILE=$(ls $TEMPDIR | sort -r | head -1) +#calcurse -i "$TEMPDIR/$FILE" > /dev/null 2>&1 + +# Remove the temporary dir and trigger a reload in calcurse +rm -rf $TEMPDIR > /dev/null 2>&1 +kill -USR1 `cat $HOME/.calcurse/.calcurse.pid` > /dev/null 2>&1 diff --git a/bin/display_filter.sh b/bin/display_filter.sh new file mode 100755 index 0000000..e45bf02 --- /dev/null +++ b/bin/display_filter.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# lun. 29 mars 2021 09:05:05 CEST +# Neomutt display_filter.sh +# filter for pager display only + +sed -e ' + +# clean up neomutt notifications +/\[-- Visualisation.* --\]/d +/\[-- Type: text.* --\]/d +/\[-- Type.* --\]/d +/\[-- Pièce jointe #[0-9] --\]/d +s/Pièce jointe #[0-9]: //g +/\[-- .* pas disponible .* --\]/d + +# url tidy +# put each url on a new line +s/http/\nhttp/g +# replace last /blahblah with /... +#s|\(http.*\)/.*|\1\/...| + +# hide messy inline pdf +/^%PDF-1.4/,/^%%EOF/d + +# add newline after --] +s/--\]/--\]\n/g + +# CID +s/\[cid/\n\[cid/g + +# delete [img] tags +s/\[img\]//g + +# change ugly lines +s/━/-/g + +# remove last < +s/<*$// + +# remove lone [ +s/^\[$// + +# delete single spaces at the beginning of lines +s/^ //g + +# delete multiple spaces +s/[[:space:]]\+/ /g + +# delete multiple blank lines + +' | awk '!NF {if (++n <= 1) print; next}; {n=0;print}' + + diff --git a/bin/get-mailboxes.sh b/bin/get-mailboxes.sh new file mode 100755 index 0000000..e1ff8ef --- /dev/null +++ b/bin/get-mailboxes.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +maildir=$1 + +# Find these specific paths so they stick at the top of the list +MAILBOXES='"+Inbox" "+Sent" "+Trash" "+Drafts" "+Junk" ' + +#Find all other paths, excluding those from above +MAILBOXES=$MAILBOXES`find "$maildir" -type d -name cur \ + -a -not \( -ipath "*Inbox*" \ + -o -ipath "*Sent*" \ + -o -ipath "*Drafts*" \ + -o -ipath "*Trash*" \ + -o -ipath "*Junk*" \ + \) | sed -e 's/${maildir}//g' -e 's/\/cur$/\"/g' -e "s#^${maildir}/# \"+#" | sort` + +echo $MAILBOXES diff --git a/bin/mutt-trim b/bin/mutt-trim new file mode 100755 index 0000000..2378ea6 --- /dev/null +++ b/bin/mutt-trim @@ -0,0 +1,171 @@ +#!/usr/bin/perl +# +# "Beautify" quoted message and make it "ready-to-reply". Originally by Michael Velten. + +use utf8; + +# keep quotes nested up to 3rd level +my $ind_max = 3; +# # put 1 empty line between first and following quote +# my $gap = 1; + +my $name = '[[:alpha:]]+([\'`-][[:alpha:]]+|[.])*'; +my $fullname = '\b(' . $name . '[,]?\s+)*' . $name . '\b'; + +# Possible reply greetings (regexes) (note that '> ' will be prefixed) +my @greetings = ( + 'Dear\s+' . $fullname . '([,.]|\s*!)?', + '[Hh](ello|i|ey)' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + 'Sehr geehrter?\s+' . $fullname . '([,.]|\s*!)?', + 'Lieber?\s+' . $fullname . '([,.]|\s*!)?', + 'Guten Tag' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + '[Hh]allo' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + '[Mm]oin' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + '[Mm]esdames(,| et) [Mm]essieurs([,.]|\s*!)?', + 'M(adame)\s+' . $fullname . '([,.]|\s*!)?', + 'M(onsieur)\s+' . $fullname . '([,.]|\s*!)?', + '[Cc]her\s+' . $fullname . '([,.]|\s*!)?', + '[Cc]hère\s+' . $fullname . '([,.]|\s*!)?', + '[Bb]onjour' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + '[Ss]alut' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + 'Senhor(ita|a)?' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + 'Sra?\.?' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + 'Car(íssim)?[ao]s?' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + 'Prezad(íssim)?[ao]s?' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + 'Estimad(íssim)?[ao]s?' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + '[Bb]om [Dd]ia' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + '[Bb]oa ([Tt]arde|[Nn]oite)' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + '[Oo](i|lá|la)' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + '[Aa]l[ôo]' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + '[Hh]ola' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + 'Se[ñ]or(ita|a)?' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + ); + +# Possible reply "greetouts" (regexes) (note that '> ' will be prefixed) +my @greetouts = ( + '([Ww]ith )?(([Kk]ind|[Bb]est|[Ww]arm) )?([Rr]egards|[Ww]ishes)([,.]|\s*!)?', + '[Bb]est([,.]|\s*!)?', + '[Cc]heers([,.]|\s*!)?', + '[Mm]it ([Vv]iel|[Bb]est|[Ll]ieb|[Ff]reundlich)en [Gg]r([ü]|ue)([ß]|ss)en([,.]|\s*!)?', + '(([Vv]iel|[Bb]est|[Ll]ieb|[Ff]reundlich)e )?[Gg]r([ü]|ue)([ß]|ss)e([,.]|\s*!)?', + '(([[Bb]est|[Ll]ieb|[Ff]reundlich)e[rn] )?[Gg]ru([ß]|ss)([,.]|\s*!)?', + '[Mm]it (([[Bb]est|[Ll]ieb|[Ff]reundlich)em )?[Gg]ru([ß]|ss)([,.]|\s*!)?', + '([LV]|MF)G([,.]|\s*!)?', + '(([Tt]rès|[Bb]ien) )?([Cc]ordi|[Aa]mic)alement([,.]|\s*!)?', + '[Aa]miti[é]s?([,.]|\s*!)?', + '[Aa]tenciosamente([,.]|\s*!)?', + '[Aa]tt([,.]|\s*!)?', + '[Aa]abraços?([,.]|\s*!)?', + '[Aa]tentamente([,.]|\s*!)?', + '[Cc]ordialmente([,.]|\s*!)?', + ); + +my $word = '[[:alpha:]]+([\'`-][[:alpha:]]+)*'; + +# my $saw_greeting = 0; +# my $saw_leadin = 0; +# my $saw_greetout = 0; +my $saw_own_sig = 0; +my $saw_blank_line = 0; +my $inds_other_sig = 0; +my $quote_header = 0; +my $extra_pref = ''; +# my $prev_inds = 0; + +my (@mail, @purged_mail); + +my $msg = shift; +die "Usage: $0 MAIL" unless $msg; +open(MAIL, "+<:encoding(UTF-8)", $msg) or die "$0: Can't open $msg: $!"; +push(@mail, $_) while ; # Read whole mail + +# Process whole mail +LINE: +foreach my $line (@mail) { + +# Treat non-quoted lines as is + if ($line !~ /^>/) { + push(@purged_mail, $line); + next LINE; + } + +# Keep all lines after my own signature unmodified + if ($line =~ /^--\s?$/ || $saw_own_sig) { + $saw_own_sig = 1; + push(@purged_mail, $line); + next LINE; + } + + # $line =~ tr/\xA0/ /; +# tighten "> > " to ">> " + my ($pref, $suff) = $line =~ /^([>[:space:]]+)(.*)$/; + $pref =~ s/(>\s*(?!$))/>/g; +# reduce multiple pre- and post-blanks to one post-blank + $pref =~ s/^\s*(>+)\s*/$1 /; + $line = $pref . $suff . "\n"; + +# prepend additional '>' for each Outlook quote header + if ($line =~ /^>+ [-_=]{3,}\s*$word(\s+$word)*\s*[-_=]{3,}$/) { + $quote_header = 1; + next LINE; + } +# first line after Outlook quote header that does not start with ...: + if ($quote_header == 1 && $line !~ /^>+ ([-*]\s*)?$word(\s+$word)*\s*:\s+/) { + $extra_pref = '>' . $extra_pref; + $quote_header = 0; + } + $pref = $extra_pref . $pref; + $line = $pref . $suff . "\n"; + +# skip line if number of '>'s is greater than $ind_max + my $inds = $pref =~ tr/>//; + next LINE if $inds > $ind_max; + +# Remove other signatures + if ($line =~ /^>+ --\s?$/) { + $inds_other_sig = $inds; + } + if ($inds == $inds_other_sig) { + next LINE; + } else { + $inds_other_sig = 0; + } + +# Remove quoted greeting + # unless ($saw_greeting) { + foreach my $greeting (@greetings) { + if ($line =~ /^>+ $greeting$/) { + # $saw_greeting = 1; + next LINE; + } + } + # } + +# Remove quoted "greetout" + # unless ($saw_greetout) { + foreach my $greetout (@greetouts) { + if ($line =~ /^>+ $greetout$/) { + # $saw_greetout = 1; + next LINE; + } + } + # } + +# Remove quoted filler lines + if ($line =~ /^>+ \s*(-*|_*|=*|\+*|#*|\**)$/) { + next LINE; + } + +# Insert $gap empty lines between different quote levels + # $line = "\n" x $gap . $line if $prev_inds < $inds; + # $prev_inds = $inds; + +# Save purged line + push(@purged_mail, $line); +} + +# Overwrite original mail with purged mail +truncate(MAIL, 0); +seek(MAIL, 0, 0); +print MAIL @purged_mail; +close(MAIL); diff --git a/bin/mutt_bgrun b/bin/mutt_bgrun new file mode 100755 index 0000000..7f03b67 --- /dev/null +++ b/bin/mutt_bgrun @@ -0,0 +1,114 @@ +#!/bin/sh +# @(#) mutt_bgrun $Revision: 1.4 $ + +# mutt_bgrun - run an attachment viewer from mutt in the background +# Copyright (C) 1999-2002 Gary A. Johnson +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# SYNOPSIS +# mutt_bgrun viewer [viewer options] file +# +# DESCRIPTION +# Mutt invokes external attachment viewers by writing the +# attachment to a temporary file, executing the pipeline specified +# for that attachment type in the mailcap file, waiting for the +# pipeline to terminate, writing nulls over the temporary file, +# then deleting it. This causes problems when using graphical +# viewers such as qvpview and acroread to view attachments. +# +# If qvpview, for example, is executed in the foreground, the mutt +# user interface is hung until qvpview exits, so the user can't do +# anything else with mutt until he or she finishes reading the +# attachment and exits qvpview. This is especially annoying when +# a message contains several MS Office attachments--one would like +# to have them all open at once. +# +# If qvpview is executed in the background, it must be given +# enough time to completely read the file before returning control +# to mutt, since mutt will then obliterate the file. Qvpview is +# so slow that this time can exceed 20 seconds, and the bound is +# unknown. So this is again annoying. +# +# The solution provided here is to invoke the specified viewer +# from this script after first copying mutt's temporary file to +# another temporary file. This script can then quickly return +# control to mutt while the viewer can take as much time as it +# needs to read and render the attachment. +# +# EXAMPLE +# To use qvpview to view MS Office attachments from mutt, add the +# following lines to mutt's mailcap file. +# +# application/msword; mutt_bgrun qvpview %s +# application/vnd.ms-excel; mutt_bgrun qvpview %s +# application/vnd.ms-powerpoint; mutt_bgrun qvpview %s +# +# AUTHOR +# Gary A. Johnson +# +# +# ACKNOWLEDGEMENTS +# My thanks to the people who have commented on this script and +# offered solutions to shortcomings and bugs, especially Edmund +# GRIMLEY EVANS and Andreas Somogyi +# . + +prog=${0##*/} + +# Check the arguments first. + +if [ "$#" -lt "2" ] +then + echo "usage: $prog viewer [viewer options] file" >&2 + exit 1 +fi + +# Separate the arguments. Assume the first is the viewer, the last is +# the file, and all in between are options to the viewer. + +viewer="$1" +shift + +while [ "$#" -gt "1" ] +do + options="$options $1" + shift +done + +file=$1 + +# Create a temporary directory for our copy of the temporary file. +# +# This is more secure than creating a temporary file in an existing +# directory. + +tmpdir=/tmp/$LOGNAME$$ +umask 077 +mkdir "$tmpdir" || exit 1 +tmpfile="$tmpdir/${file##*/}" + +# Copy mutt's temporary file to our temporary directory so that we can +# let mutt overwrite and delete it when we exit. + +cp "$file" "$tmpfile" + +# Run the viewer in the background and delete the temporary files when done. + +( + "$viewer" $options "$tmpfile" + rm -f "$tmpfile" + rmdir "$tmpdir" +) & diff --git a/bin/mutt_version b/bin/mutt_version new file mode 100755 index 0000000..96a8a08 --- /dev/null +++ b/bin/mutt_version @@ -0,0 +1,5 @@ +#!/bin/sh +mutt="`neomutt -v | head -1`" +os="`uname -o -r`" + +echo "my_hdr \"User-Agent: $mutt - $os\"" diff --git a/bin/print_unicode.sh b/bin/print_unicode.sh new file mode 100755 index 0000000..24815a0 --- /dev/null +++ b/bin/print_unicode.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +## print_unicode.sh +## By Amanda Hickman https://gist.github.com/amandabee/cf7faad0a6f2afc485ee +## Using https://github.com/baruchel/txt2pdf to print emails to PDF with unicode support. + +pdir="$HOME/.neomutt/tmp" +open_pdf=qpdfview +scriptloc="python3 $HOME/.neomutt/bin/text2pdf.py" + +# check to make sure that we're looking for txt2pdf in the right place +if ! command -v python3 $scriptloc >/dev/null; then + echo "Is $scriptloc installed?" + exit 1 +fi + +# create temp dir if it does not exist +if [ ! -d "$pdir" ]; then + mkdir -p "$pdir" 2>/dev/null + if [ $? -ne 0 ]; then + echo "Unable to make directory '$pdir'" 1>&2 + exit 2 + fi +fi + +# dump stdin to a tempfile +tmptxt="`mktemp $pdir/mutt_XXXXXXX.txt`" +cat >> $tmptxt + +tmpfile="`mktemp $pdir/mutt_XXXXXXXX.pdf`" + +# Actually write the text into a PDF. +$scriptloc --quiet -o $tmpfile $tmptxt +$open_pdf $tmpfile >/dev/null 2>&1 & +sleep 1 +rm $tmpfile +rm $tmptxt diff --git a/mailcap b/mailcap new file mode 100644 index 0000000..ea9fd6b --- /dev/null +++ b/mailcap @@ -0,0 +1,11 @@ +# +text/html; librewolf %s; +text/html; cha -T text/html %s;copiousoutput; +# +audio/*; cp %s ~/neomutt/tmp \; vlc ~/neomutt/tmp/$(basename %s) > /dev/null 2>&1 & +image/*; cp %s ~/neomutt/tmp \; ristretto ~/neomutt/tmp/$(basename %s) > /dev/null 2>&1 & +# +application/ics; /usr/bin/calcurse -i %s && notify-send "Entry added to calendar 📅" +text/calendar; /usr/bin/calcurse -i %s && notify-send "Entry added to calendar 📅" +text/x-vcard; ~/neomutt/bin/mutt.vcard.filter; copiousoutput; +application/*; cp %s ~/neomutt/tmp \; xdg-open ~/neomutt/tmp/$(basename %s) > /dev/null 2>&1 & diff --git a/mutt-128.png b/mutt-128.png new file mode 100644 index 0000000..62860e3 Binary files /dev/null and b/mutt-128.png differ diff --git a/mutt.svg b/mutt.svg new file mode 100644 index 0000000..cf9952c --- /dev/null +++ b/mutt.svg @@ -0,0 +1,255 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + 18 March 2009 + + + Malcolm Locke <malc@wholemeal.co.nz> + + + Based on the XPM format icon provided with the Mutt Debian package + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/neomuttrc b/neomuttrc new file mode 100644 index 0000000..9729019 --- /dev/null +++ b/neomuttrc @@ -0,0 +1,171 @@ +# .neomuttrc + +set config_charset = "utf-8" +set send_charset = "utf-8" +set charset = "utf-8" +set assumed_charset = "utf-8" +set attach_charset = "utf-8" +set rfc2047_parameters = yes + +set header_cache = ~/neomutt/cache/headers +set certificate_file = ~/neomutt/certificates +set message_cachedir = ~/neomutt/cache/bodies +set alias_file = ~/neomutt/aliases +set mailcap_path = ~/neomutt/mailcap +set tmpdir = /tmp + +# mail settings +set mail_check = 30 +set timeout = 600 # time to wait until abort waiting for input. +set mail_check_stats # periodically calculate message statistics +set xterm_set_titles = yes +set sleep_time = 0 # Don't pause + +# mailcap +auto_view text/html text/plain + +# Sidebar +set sidebar_visible = yes +set sidebar_short_path # Shorten mailbox names +set sidebar_delim_chars = "/." # Delete everything up to the last / character +set sidebar_folder_indent = yes # Indent folders whose names we've shortened +set sidebar_indent_string = "▸" +set sidebar_format = "%B%?F? [%F]?%* %?N?%N/?%S" +set sidebar_width = 30 +set sidebar_sort_method = "unsorted" +set sidebar_divider_char ="│" + +# Folder hooks +folder-hook . `rm -f /neomutt/tmp/*` # empty tmp folder +folder-hook "~/.mail/philip/*" "source ~/neomutt/accounts/philip.rc" + +# Printing +set print = ask-no +set print_command = "~/neomutt/bin/print_unicode.sh" + +# index display +set sort = threads +set sort_aux = last-date-received +set delete = yes # just delete don't ask + +# pager display +set pager = "builtin" +set smart_wrap = yes # lines wrapped at word boundary at screen edge. +set markers = no # don't add "+" at wrapped lines +set pager_stop = yes # don't continue to next message +set display_filter = "~/neomutt/bin/display_filter.sh" + +# message display +ignore * +unhdr_order * +unignore Date: From: To: Cc: Bcc: X-Mailer: User-Agent: X-Spam-Flag: Subject: +hdr_order Date: From: To: Cc: Bcc: X-Mailer: User-Agent: X-Spam-Flag: Subject: +set quote_regex = "^([ \t]*[|>:}#])+" +set smileys = "(>From )|(:[-^]?[][)(><}{|/DP])" # catch some common false positives of $quote_regex +set pipe_decode = "yes" # weed headers and attempt to decode the messages first. + +# attachments +attachments +A */.* # Give all MIME parts an "attachment" disposition +set attach_save_dir = "~/Documents" +set attach_save_without_prompting +set abort_noattach = ask-yes +# French & English regex +set abort_noattach_regex = "\\<(attach|attached|attaché|attachés|attache|attachons|joint|jointe|joints|jointes|joins|joignons)\\>" + +# editor +set text_flowed = yes # don't cut lines +#set editor = "~/.neomutt/bin/mutt-trim %s; joe -nobackups %s" +set editor = "~/neomutt/bin/mutt-trim %s; micro %s" + +# Replies +set attribution = "* %n <%a> [%(%y%m%d %H:%M)]:" +set fast_reply # do not ask for to, subject,... when replying. +set include = yes # include message + +# Forwards +set forward_format = "[Tr: %s]" +set forward_quote + +# Abook +set query_command = "abook --mutt-query '%s'" +macro index,pager a "abook --add-email-quiet" "Add this sender to Abook" +macro generic,index,pager \ca "abook" "launch abook" + +# Header Compression +set header_cache_compress_method = "zlib" +set header_cache_compress_level = 1 + +# PGP commands +set pgp_decode_command = "gpg2 %?p?--passphrase- 0? --no-verbose --batch --output - %f" +set pgp_verify_command = "gpg2 --no-verbose --batch --output - --verify %s %f" +set pgp_decrypt_command = "gpg2 --passphrase- 0 --no-verbose --batch --output - %f" +set pgp_sign_command = "gpg2 --no-verbose --batch --output - --passphrase- 0 --armor --detach-sign --textmode %?a?-u %a? %f" +set pgp_clearsign_command = "gpg2 --no-verbose --batch --output - --passphrase- 0 --armor --textmode --clearsign %?a?-u %a? %f" +set pgp_encrypt_only_command = "/usr/lib/neomutt/pgpewrap gpg2 --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to $pgp_sign_as -- -r %r -- %f" +set pgp_encrypt_sign_command = "/usr/lib/neomutt/pgpewrap gpg2 --passphrase- 0 --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust --encrypt-to $pgp_sign_as -- -r %r -- %f" +set pgp_import_command = "gpg2 --no-verbose --import %f" +set pgp_export_command = "gpg2 --no-verbose --export --armor %r" +set pgp_verify_key_command = "gpg2 --no-verbose --batch --fingerprint --check-sigs %r" +set pgp_list_pubring_command = "gpg2 --no-verbose --batch --with-colons --list-keys %r" +set pgp_list_secring_command = "gpg2 --no-verbose --batch --with-colons --list-secret-keys %r" + + +# other settings + +#unset quit + +# Spam flag +# spam "X-Spam-Flag: YES" "󰉁" +# This pushes spam lines to right and it's ugly +# so instead I colour the line that contains X-Spam-Flag using +# color index color197 color233 ~hX-Spam-Flag +# in the colour theme + +# add my_hdr $mutt_version - $os_version +my_hdr User-Agent: `neomutt -v | head -1` - `uname -r` Linux + +# file browser +set sort_browser=reverse-date + +#### Key bindings +# sidebar +bind index,pager sidebar-prev # Previous Mailbox +bind index,pager sidebar-next # Next Mailbox +bind index,pager * sidebar-open # Open Highlighted Mailbox +# +bind pager next-line # pager down one line +bind pager previous-line # pager up one line +bind editor complete-query # Abook completion + +#### Macros +# account swap +unset wait_key #don't wait for user input +macro index,pager "source ~/neomutt/accounts/philip.rc!" +# toggle sidebar +macro index,pager "toggle sidebar_visible " +# F6 in index runs mbsync, see philip.rc +macro pager "~/neomutt/bin/translate.sh" +# urlscan +macro index,pager \cb "urlscan -c -d" "call urlscan to extract URLs out of a message" +macro attach,compose \cb "urlscan -c -d" "call urlscan to extract URLs out of a message" +# reload config +macro index,browser,pager \cr "source ~/neomutt/.neomuttrc" +# View in graphic browser +macro attach 'V' "iconv -c --to-code=UTF8 > ~/neomutt/tmp/mail.htmlfloorp ~/.neomutt/tmp/mail.html" + +# SPAM +# Mark as not spam and move mail to inbox +macro index,pager n "bogofilter -Mn\ +=Inbox" "Mark as non spam & move to Inbox" +# Mark as not spam and do nothing else +macro index . "bogofilter -Mn" "Mark as not spam in index" +macro pager . "bogofilter -Mn" "Mark as not spam in pager" +# Mark as spam and delete +macro index x "bogofilter -MNs=Junk" +macro pager x "bogofilter -MNs=Junk" + + +#### more config files +source ~/neomutt/accounts/philip.rc # default account +source ~/neomutt/themes/venelles.rc # my color theme + diff --git a/themes/venelles.rc b/themes/venelles.rc new file mode 100644 index 0000000..855cb8d --- /dev/null +++ b/themes/venelles.rc @@ -0,0 +1,78 @@ +# venelles.rc + +# general +color error color231 color212 +#color indicator color0 color228 +color indicator color0 color10 +color markers color210 color233 +color message color254 color233 +color normal color254 color233 +color prompt color254 color233 +color search color84 color233 +color status color249 color236 +color tilde color231 color233 +color tree color94 color233 +color quoted color71 color233 # all quoted lines +color signature color212 color233 +color progress white red + +# message index +color index color159 color233 ~A # all messages +color index color35 color233 ~P # from me +color index color46 color233 ~N # new message line +color index_flags color22 color233 ~Q # replied to line +color index color178 color233 ~F # flagged message line +color index_flags color196 color233 ~F # flag colour +color index color160 color233 ~D # deleted message line +color index color215 color233 ~T # tagged message line +color index color197 color233 ~hX-Spam-Flag #spam + +# sidebar +color sidebar_divider color192 color233 # The dividing line between the Sidebar and the Index/Pager panels +color sidebar_flagged color174 color233 # Mailboxes containing flagged mail +color sidebar_highlight color233 color101 # Cursor to select a mailbox +color sidebar_indicator color0 color10 # The mailbox open in the Index panel +color sidebar_new color46 color233 # Mailboxes containing new mail +color sidebar_ordinary color192 color233 # Mailboxes that have no new/flagged mails, etc. +color sidebar_spool_file color192 color233 # Mailbox that receives incoming mail +color sidebar_unread color192 color233 # Mailboxes containing unread mail + + +# message headers +color hdrdefault color233 color30 +color header color231 color30 ^Subject:.* +color header white red ^X-Spam-Flag:.* + +# message body +color attachment color222 color233 +color body color9 color233 [\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+ # email addresses + +color body color231 color233 (^|[[:space:]])\\*[^[:space:]]+\\*([[:space:]]|$) # *bold* text +color body color231 color233 (^|[[:space:]])_[^[:space:]]+_([[:space:]]|$) # _underlined_ text +color body color231 color233 (^|[[:space:]])/[^[:space:]]+/([[:space:]]|$) # /italic/ text +color body color124 color233 Sent.from.* +color body color233 color155 "[;:]-*[)>(<|]" +color body color196 color233 "[*] .*:$" # Attribution (gukes) +color body color196 color233 "Le .* a écrit :$" # Attribution (French) +color body color196 color233 "On .* wrote:$" +color body color39 color233 "\\[[0-9]+\\]" +color body color143 color233 "^#v[-+]" +color body color39 color233 (https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+ # URLs +color body color235 color233 "\\[.*\\]" +color body color39 color233 "\\[-- .* --\\]" + +# The older the email, the darker it appears. +color index color250 default "~d >7d" # older than 7 days +color index color248 default "~d >20d" # older than 20 days +color index color246 default "~d >30d" # older than 30 days +color index color244 default "~d >90d" # older than 90 days + +# PGP111 +color body color215 color233 "^Bonne signature de : .*" +color body color215 color233 "créée : .*" +color body color215 color233 "aka : .*" +color body color215 color233 "^ATTENTION ! Nous n'avons AUCUNE indication .*" +color body color215 color233 "^Empreinte : .*" +color body color196 color233 "^Signature problématique de : .*" + + -- cgit v1.2.3