Compare commits

..

15 Commits

26 changed files with 738 additions and 5 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
neomutt/accounts

View File

@ -0,0 +1,30 @@
# The default stow-ignore settings
# -------------------------------------
# Comments and blank lines are allowed.
RCS
.+,v
CVS
\.\#.+ # CVS conflict files / emacs lock files
\.cvsignore
\.svn
_darcs
\.hg
\.git
\.gitignore
\.gitmodules
.+~ # emacs backup files
\#.*\# # emacs autosave files
^/README.*
^/LICENSE.*
^/COPYING
# -------------------------------------
#
# My customizations
Makefile
\.DS_Store

6
dotfiles/Makefile Normal file
View File

@ -0,0 +1,6 @@
test:
@echo Test mode, run \"make all\" to enact changes
stow -v --no --dotfiles --target ~ .
all:
stow -v --dotfiles --target ~ .

View File

@ -8,7 +8,7 @@ unbind l
bind C-a last-window
# Reload configs for faster config testing
bind r source-file ~/.tmux.conf
bind r source-file ~/.config/tmux/tmux.conf \; display "Reloaded…"
# start numbering windows at 1
set -g base-index 1
@ -36,6 +36,17 @@ bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
# Set the visual style for a window that received a bell
set-window-option -g window-status-bell-style bg=color167,fg=colour235 # bg=redish, fg=black
# Set up the status bar
set-option -g status-left-length 30
set-option -g status-style fg=colour136,bg=colour235 # fg=brown, bg=black
set-option -g status-left "#[fg=green]tdkvxyvkv7 #[fg=white]☰ #[default]"
set-option -ag status-right " #[fg=white,bg=default]%H:%M#[default] #[fg=white]%Y-%m-%d"
set-option -g status-right " #[fg=white,bg=default]%H:%M#[default] #[fg=white]%Y-%m-%d"
set-window-option -g window-status-current-style fg=colour166,bg=colour235
# Install the tmux plugin manager
# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# List of plugins

33
neomutt/accounts.sample Normal file
View File

@ -0,0 +1,33 @@
set imap_user = "<username>@guidepointsecurity.com"
# set imap_pass = <password>
set smtp_url = "smtps://<username>@guidepointsecurity.com@smtp.gmail.com:465/"
# set smtp_pass = $imap_pass
set ssl_force_tls = yes
# Pull a copy of this script:
# https://github.com/google/gmail-oauth2-tools/blob/master/python/oauth2.py
# I saved mine as ~/bin/mutt-gmail-oauth2.py
#
# Follow their instructions, summarized below
#
# Set up a client of type 'Web Application', while signed into gps, here:
# https://console.developers.google.com/apis/credentials
#
# Authenticate and collect your refresh token with this command
# mutt-gmail-oauth2.py --user='<username>@guidepointsecurity.com' \
# --client_id='<clientid>' \
# --client_secret='<clientsecret>' \
# --generate_oauth2_token
#
# Then put the pieces together in the below 'refresh_command'
set imap_authenticators="oauthbearer"
set imap_oauth_refresh_command="~/bin/mutt-gmail-oauth2.py --quiet\
--user='<username>@guidepointsecurity.com'\
--client_id='<clientid>'\
--client_secret='<clientsecret>'\
--refresh_token='<refreshtoken>'"
set smtp_authenticators=${imap_authenticators}
set smtp_oauth_refresh_command=${imap_oauth_refresh_command}

0
neomutt/aliases Normal file
View File

28
neomutt/auto_views Normal file
View File

@ -0,0 +1,28 @@
# -*- muttrc -*-
#
# Tell mutt which MIME types to auto-view
#
auto_view application/zip
auto_view application/x-gzip
auto_view application/x-gunzip
auto_view application/pgp-signature
auto_view application/pgp
auto_view application/octet-stream
auto_view application/x-zip-compressed
auto_view application/x-arj-compressed
auto_view application/x-tar-gz
auto_view application/ms-tnef
auto_view application/x-perl
auto_view application/x-sh
auto_view application/x-tcl
auto_view application/x-delphi-source
auto_view application/emacs-lisp
auto_view application/msword
auto_view text/x-patch
auto_view text/html
auto_view text/x-vcard
auto_view text/x-script.elisp
auto_view text/x-lisp
auto_view text/x-diff
auto_view image/tiff

