From 7e54f3c6363a5dc79d61868cc3df7c9124ea05e5 Mon Sep 17 00:00:00 2001 From: Don Harper Date: Sun, 21 Apr 2024 16:27:18 -0500 Subject: [PATCH] home | first pass bringing neomutt in the fold --- home/common/mail.nix | 352 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 352 insertions(+) diff --git a/home/common/mail.nix b/home/common/mail.nix index 48fa264..e7f38b1 100644 --- a/home/common/mail.nix +++ b/home/common/mail.nix @@ -11,6 +11,25 @@ }; }; + # xdg = { + # desktopEntries = { + # neomutt = { + # name = "Neomutt"; + # genericName = "Email Client"; + # comment = "Read and send emails"; + # exec = "neomutt %U"; + # icon = "mutt"; + # terminal = true; + # categories = [ "Network" "Email" "ConsoleOnly" ]; + # type = "Application"; + # mimeType = [ "x-scheme-handler/mailto" ]; + # }; + # }; + # mimeApps.defaultApplications = { + # "x-scheme-handler/mailto" = "neomutt.desktop"; + # }; + # }; + programs.notmuch = { enable = true; new = { @@ -23,6 +42,339 @@ }; }; }; + + programs.neomutt = { + enable = true; + vimKeys = true; + sidebar.enable = false; + settings = { + abort_nosubject = "ask-no"; + abort_unmodified = "ask-yes"; + arrow_cursor = "yes"; + askcc = "yes"; + attach_save_dir = "~/Downloads"; + beep = "no"; + delete = "yes"; + edit_headers = "yes"; + editor = "nvim"; + fast_reply = "yes"; + fcc_attach = "yes"; + from = "'don@donharper.org'"; + hidden_host = "yes"; + hostname = "duckland.org"; + implicit_autoview = "yes"; + include = "yes"; + index_format = "%3C %Z %[%m/%d %l:%M %P] %-20.20F %s"; + ispell = "aspell -e -c"; + mailcap_path = "~/.config/neomutt/mailcap"; + mbox_type = "Maildir"; + mh_purge = "yes"; + mime_forward = "ask-yes"; + move = "no"; + pager_format = "%<%r> | [%C/%m] %l lines | %-18.18n | %-30.30s"; + pager_index_lines = "3"; + pager_stop = "yes"; + postponed = "+Drafts"; + print_command = "'/home/don/bin/muttprint'"; + query_command = "echo %s | xargs khard email --parsable --"; + quit = "ask-yes"; + read_inc = "25"; + realname = "Don Harper"; + recall = "ask-no"; + record = "+Sent-Mail"; + reverse_name = "yes"; + sendmail = "/run/wrappers/bin/sendmail"; + sendmail_wait = "3"; + sort = "threads"; + sort_aux = "last-date-sent"; + spoolfile = "+Inbox"; + status_format = "---Mutt: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Post:%p?%?b? Inc:%b? ]-%>-(%P)---"; + status_on_top = "yes"; + timeout = "10"; + tmpdir = "/var/tmp"; + trash = "+Trash"; + use_envelope_from = "yes"; + wrap = "-10"; + write_inc = "25"; + auto_tag = "no"; + confirm_append = "no"; + mark_old = "no"; + markers = "no"; + prompt_after = "no"; + sig_dashes = "no"; + uncollapse_jump = "no"; + wait_key = "no"; + }; + binds = [ + { + action = "exit"; + key = "Q"; + map = [ "attach" "compose" ]; + } + { + action = "exit"; + key = "i"; + map = [ "attach" "pager" ]; + } + { + action = "complete-query"; + key = ""; + map = [ "editor" ]; + } + { + action = "sync-mailbox"; + key = "x"; + map = [ "index" ]; + } + { + action = "vfolder-from-query"; + key = "/"; + map = [ "index" "pager" ]; + } + { + action = "flag-message"; + key = "*"; + map = [ "index" "pager" ]; + } + { + action = "print-message"; + key = "Y"; + map = [ "index" "pager" ]; + } + { + action = "change-folder"; + key = "g"; + map = [ "index" "pager" ]; + } + { + action = "next-entry"; + key = "n"; + map = [ "index" "pager" ]; + } + { + action = "previous-entry"; + key = "p"; + map = [ "index" "pager" ]; + } + { + action = "group-reply"; + key = "R"; + map = [ "index" "pager" ]; + } + { + action = "next-line"; + key = ""; + map = [ "pager" ]; + } + { + action = "previous-line"; + key = ""; + map = [ "pager" ]; + } + { + action = "copy-message"; + key = "C"; + map = [ "pager" ]; + } + ]; + macros = + [ + { + action = "unset wait_keyrm -f /tmp/events.ics/tmp/events.ics vkhal -k /tmp/events.ics"; + key = "K"; + map = [ "attach" ]; + } + { + action = "!/home/don/bin/mbsync gmail-fast\n"; + key = ""; + map = [ "attach" "index" "pager" ]; + } + { + action = ""; + key = "y"; + map = [ "compose" ]; + } + { + action = ":source ~/.config/neomutt/neomuttrc\n"; + key = "\em"; + map = [ "generic" ]; + } + { + action = "g!\n"; + key = "i"; + map = [ "index" ]; + } + { + action = "toggle sidebar_visible"; + key = "B"; + map = [ "index" ]; + } + { + action = "g\r"; + key = "\t"; + map = [ "index" ]; + } + { + action = "=Inbox"; + key = "@"; + map = [ "index" "pager" ]; + } + { + action = "khard add-email"; + key = "A"; + map = [ "index" "pager" ]; + } + { + action = "mutt2task=Followup"; + key = "F"; + map = [ "index" "pager" ]; + } + { + action = "mail2obsidian"; + key = "O"; + map = [ "index" "pager" ]; + } + { + action = ":set quit=yes\nq"; + key = "Q"; + map = [ "index" "pager" ]; + } + { + action = "=SPAM"; + key = "S"; + map = [ "index" "pager" ]; + } + { + action = "mail2onenote"; + key = "W"; + map = [ "index" "pager" ]; + } + { + action = "emailtask"; + key = "w"; + map = [ "index" "pager" ]; + } + { + action = ""; + key = "y"; + map = [ "index" "pager" ]; + } + { + action = "toggle sidebar_visible"; + key = "B"; + map = [ "pager" ]; + } + { + action = "ql"; + key = "l"; + map = [ "pager" ]; + } + { + action = ":set pipe_decode\n|urlscan -c -d\n:unset pipe_decode\n"; + key = "o"; + map = [ "pager" ]; + } + { + action = "ix"; + key = "x"; + map = [ "pager" ]; + } + ]; + extraConfig = + '' + alternates ((root|postmaster|don|duck|duckunix|donald.m.harper|dondmharper|dharper|harperdo|donald.harper)@(duckland.org|gmail.com|donharper.org|donaldharper.com|l1a.org)) + auto_view application/excel application/ms-Excel application/msexcel + auto_view application/msword application/vnd.msword + auto_view application/vnd.ms-excel application/x-excel + auto_view application/vnd.ms-powerpoint application/x-mspowerpoint application/ppt + auto_view application/x-msexcel + auto_view text/calendar application/ics + auto_view text/html + color indicator underline default default + hdr_order Subject: From: Date: Reply-To: To: Cc: Bcc: X-Scan-Grey: X-Bugzilla-Watch-Reason: X-Label: List-Id: + ignore * + mailboxes =Inbox =news =mailing-lists =development =SPAM =Followup + reply-hook '~C don@donaldharper.com' 'my_hdr From: "Don Harper" ; my_hdr Reply-To: "Don Harper" ;set from="don@donaldharper.com"' + reply-hook '~C don@donharper.org' 'my_hdr From: "Don Harper" ; my_hdr Reply-To: "Don Harper" ;set from="don@donharper.org"' + reply-hook '~C donald.m.harper@gmail.com' 'my_hdr From: "Don Harper" ; my_hdr Reply-To: "Don Harper" ;set from="donald.m.harper@gmail.com"' + reply-hook '~C duckunix@gmail.com' 'my_hdr From: "Don Harper" ; my_hdr Reply-To: "Don Harper" ;set from="duckunix@gmail.com"' + reply-hook '~C vicky' 'set crypt_autosign=no; my_hdr From: "Don Harper" ; my_hdr Reply-To: "Don Harper" ;set from="don@donharper.org"' + save-hook '~f noreply@sportsyou.com' '+kisd' + save-hook '~f instructure.com' '+kisd' + save-hook '~f k12insight.com' '+kisd' + save-hook '~f katyisd.org' '+kisd' + save-hook '~f bbstheatre@gmail.com' '+kisd' + save-hook '~f parentlink.net' '+kisd' + save-hook '~f parents@uh.campusespmail.com' '+uh' + save-hook '~f utdallas.edu' '+utd' + save-hook '~f earnest.com' '+uh' + save-hook '~f uh.edu' '+uh' + save-hook . "+All-Mail" + send-hook '~C don@donaldharper.com' 'my_hdr From: "Don Harper" ; my_hdr Reply-To: "Don Harper" ;set from="don@donaldharper.com"' + send-hook '~C don@donharper.org' 'my_hdr From: "Don Harper" ; my_hdr Reply-To: "Don Harper" ;set from="don@donharper.org"' + send-hook '~C donald.m.harper@gmail.com' 'my_hdr From: "Don Harper" ; my_hdr Reply-To: "Don Harper" ;set from="donald.m.harper@gmail.com"' + send-hook '~C duck@duckland.org' 'my_hdr From: "Don Harper" ; my_hdr Reply-To: "Don Harper" ;set from="duck@duckland.org"' + send-hook '~C duckunix@gmail.com' 'my_hdr From: "Don Harper" ; my_hdr Reply-To: "Don Harper" ;set from="duckunix@gmail.com"' + send-hook '~C vicky' 'set crypt_autosign=no; my_hdr From: "Don Harper" ; my_hdr Reply-To: "Don Harper" ;set from="don@donharper.org"' + send-hook '~C@KATYISD\\.ORG ' 'set from="don@donharper.org"' + send-hook '~C@katyisd\\.org ' 'set from="don@donharper.org"' + send-hook '~C@ymcahouston\\.org' 'set from="don@donharper.org"' + unauto_view * # remove all old entries + unhdr_order * # clear system defaults + unhdr_order * # clear system defaults + unignore Subject: From: Date: Reply-To: To: Cc: Bcc: X-Scan-Grey: X-Bugzilla-Watch-Reason: X-Label: List-Id: + ############################################################################### + # Dracula Theme for Mutt: https://draculatheme.com/ + # + # @author Paul Townsend + + # general ------------ foreground ---- background ----------------------------- + color error color231 color212 + color indicator color231 color241 + color markers color210 default + color message default default + color normal default default + color prompt default default + color search color84 default + color status color141 color236 + color tilde color231 default + color tree color141 default + + # message index ------ foreground ---- background ----------------------------- + color index color84 default "~F !~p !~P" + color index color117 default "~N !~T !~F !~p !~P !~D" + color index color212 default ~Q + color index color215 default "~T !~F !~p !~P" + color index color141 default ~v + color index color130 default "~h 'X-GitHub-Reason: author' ~N" + color index color229 default "~h 'X-GitHub-Reason: author'" + color index color228 default "~P" + color index color228 default "~sRelease" + color index color228 default "~sComic" + color index color228 default "~scomic" + color index color226 default ~F # flagged messages + color index color210 default ~D + + # message headers ---- foreground ---- background ----------------------------- + color hdrdefault color117 default + color header color231 default ^Subject:.* + + # message body ------- foreground ---- background ----------------------------- + color attachment color228 default + color body color231 default [\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+ # email addresses + color body color228 default (https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+ # URLs + color body color231 default (^|[[:space:]])\\*[^[:space:]]+\\*([[:space:]]|$) # *bold* text + color body color231 default (^|[[:space:]])_[^[:space:]]+_([[:space:]]|$) # _underlined_ text + color body color231 default (^|[[:space:]])/[^[:space:]]+/([[:space:]]|$) # /italic/ text + color quoted color61 default + color quoted1 color117 default + color quoted2 color84 default + color quoted3 color215 default + color quoted4 color212 default + color signature color212 default + ''; + }; + home.file.".signature".text = ''