diff options
Diffstat (limited to 'home')
-rw-r--r-- | home/xyz/.abook/abookrc | 14 | ||||
-rw-r--r-- | home/xyz/.config/myconf/pacman_Qqme | 1 | ||||
-rw-r--r-- | home/xyz/.config/myconf/pacman_Qqne | 2 | ||||
-rw-r--r-- | home/xyz/.config/neomutt/mail | 4 | ||||
-rw-r--r-- | home/xyz/.config/neomutt/mail2 | 4 | ||||
-rw-r--r-- | home/xyz/.config/neomutt/neomuttrc | 203 | ||||
-rwxr-xr-x | home/xyz/.local/bin/neomutt | 7 | ||||
-rw-r--r-- | home/xyz/.mbsyncrc | 57 |
8 files changed, 292 insertions, 0 deletions
diff --git a/home/xyz/.abook/abookrc b/home/xyz/.abook/abookrc new file mode 100644 index 00000000..59b2081d --- /dev/null +++ b/home/xyz/.abook/abookrc @@ -0,0 +1,14 @@ +# bad default coloring, I dislike +#set use_colors=true + +# '$BROWSER' does not work +set www_command="$BROWSER" + +set index_format=" {name:22} {email:30} {phone:14|workphone|mobile|fax|misc_phones}" + +field misc_phones = "Misc Phones", list + +view CONTACT = name, email +view ADDRESS = address, address2, city, state, zip, country +view PHONE = phone, workphone, fax, mobile, misc_phones +view OTHER = nick, url, notes, anniversary, groups diff --git a/home/xyz/.config/myconf/pacman_Qqme b/home/xyz/.config/myconf/pacman_Qqme index b53d3ce7..d398606d 100644 --- a/home/xyz/.config/myconf/pacman_Qqme +++ b/home/xyz/.config/myconf/pacman_Qqme @@ -1,3 +1,4 @@ +abook absolutely-proprietary arkenfox-user.js bash-complete-alias diff --git a/home/xyz/.config/myconf/pacman_Qqne b/home/xyz/.config/myconf/pacman_Qqne index 5616def9..aa42f2ad 100644 --- a/home/xyz/.config/myconf/pacman_Qqne +++ b/home/xyz/.config/myconf/pacman_Qqne @@ -67,6 +67,7 @@ ioping iotop-c iperf3 irqbalance +isync java-commons-lang jdk-openjdk jq @@ -93,6 +94,7 @@ mpv-mpris mupdf-tools namcap nawk +neomutt neovim net-tools nethogs diff --git a/home/xyz/.config/neomutt/mail b/home/xyz/.config/neomutt/mail new file mode 100644 index 00000000..9c5df856 --- /dev/null +++ b/home/xyz/.config/neomutt/mail @@ -0,0 +1,4 @@ +set smtp_url='smtps://xyz@mail.flylightning.xyz' +set folder="$XDG_DATA_HOME/mail/xyz@mail.flylightning.xyz" +# need to put mailboxes here in each accuont, don't only put one in neomuttrc, else can't switch accounts +mailboxes =INBOX =Sent =Drafts =Archive =Junk =Trash diff --git a/home/xyz/.config/neomutt/mail2 b/home/xyz/.config/neomutt/mail2 new file mode 100644 index 00000000..82663aa8 --- /dev/null +++ b/home/xyz/.config/neomutt/mail2 @@ -0,0 +1,4 @@ +set smtp_url='smtps://xyz@mail2.flylightning.xyz' +set folder="$XDG_DATA_HOME/mail/xyz@mail2.flylightning.xyz" +# need to put mailboxes here in each accuont, don't only put one in neomuttrc, else can't switch accounts +mailboxes =INBOX =Sent =Drafts =Archive =Junk =Trash diff --git a/home/xyz/.config/neomutt/neomuttrc b/home/xyz/.config/neomutt/neomuttrc new file mode 100644 index 00000000..afd5aa75 --- /dev/null +++ b/home/xyz/.config/neomutt/neomuttrc @@ -0,0 +1,203 @@ +# references: +# https://github.com/LukeSmithxyz/mutt-wizard +# https://wiki.archlinux.org/title/Mutt +# https://videos.lukesmith.xyz/ +# https://docs.kernel.org/process/email-clients.html +# https://blog.flaport.net/configuring-neomutt-for-email.html + +# maybe useful: +# `man neomuttrc` +# `man neomutt` +# /etc/neomutt +# https://neomutt.org/guide/gettingstarted.html +# /usr/share/doc/neomutt/optionalfeatures.html +# has hotkey documentation: +# /usr/share/doc/neomutt/manual.txt + +# realname and spoolfile deprecated, use real_name and spool_file, also some other variable names, see: +# https://github.com/neomutt/neomutt/commit/a5eaeb51b14c484fa52f6f519446253dea5667ca + +source mail2 +# maybe useful for multiple accounts +#folder-hook $folder 'source mail2' +source mail +#folder-hook $folder 'source mail' + +# note the imaps:// and smtps://, maybe more secure? +# note: xyz@flylightning.xyz will not work, need mail.flylightning.xyz, maybe because they require the actual imaps and smtps email server DNS +#set smtp_url='smtps://xyz@mail.flylightning.xyz' +# mbox_type not sure if needed, maybe needed because isync/mbsync set to use maildir format +set mbox_type=Maildir +#set folder="$XDG_DATA_HOME/mail/xyz@mail.flylightning.xyz" +# if fully online and not using mbsync: +#set folder='imaps://xyz@mail.flylightning.xyz' + +# https://wiki.archlinux.org/title/Mutt#Pass +# need "" instead of ''? +# Just `pass show xxx` also works. My xxx password also has lines of other info I do not want to output +# credit: GPL-2.0-or-later https://git.zx2c4.com/password-store/tree/contrib/dmenu/passmenu +# pipe to `head -n1` also works, it seems it will auto strip out \n newline char? +set imap_pass="`pass show master3 | { IFS= read -r p; printf %s \"$p\";}`" +set smtp_pass="`pass show master3 | { IFS= read -r p; printf %s \"$p\";}`" + +set from='xyz@flylightning.xyz' +# /etc/neomuttrc says if use from var this will not use? not sure if works +set real_name='Xiao Pan' + +# this seems also determines sidebar mailbox order +#mailboxes =INBOX =Sent =Drafts =Archive =Junk =Trash +# if fully online and use `set folder="imaps://xyz@mail.flylightning.xyz"` instead: +# default not auto subscribe to inbox? need `mailboxes =INBOX` at least +#mailboxes =INBOX +#set imap_check_subscribed + +# spool_file not sure if needed +# + seems mean remote? +set spool_file='+INBOX' +set record='+Sent' +set trash='+Trash' +set postponed='+Drafts' + +# `man neomuttrc.5` says "Header caching can greatly improve speed when ..." +set header_cache="$XDG_CACHE_HOME/mutt" +set message_cache_dir="$XDG_CACHE_HOME/mutt" + +# Allow Mutt to open a new IMAP connection automatically. +unset imap_passive + +set attach_save_dir="$XDG_DOWNLOAD_DIR" +set attach_save_without_prompting + +# linux kernel mailing list rules: +set send_charset="us-ascii:utf-8" +# Sender, email address, and sign-off line must match +# because joe@localhost is just embarrassing +unset use_domain + +# about pgp: +#auto_view application/pgp-encrypted +# maybe use account-hook or folder-hook to `unset crypt_auto_sign` for accounts I do not wish to auto sign +set crypt_auto_sign +set pgp_default_key='FDA389A17B94BCE0E2FA3D71842BFD347BE06812' +# maybe useful: crypt_opportunistic_encrypt, crypt-hook + +# https://neomutt.org/guide/gettingstarted#2-4-%C2%A0sidebar +set sidebar_visible +set sidebar_width=20 +# manpage suggested +# %<... is nested if, see https://neomutt.org/feature/nested-if +set sidebar_format='%B%<F? [%F]>%* %<N?%N/>%S' +set sidebar_short_path +# needed for some sidebar features +set mail_check_stats + +# to avoid lags using IMAP with some email providers (yahoo for example) +set mail_check=60 + +# no ask auto save to draft +set postpone='yes' + +# need echo here to run an external shell command, see https://neomutt.org/feature/global-hooks +# startup-hook works, but I'm not confidient with it because shutdown-hook is buggy, see below. Because I'll need a wrapper script for mbsync after shutdown, I decided to just use a wrapper script for mbsync before startup also for now +#startup-hook 'echo `mbsync -a`' +# I decided not to use timeout-hook and shutdown-hook hooks due to its issues with mbsync, see below +# timeout-hook and shutdown-hook configured with startup-hook will cause timeout-hook and shutdown-hook mbsync not working? see https://github.com/neomutt/neomutt/issues/3298 , my experience is shutdown-hook's mbsync not working, not sure how to test timeout-hook +# somehow `sleep 1; mbsync -a` works? +# maybe related: https://github.com/neomutt/neomutt/issues/4184 https://github.com/neomutt/neomutt/pull/4200 +# more bug notes see vq +# consider I may use another email client to access remote email mailboxes, sync when shutdown so those other email client can get latest changes +#shutdown-hook 'echo `mbsync -a`' +# I don't understand timeout-hook and $timeout very well, but seems useful, $timeout default 600 seconds, so maybe it sync every 600s +#timeout-hook 'echo `mbsync -a`' + +# no prompt for deleting emails +set delete=yes +# no prompt for moving emails +set confirm_append=no + +# man neomuttrc, query_command: "NeoMutt will add quotes around the string +# substituted for "%s" automatically according to shell quoting rules, so you +# should avoid adding your own. If no "%s" is found in the string, NeoMutt will +# append the user's query to the end of the string." +set query_command="abook --mutt-query" +# https://neomutt.org/guide/advancedusage#8-%C2%A0external-address-queries +# completion when ask for address input +# default ^T +# another way is Q, it will let me select an address from abook and start a new email +bind editor <Tab> complete-query + +# email from insp to ca mail server to others will have "Received: from xyzinsp.mynetworksettings.com" in email header, VPN only change IP but not this auto-detected hostname by neomutt, if privacy is a concern for future anonymous email server, set hostname=..., e.g.: +#set hostname='anonymous' + +# maybe: +# maybe, from mutt-wizard: +# maybe add configs from mutt-wizard: +# - add Maildir configs? see arch wiki and mutt-wizard, not fully understood +# - mime type configs +# - other configs +# seems not working with this: +#set smtp_authenticators='gssapi:login' +#set forward_attachments=yes +#set forward_format = "Fwd: %s" +# can configure mailcap configs ~/.mailcap to use lynx to auto show html with lynx +#auto_view text/html + +# https://blog.flaport.net/configuring-neomutt-for-email.html +# https://github.com/LukeSmithxyz/mutt-wizard/blob/master/share/mutt-wizard.muttrc +# M default to show-log-messages, can be executed by `:exec show-log-messages` +bind index,pager M noop +# C deafult to copy-message +bind index,pager C noop +# g default to group-reply +bind index,pager g noop +bind index,pager R group-reply +bind index,pager i noop + +macro index,pager \'a "<change-folder>=Archive<enter>" "go to archive" +macro index,pager \'d "<change-folder>=Drafts<enter>" "go to drafts" +macro index,pager \'i "<change-folder>=INBOX<enter>" "go to inbox" +macro index,pager \'j "<change-folder>=Junk<enter>" "go to junk" +macro index,pager \'s "<change-folder>=Sent<enter>" "go to sent" +macro index,pager \'t "<change-folder>=Trash<enter>" "go to trash" +macro index,pager Ca ";<copy-message>=Archive<enter>" "copy mail to archive" +macro index,pager Cd ";<copy-message>=Drafts<enter>" "copy mail to drafts" +macro index,pager Ci ";<copy-message>=INBOX<enter>" "copy mail to inbox" +macro index,pager Cj ";<copy-message>=Junk<enter>" "copy mail to junk" +macro index,pager Cs ";<copy-message>=Sent<enter>" "copy mail to sent" +macro index,pager Ct ";<copy-message>=Trash<enter>" "copy mail to trash" +macro index,pager Ma ";<save-message>=Archive<enter>" "move mail to archive" +macro index,pager Md ";<save-message>=Drafts<enter>" "move mail to drafts" +macro index,pager Mi ";<save-message>=INBOX<enter>" "move mail to inbox" +macro index,pager Mj ";<save-message>=Junk<enter>" "move mail to junk" +macro index,pager Ms ";<save-message>=Sent<enter>" "move mail to sent" +macro index,pager Mt ";<save-message>=Trash<enter>" "move mail to trash" +# here must specify full path of the file to source, else it will souce in the dir where neomutt is execute at +# use vim-like uppercase marks +# Ca mail server +macro index,pager \'C '<sync-mailbox><enter-command>source "$XDG_CONFIG_HOME/neomutt/mail"<enter><change-folder>!<enter>' +# Ib mail server +macro index,pager \'I '<sync-mailbox><enter-command>source "$XDG_CONFIG_HOME/neomutt/mail2"<enter><change-folder>!<enter>' +# maybe useful for multiple accounts +#macro index c "<change-folder>?<change-dir><home>^K=<enter>" + +macro index S "<shell-escape>mbsync -a<enter>" "sync email" + +bind index L limit +bind attach l view-mailcap +bind pager l view-attachments +bind index l display-message +bind browser l select-entry +bind pager,attach h exit +bind index h quit +bind index g first-entry +bind index G last-entry +bind browser g top-page +bind browser G bottom-page +bind pager g top +bind pager G bottom + +# N hotkey default functions change bind to E hotkey, because I want to bind N as search-opposite +bind index E toggle-new +bind pager E mark-as-new +bind browser E select-new +bind index,pager,browser N search-opposite diff --git a/home/xyz/.local/bin/neomutt b/home/xyz/.local/bin/neomutt new file mode 100755 index 00000000..53d28ac5 --- /dev/null +++ b/home/xyz/.local/bin/neomutt @@ -0,0 +1,7 @@ +#!/bin/sh + +# neomutt shutdown-hook is buggy with mbsync, so I decided to use a wrapper script instead +# more see neomuttrc and vq bug notes +mbsync -a +/usr/bin/neomutt "$@" +mbsync -a diff --git a/home/xyz/.mbsyncrc b/home/xyz/.mbsyncrc new file mode 100644 index 00000000..47356a43 --- /dev/null +++ b/home/xyz/.mbsyncrc @@ -0,0 +1,57 @@ +# references: +# /usr/share/doc/isync/examples/mbsyncrc.sample +# https://wiki.archlinux.org/title/Isync +# `man mbsync` +# https://github.com/LukeSmithxyz/mutt-wizard + +IMAPStore xyz@mail.flylightning.xyz-remote +Host mail.flylightning.xyz +User xyz +# credit: GPL-2.0-or-later https://git.zx2c4.com/password-store/tree/contrib/dmenu/passmenu +PassCmd "pass master3 | { IFS= read -r p; printf %s \"$p\";}" +TLSType IMAPS +CertificateFile /etc/ssl/certs/ca-certificates.crt + +IMAPStore xyz@mail2.flylightning.xyz-remote +Host mail2.flylightning.xyz +User xyz +# credit: GPL-2.0-or-later https://git.zx2c4.com/password-store/tree/contrib/dmenu/passmenu +PassCmd "pass master3 | { IFS= read -r p; printf %s \"$p\";}" +TLSType IMAPS +CertificateFile /etc/ssl/certs/ca-certificates.crt + +MaildirStore xyz@mail.flylightning.xyz-local +# man page says needed +Subfolders Verbatim +# trailing slash important? +# seems $XDG_DATA_HOME does not work? +Path ~/.local/share/mail/xyz@mail.flylightning.xyz/ +Inbox ~/.local/share/mail/xyz@mail.flylightning.xyz/INBOX + +MaildirStore xyz@mail2.flylightning.xyz-local +# man page says needed +Subfolders Verbatim +# trailing slash important? +# seems $XDG_DATA_HOME does not work? +Path ~/.local/share/mail/xyz@mail2.flylightning.xyz/ +Inbox ~/.local/share/mail/xyz@mail2.flylightning.xyz/INBOX + +Channel xyz@mail.flylightning.xyz +Expunge Both +# old system use master and slave +Far :xyz@mail.flylightning.xyz-remote: +Near :xyz@mail.flylightning.xyz-local: +# not sure if needed +Patterns * +Create Both +SyncState * + +Channel xyz@mail2.flylightning.xyz +Expunge Both +# old system use master and slave +Far :xyz@mail2.flylightning.xyz-remote: +Near :xyz@mail2.flylightning.xyz-local: +# not sure if needed +Patterns * +Create Both +SyncState * |