23
neomutt/bindings Normal file
View File

@ -0,0 +1,23 @@
# -*- muttrc -*-
#
# bindings for mutt.
# Pager bindings
#bind pager <down> next-line
#bind pager <up> previous-line
bind pager j next-line
bind pager k previous-line
bind pager / search
bind pager 0 top
bind pager G bottom
bind pager g group-reply
#
# Sidebar Navigation ---------------------------------
bind index <down> sidebar-next
bind index <up> sidebar-prev
bind index <right> sidebar-open
# Replicate Gmail in Gmail
macro index,pager A "<save-message>=[Gmail]/All Mail<enter>" "Archive"

View File

@ -0,0 +1,122 @@
# gruvbox dark (contrast dark):
# bg0 = 234
# bg1 = 237
# bg2 = 239
# bg3 = 241
# bg4 = 243
#
# gray = 245
#
# fg0 = 229
# fg1 = 223
# fg2 = 250
# fg3 = 248
# fg4 = 246
#
# red = 167
# green = 142
# yellow = 214
# blue = 109
# purple = 175
# aqua = 108
# orange = 208
# See http://www.mutt.org/doc/manual/#color
color attachment color109 color234
color bold color229 color234
color error color167 color234
color hdrdefault color246 color234
color indicator color223 color237
color markers color243 color234
color normal color223 color234
color quoted color250 color234
color quoted1 color108 color234
color quoted2 color250 color234
color quoted3 color108 color234
color quoted4 color250 color234
color quoted5 color108 color234
color search color234 color208
color signature color108 color234
color status color234 color250
color tilde color243 color234
color tree color142 color234
color underline color223 color239
color sidebar_divider color250 color234
color sidebar_new color142 color234
color index color142 color234 ~N
color index color108 color234 ~O
color index color109 color234 ~P
color index color214 color234 ~F
color index color175 color234 ~Q
color index color167 color234 ~=
color index color234 color223 ~T
color index color234 color167 ~D
color header color214 color234 "^(To:|From:)"
color header color142 color234 "^Subject:"
color header color108 color234 "^X-Spam-Status:"
color header color108 color234 "^Received:"
# Regex magic for URLs and hostnames
#
# Attention: BSD's regex has RE_DUP_MAX set to 255.
#
# Examples:
# http://some-service.example.com
# example.com
# a.example.com
# some-service.example.com
# example.com/
# example.com/datenschutz
# file:///tmp/foo
#
# Non-examples:
# 1.1.1900
# 14.02.2022/24:00
# 23.59
# w.l.o.g
# team.its
color body color142 color234 "[a-z]{3,255}://[[:graph:]]*"
color body color142 color234 "([-[:alnum:]]+\\.)+([0-9]{1,3}|[-[:alpha:]]+)/[[:graph:]]*"
color body color142 color234 "([-[:alnum:]]+\\.){2,255}[-[:alpha:]]{2,10}"
# IPv4 and IPv6 stolen from https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses
color body color142 color234 "((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])"
color body color142 color234 "(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))"
# Mail addresses and mailto URLs
color body color208 color234 "[-a-z_0-9.%$]+@[-a-z_0-9.]+\\.[-a-z][-a-z]+"
color body color208 color234 "mailto:[-a-z_0-9.]+@[-a-z_0-9.]+"
# some simleys and stuff
color body color234 color214 "[;:]-*[)>(<lt;|]"
color body color229 color234 "\\*[- A-Za-z]+\\*"
color body color214 color234 "^-.*PGP.*-*"
color body color142 color234 "^gpg: Good signature from"
color body color167 color234 "^gpg: Can't.*$"
color body color214 color234 "^gpg: WARNING:.*$"
color body color167 color234 "^gpg: BAD signature from"
color body color167 color234 "^gpg: Note: This key has expired!"
color body color214 color234 "^gpg: There is no indication that the signature belongs to the owner."
color body color214 color234 "^gpg: can't handle these multiple signatures"
color body color214 color234 "^gpg: signature verification suppressed"
color body color214 color234 "^gpg: invalid node with packet of type"
color body color142 color234 "^Good signature from:"
color body color167 color234 "^.?BAD.? signature from:"
color body color142 color234 "^Verification successful"
color body color167 color234 "^Verification [^s][^[:space:]]*$"
color compose header color223 color234
color compose security_encrypt color175 color234
color compose security_sign color109 color234
color compose security_both color142 color234
color compose security_none color208 color234

View File

@ -0,0 +1,2 @@
color sidebar_unread color108 color234

66
neomutt/colours Normal file
View File

@ -0,0 +1,66 @@
# -*- muttrc -*-
#
# Colour settings for mutt.
#
# Default colour definitions
color hdrdefault cyan black
color quoted red black
color signature blue brightblack
color indicator default color237
color attachment green black
color error red black
color message yellow black
color search brightwhite magenta
color status green brightblack
color tree red black
color normal white black
color tilde blue black
color bold yellow black
color markers red black
# Colour definitions when on a mono screen
mono bold bold
mono underline underline
mono indicator reverse
# Colours for items in the reader
color header brightcyan black "^(From|Subject):"
#color header red black "^X-Junked-Because: "
#color header red black "^X-Virus-hagbard: .* FOUND"
mono header bold "^(From|Subject|X-Junked-Because|X-Virus-hagbard):"
# Colours for items in the index
color index white black ~N
#color index brightblue black "~N (~e \"(gpsec|guidepointsecurity)\.com\" | ~h \"^In-[Rr]eply-[Tt]o: .*(gpsec|guidepointsecurity)\.com\")"
#color index brightblue black "~R (~e guidepointsecurity\.com | ~h \"^In-[Rr]eply-[Tt]o: .*guidepointsecurity\.com\")"
color index brightblue black "~f guidepointsecurity\.com"
color index red black ~F
color index green black ~T
color index blue black ~D
mono index bold ~N
mono index bold ~F
mono index bold ~T
mono index bold ~D
# Highlights inside the body of a message.
# URLs
color body brightblue black "(http|https|ftp|news|telnet|finger)://[^ \">\t\r\n]*"
color body brightblue black "mailto:[-a-z_0-9.]+@[-a-z_0-9.]+"
color body brightblue black "news:[^ \">\t\r\n]*"
mono body bold "(http|https|ftp|news|telnet|finger)://[^ \">\t\r\n]*"
mono body bold "mailto:[-a-z_0-9.]+@[-a-z_0-9.]+"
mono body bold "news:[^ \">\t\r\n]*"
# email addresses
color body brightblue black "[-a-z_0-9.%$]+@[-a-z_0-9.]+\\.[-a-z][-a-z]+"
mono body bold "[-a-z_0-9.%$]+@[-a-z_0-9.]+\\.[-a-z][-a-z]+"
# Various smilies and the like
color body brightgreen black "<[Gg]>" # <g>
color body brightgreen black "<[Bb][Gg]>" # <bg>
color body brightgreen black " [;:]-*[)>(<|]" # :-) etc...
color body brightblue black "(^|[[:space:]])\\*[^[:space:]]+\\*([[:space:]]|$)" # *Bold* text.
color body brightblue black "(^|[[:space:]])_[^[:space:]]+_([[:space:]]|$)" # _Underlined_ text.
color body brightblue black "(^|[[:space:]])/[^[:space:]]+/([[:space:]]|$)" # /Italic/ text.

0
neomutt/fcc-hooks Normal file
View File

0
neomutt/folder-hooks Normal file
View File

26
neomutt/headers Normal file
View File

@ -0,0 +1,26 @@
# -*- muttrc -*-
#
# Configure header displays.
#
# Ignore all headers
ignore *
# Then un-ignore the ones I want to see
unignore From:
unignore To:
unignore Reply-To:
unignore Mail-Followup-To:
unignore Subject:
unignore Date:
unignore Organization:
unignore Newsgroups:
unignore CC:
unignore BCC:
unignore Message-ID:
unignore X-Mailer:
unignore User-Agent:
unignore X-Spam-Status:
# Now order the visable header lines
hdr_order Date: From: To: CC: BCC: Subject: Reply-To: Mail-Followup-To: Organization: User-Agent: X-Mailer:

View File

@ -0,0 +1,56 @@
Here's what I do. I'm using neomutt. I don't recall whether that's important for this procedure or not.
In my muttrc I have this line:
macro compose K "<pipe-message>$HOME/.mutt/make-alternative.sh<enter><attach-file>/tmp/neomutt-alternative.html<enter><tag-entry><previous-entry><tag-entry><group-alternatives>"
That make-alternative.sh file is this:
#!/usr/bin/env bash
# Juice is https://www.npmjs.com/package/juice
# So expects to be installed via `sudo npm i -g juice`
juice <(pandoc --standalone --template=$HOME/.mutt/template.html --from=commonmark --to=html) /tmp/neomutt-alternative.html
As you can see from the command, it relies on pandoc and juice. pandoc is used to convert from markdown (I like Commonmark so I've told it to use that dialect) to HTML.
The juice binary is installed as mentioned in the comment. It inlines CSS to the HTML tags. That CSS is in the template.html file which is also referenced, and contains this:
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=device-width">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>-</title>
<style>
img {
max-width: 100%;
}
blockquote {
/* These styles are copied from what Gmail sends */
margin: 0px 0px 0px 0.8ex;
border-left: 1px solid rgb(204,204,204);
padding-left: 1ex;
}
</style>
</head>
<body>
$body$
</body>
</html>
As commented there, the blockquote style is pulled from what Gmail sends in its emails. I presume I added that (this is years ago) because the default stood out like a sore thumb, or something.
For usage, in the compose window (that's after you save and close the message editor, where you can see all the from and to and subject and attachments), I make sure the text/plain attachment is highlighted and I press K. That runs the macro. It runs the plain text through pandoc, adds the HTML version, then selects both and makes them a multipart/alternative group.
What I like:
When I've made a long complicated email with headings and lists and stuff I can use this macro before sending, and I know it'll be readable and won't get screwed up when forwarded or in quoted replies etc. Especially important if it's a list of questions and I'm expecting someone to reply to each inline.
It doesn't care about what I use to actually send the mail, so no sendmail/SMTP reconfiguration is necessary.
What I don't like:
Once I've run the macro, as far as I can tell (neo)mutt provides no way to ungroup the alternatives, or for me to edit/split them. So there's no way to undo, as far as I know. That means I have to know I'm finished and won't need to edit again before I run it.

57
neomutt/macros Normal file
View File

@ -0,0 +1,57 @@
# -*- muttrc -*-
#
# macros for mutt.
# Macros for use in the index.
macro index "\Cx\Cb" "<change-folder>?" # Folder list.
macro index "\Cx\Cs" "<pipe-message>cat > ~/" # Save message
macro index "\'" "<clear-flag>r" # Mark as un-replied
macro index "y" "<sync-mailbox><change-folder>?<toggle-mailboxes>" # "-y" screen
macro index "\Cb" "<pipe-message>urlview<enter>" # URL viewer.
#macro index "\ea" "<change-folder>=archives/<tab><tab>" # List archives
#macro index "\eb" "<pipe-message>lbdb-fetchaddr<enter>" # Store address details in lbdb.
macro index "\eh" "<pipe-message>mutt-mailhops|most<enter>" # View the path of the mail.
macro index "\ef" "<pipe-message>view-x-face<enter>" # View the X-Face (if there is one).
macro index "\ev" "<pipe-message>less<enter>" # View the message in less.
macro index "\Cs\Co" "<limit>~h \"X-SpamProbe: GOOD\"<enter><last-entry>" # View good emails.
macro index "\Cs\Cs" "<limit>~h \"X-SpamProbe: SPAM\"<enter><last-entry>" # View bad emails.
macro index \Cr ":source ~/.config/neomutt/neomuttrc<enter>" "Re-source the neomuttrc"
# Macros for use in the pager.
macro pager "w" "<enter-command>set invsmart_wrap invmarkers<enter>" # Toggle wrap stuff
macro pager "y" "<sync-mailbox><change-folder>?<toggle-mailboxes>" # "-y" screen
macro pager "\e1" "<enter-command>set pager_index_lines=1<enter>" # Change PIL size
macro pager "\e2" "<enter-command>set pager_index_lines=2<enter>" # Change PIL size
macro pager "\e3" "<enter-command>set pager_index_lines=3<enter>" # Change PIL size
macro pager "\e4" "<enter-command>set pager_index_lines=4<enter>" # Change PIL size
macro pager "\e5" "<enter-command>set pager_index_lines=5<enter>" # Change PIL size
macro pager "\e6" "<enter-command>set pager_index_lines=6<enter>" # Change PIL size
macro pager "\e7" "<enter-command>set pager_index_lines=7<enter>" # Change PIL size
macro pager "\e8" "<enter-command>set pager_index_lines=8<enter>" # Change PIL size
macro pager "\e9" "<enter-command>set pager_index_lines=9<enter>" # Change PIL size
macro pager "\e0" "<enter-command>set pager_index_lines=0<enter>" # Change PIL size
macro pager "\ep" "<pipe-message>~/bin/mutt-unproofpoint.py| mdcat -p |less -R<enter>" # attempt view the cleaned message
#macro pager "\ep" "<pipe-message>~/bin/mutt-unproofpoint.py| bat --terminal-width=90 -f<enter>" # attempt view the cleaned message
macro pager "\Cb" "<pipe-message>urlview<enter>" # URL viewer.
macro pager "\Cx\Cb" "<change-folder>?" # Folder list.
macro pager "\Cx\Cs" "<pipe-message>cat > ~/" # Save message
#macro pager "\eb" "<pipe-message>lbdb-fetchaddr<enter>" # Store address details in lbdb.
macro pager "\eh" "<pipe-message>mutt-mailhops|most<enter>" # View the path of the mail.
macro pager "\ef" "<pipe-message>view-x-face<enter>" # View the X-Face (if there is one).
macro pager "\ev" "<pipe-message>less<enter>" # View the message in less.
macro pager "\el" "<enter-command>set invpipe_decode<enter>\
<pipe-message>linkify|w3m -T text/html<enter><enter-command>\
set invpipe_decode<enter>" # View the message in w3m.
#macro pager "\Cs\Cs" "<pipe-message>spamprobe -T score<enter>" # What's the score for this message?
#macro pager "\Cs\Cj" "<pipe-message>spamprobe spam<enter>" # This message is junk.
#macro pager "\Cs\Cg" "<pipe-message>spamprobe good<enter>" # This message is good.
# Provide some "on-line" help.
macro generic "\e?" "<shell-escape>less /usr/share/doc/mutt/manual.txt<enter>"
macro index "\e?" "<shell-escape>less /usr/share/doc/mutt/manual.txt<enter>"
macro pager "\e?" "<shell-escape>less /usr/share/doc/mutt/manual.txt<enter>"
unbind editor <space>
macro compose \Ca ":source ~/bin/fzfattach.sh|<enter>"
macro pager A |'abook --add-email'\n

25
neomutt/mailboxes Normal file
View File

@ -0,0 +1,25 @@
# -*- muttrc -*-
#
# Mailboxes for mutt
#
# Where are mailboxes stored
set folder="imaps://imap.gmail.com/"
# Where archived mail goes
set mbox="+[Gmail]/All Mail"
#set mbox="imaps://imap.gmail.com/[Gmail]/All Mail"
# Where postponed messaged die
set postponed="+[Gmail]/Drafts"
# ... and it gets saved in =outbox.
# Gmail does this automatically, let's not duplicate...
#set record="+[Gmail]/Sent Mail"
# Look me up
set spoolfile="+INBOX"
mailboxes $spoolfile
set imap_check_subscribed = yes

27
neomutt/mailcap Normal file
View File

@ -0,0 +1,27 @@
application/msword; soffice %s;
#application/octet-stream; ~/bin/mutt.octet.filter %s; copiousoutput
application/octet-stream; file -b %s; copiousoutput
application/pdf; open -a "Preview" %s;
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; open -a "Microsoft Excel" %s
application/x-gzip; zcat %s; copiousoutput
application/x-html; open -a "Firefox" %s; nametemplate=%s.html
application/x-html; w3m -dump %s; copiousoutput; nametemplate=%s.html
image/*; open -a "Preview" %s;
text/html; open -a "Firefox" %s; nametemplate=%s.html
text/html; w3m -dump %s; copiousoutput; nametemplate=%s.html
# This should work, but doesn't
#text/plain; ~/bin/mutt-unproofpoint.py %s; copiousoutput
text/vcard; mutt_vcard_filter; copiousoutput
text/x-diff; view %s; needsterminal
text/x-patch; view %s; needsterminal

15
neomutt/message-hooks Normal file
View File

@ -0,0 +1,15 @@
# -*- muttrc -*-
#
# Fine tune mutt depending on aspects of a message.
#
# By default, don't do anything clever.
message-hook . "unset display_filter"
# Sort out silly characters from Microsoft MUAs or MUAs that suffer the same
# problems.
message-hook "~h \"X-Mailer: (Microsoft Outlook IMO|Experian ContactMail)\"" "set display_filter='tr \\\\200\\\\202\\\\221\\\\222\\\\223\\\\224\\\\225\\\\226\\\\227 \\\\244\\\\054\\\\140\\\\047\\\\042\\\\042\\\\052\\\\055\\\\055'"
# IncrediMail, whatever the hell that is, sends out its text alternative as
# DOS formatted text. Clean things up.
message-hook "~h \"X-Mailer: IncrediMail" "set display_filter='tr -d \\\\r'"

92
neomutt/neomuttrc Normal file
View File

@ -0,0 +1,92 @@
set realname="Orien Vandenbergh"
set signature="~/.signature.txt"
set from="orien.vandenbergh@guidepointsecurity.com"
set use_from = yes
set envelope_from = yes
set hostname=felurian.guidepointsecurity.com # Name of the localhost
set hidden_host # Hide host details
set alias_file=~/.config/neomutt/aliases # Personal mail aliases
#set query_command="~/bin/mutt-ldap '%s'" # How to query the company contacts
set query_command="abook --mutt-query '%s'" # How to query the company contacts
set postpone=ask-no # Ask about postponing
unset move # Keep read mail in inbox, also Gmail moves it automatically
set print=ask-no # Ask before printing
set delete=yes # Just delete it
set include # Include messages in replies
set sort_aux=date-received # Sort threads by date received
set charset=utf-8 # UTF-8 by default
#set noallow_8bit # 8bit isn't safe via Demon.
# Attribution line.
set attribution="* %n <%a> [%{%Y-%m-%d %H:%M:%S %Z}]:\n"
set edit_headers # I want to edit the message headers.
# Use emacs.
#set editor="emacs -geometry 90x73+298+0 --load post-mode"
set editor="vim -c ':0' -c '/^$/' -c ':nohlsearch'"
#set query_command="lbdbq '%s'" # Use the little brother database for doing queries.
set mark_old # Don't mark unread new msgs as old.
set mail_check=90
set mail_check_recent
set timeout=15
set mbox_type=mbox # mailbox type
set mbox="!" # Default mailbox.
#set imap_user="orien" # How we gonna log in
#set imap_peek="no" # Mark a message as read, when downloaded
#set copy # Keep copies of outgoing mail...
set nobeep # We don't need no beeping software.
set nosmart_wrap # Don't want smart wrapping.
set nomarkers # Don't want any wrap markers.
set mime_forward # Forward message as MIME attachments.
set pager_context=3 # Display 3 lines of context in pager.
set nostrict_threads # Lets have some fuzzy threading.
set sendmail_wait=-1 # Don't wait around for sendmail.
set wait_key=no # Don't wait after subshell exit
set fcc_clear # Keep fcc's clear of signatues and encryption.
unset pipe_decode # Don't decode messages when piping.
set thorough_search # Strip headers and eval mimes before searching
# Print via a2ps
set print_command="a2ps -1gEmail --borders=no --strip=3"
set tilde # Fill out messages with '~'.
set read_inc=100 # Read counter ticks every 100 msgs.
set write_inc=100 # Write counter ticks every 100 msgs.
unset confirmappend # Just append, don't hassle me.
set pager_stop # Don't skip msgs on next page.
# Where to find the mailcap.
set mailcap_path=~/.config/neomutt/mailcap:/usr/local/etc/mailcap:/etc/mailcap
# What we consider to be a quote.
set quote_regexp="^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+"
set to_chars=" +TCFL" #
set header_cache="~/.cache/neomutt/headers" # Where to cache imap headers
set message_cachedir="~/.cache/neomutt/bodies" # "" bodies
#source /usr/share/doc/mutt/samples/gpg.rc # Use GPG
source ~/.config/neomutt/accounts # Account details
source ~/.config/neomutt/aliases # Load in my aliases.
source ~/.config/neomutt/auto_views # Define auto_views.
source ~/.config/neomutt/bindings # Define key bindings.
#source ~/.config/neomutt/colours # Define colours.
source ~/.config/neomutt/colors-gruvbox-shuber
source ~/.config/neomutt/colors-gruvbox-shuber-extended
source ~/.config/neomutt/fcc-hooks # Define fcc-hooks.
source ~/.config/neomutt/folder-hooks # Define folder-hooks.
source ~/.config/neomutt/headers # Configure header display.
source ~/.config/neomutt/macros # Define macros.
source ~/.config/neomutt/mailboxes # Define the list of folders that receive mail.
source ~/.config/neomutt/message-hooks # Define message hooks.
source ~/.config/neomutt/non-standard # Support for mutt patches.
source ~/.config/neomutt/save-hooks # Define save-hooks.
source ~/.config/neomutt/subscriptions # Define the list of subscribed mailing lists.
# Play with the sidebar?
#set sidebar_divider_char = '|'
set sidebar_visible = yes
set sidebar_width = 24
#color sidebar_new color221 color233
# HTML is the last option.
alternative_order text/enriched text/plain text/html
# Last, but not least, get mutt to display its version on startup.
# This conflicts with password prompts, so leaving off
#push <show-version>

0
neomutt/non-standard Normal file
View File

13
neomutt/save-hooks Normal file
View File

@ -0,0 +1,13 @@
# -*- muttrc -*-
#
# Configure where things get saved to.
#
#save-hook .* =Archive/`date "+%Y"`/`date "+%m"`
save-hook '=f @analog.com' "=Customers/Analog"
save-hook '~f @nafinc\\.com$' "=Customers/NAF"
save-hook '~f @newyorklife\\.com$' "=Customers/NYLife"
save-hook '=f @rtx.com' "=Customers/RTX"
save-hook '=f @shu.edu' "=Customers/SHU"
save-hook '=f @partner.paloaltonetworks.com' "=Partners/PaloAlto"
save-hook '.*' "=[Gmail]/All Mail"

0
neomutt/subscriptions Normal file
View File

97
scripts/mutt-mailhops Executable file
View File

@ -0,0 +1,97 @@
#!/usr/bin/perl -w
# Copyright (c) 1999 Marius Gedminas <mged...@takas.lt>
# Shows the route of an Internet mail message
# Version 0.0.1pre-alpha
#
# Patched by Roland Rosenfeld <rol...@spinnaker.de>
# $ Id: mailhops,v 1.3 2000/01/25 20:18:24 roland Exp roland $
use strict;
use POSIX qw(mktime);
use Date::Parse;
my $verbose = 0;
# Setup
my %Months = (
Jan => 1,
Feb => 2,
Mar => 3,
Apr => 4,
May => 5,
Jun => 6,
Jul => 7,
Aug => 8,
Sep => 9,
Oct => 10,
Nov => 11,
Dec => 12,
);
# Read headers
$/ = '';
my $head = <>;
$head =~ s/\n\s+/ /g;
my @headers = split("\n", $head);
# Parse headers
my @hops;
for (@headers) {
next unless /^(>?Received|Date):/;
my $time;
my $host;
my $from;
if (/^Date:\s+(.*)/) {
$host = "Date:";
$time = $1;
$from = "";
} else {
$host = "(unknown)";
$host = $1 if /\sby\s+([a-z0-9\-_+.]+)\s/ && $1 ne "uid";
$from = "(unknown)";
$from = $1 if /\sfrom\s+([a-z0-9\-_+.]+(?:\s+[(].+?[)]))\s/;
$time = "(unknown)";
$time = $1 if /;\s+(.+)$/;
$time =~ s/using.*//;
}
my $epoch = str2time ($time);
unshift @hops, { HOST => $host, FROM => $from, TIME => $epoch};
}
# Print output
print " Host Date received (local) Lag
Total lag\n";
my $nr = 0;
my ($first, $prev);
for (@hops) {
my $host = $_->{HOST};
my $from = $_->{FROM};
my $time = $_->{TIME};
$first = $prev = $time unless defined $first;
printf "%2d. %-31.31s", ++$nr, $host;
do { print "\n"; next } unless defined $time;
my $delta = $time - $prev;
my $neg = $delta < 0; $delta = abs($delta);
my $delta_h = int($delta / 3600);
my $delta_m = int(($delta - $delta_h * 3600) / 60);
my $delta_s = ($delta - $delta_h * 3600 - $delta_m * 60);
my ($sec,$min,$hour,$day,$mon,$year,undef,undef,$dst) = localtime($time);
printf " %4d-%02d-%02d %02d:%02d:%02d %s%02d:%02d:%02d",
1900+$year, $mon+1, $day, $hour, $min, $sec,
$neg ? '-' : ' ', $delta_h, $delta_m, $delta_s;
$delta = $time - $first;
$neg = $delta < 0; $delta = abs($delta);
$delta_h = int($delta / 3600);
$delta_m = int(($delta - $delta_h * 3600) / 60);
$delta_s = ($delta - $delta_h * 3600 - $delta_m * 60);
printf " %s%02d:%02d:%02d\n",
$neg ? '-' : ' ', $delta_h, $delta_m, $delta_s;
print " from $from\n" if $verbose;
$prev = $time;
}

View File

@ -3,5 +3,6 @@
## How to install
```zsh
curl -sL https://git.momodomo.us/nichus/sundry/raw/branch/main/zsh/init-zsh.sh | zsh
export LC_ALL=en_US.UTF-8
cur l-sL https://git.momodomo.us/nichus/sundry/raw/branch/main/zsh/init-zsh.sh | zsh
```

View File

@ -9,6 +9,8 @@ git clone https://github.com/nichus/zplug-fork $HOME/.zplug
mkdir git
git clone $REPO git/sundry
install -vt $HOME/.zsh git/sundry/zsh
ln -vs zshrc $HOME/.zshrc
mv -v $HOME/zshenv .zshenv
install -vd $HOME/.zsh/lib
install -v git/sundry/zsh/zshenv $HOME/.zshenv
install -v git/sundry/zsh/zshrc $HOME/.zsh/.zshrc
install -vt $HOME/.zsh/lib git/sundry/zsh/lib/*
ln -vs .zshrc $HOME/.zsh/zshrc