From b5d941e6294ae4fee8d57566ff9a60413c426037 Mon Sep 17 00:00:00 2001 From: xinyz Date: Sat, 13 Jun 2020 22:11:37 +0800 Subject: [PATCH] initial commit --- common/pass/airocpss.gpg.asc | 17 +++++ common/pass/hotmail.gpg.asc | 17 +++++ mbsync/mbsyncrc | 115 ++++++++++++++++++++++++++++++++++ msmtp/msmtprc | 28 +++++++++ mutt/accounts/airocpss | 22 +++++++ mutt/accounts/hotmail | 23 +++++++ mutt/bindings | 40 ++++++++++++ mutt/cache/bodies/.gitignore | 3 + mutt/cache/headers/.gitignore | 3 + mutt/colors | 46 ++++++++++++++ mutt/mailcap | 21 +++++++ mutt/muttrc | 103 ++++++++++++++++++++++++++++++ mutt/tmp/.gitignore | 3 + 13 files changed, 441 insertions(+) create mode 100644 common/pass/airocpss.gpg.asc create mode 100644 common/pass/hotmail.gpg.asc create mode 100644 mbsync/mbsyncrc create mode 100644 msmtp/msmtprc create mode 100644 mutt/accounts/airocpss create mode 100644 mutt/accounts/hotmail create mode 100644 mutt/bindings create mode 100644 mutt/cache/bodies/.gitignore create mode 100644 mutt/cache/headers/.gitignore create mode 100644 mutt/colors create mode 100644 mutt/mailcap create mode 100644 mutt/muttrc create mode 100644 mutt/tmp/.gitignore diff --git a/common/pass/airocpss.gpg.asc b/common/pass/airocpss.gpg.asc new file mode 100644 index 0000000..676398d --- /dev/null +++ b/common/pass/airocpss.gpg.asc @@ -0,0 +1,17 @@ +-----BEGIN PGP MESSAGE----- + +hQIMA2aMbQr8T6x3AQ//RzVu72wVAIH9ZCKd/xtiszCjhrdWnWnuCT/jxIS3b8Qh +Xua3X7h8F9m/RzC3In2o28/JtD1PnLqVY7PHUYjfAFAXL6beQa+vmHbxSG4U+/kN +yZs1/tyHXESVAjtV2aiwy+xnj6gnx2sgk1oHcZoNm/BqdZSX4QnZbHiQS8qHxnSN +8ATBJpdC1jV16Af8+yd5dZ+xHMwPcm6F1iCWoqQ6lGAxOhKplLZ+e+5nXd2zBHMR +g0IEBLHOEbHrNqmRVyoFtoxeqAEjhVT2E6kBuQcD2unmkf1XX8knAMVUpbP/U3xL +VmttfZTjd441fTdQbUUFVFLT3CYn/DK/Jkzo4m2PGaRuLlD2UyFweFZprPDmpjwj +JmVz7FwDncpbJLJ4IdMxNLMO2wwCTG/gH4HG/rfOCQiWLbXR8N6SQcxRO2Y4HEDd +HUVEUQNpJR20f14z0hfY/xlDph6/uWdnn4g33vu31qMVmoiV+Dv/zxDespw5Bt/l +KgDxj6J5qPGr6pom3U26AbVX1z5a+fn2ixCwS++eB5AqMDY9xuzo5GURGqLWhOCM +D34YiBwNW7SkgU2RugJrn9b73iJFafRKCyZEO6gSrkNT35mtDuejSmVzs745sRN9 +F6aFHjHyoVPo5S5W56PyoM4i9F4txgieuQTJ1tU1kIqc64ootTncXR+sBKWyjafS +RgGBmyCdqTvd3IyrniLVgYHJyv0rgxt7y3uDL8e/nRBE2g7hHAZ7rFf4g/8YCfuv +XvgJCHZd2pWpmPZGyMhZ+8+zb8ccJAQ= +=OhhR +-----END PGP MESSAGE----- diff --git a/common/pass/hotmail.gpg.asc b/common/pass/hotmail.gpg.asc new file mode 100644 index 0000000..6970c01 --- /dev/null +++ b/common/pass/hotmail.gpg.asc @@ -0,0 +1,17 @@ +-----BEGIN PGP MESSAGE----- + +hQIMA2aMbQr8T6x3AQ//ZSo7yKCmWwD4wVFMBXEy/M5fkC5dUiyrxKAJKSNtzc2e +AlfrolVm3BkqIaugNFzp080na6Bnv9wtvb3pgJ88Krfk5HDmm++iz6uWrM+3AC6+ +Z/9excdyajE5iM7seTVu+MM2+PXRJghN/4eCQe5VCKK1BJgQZ3EWqFqfU6LYrc15 +/vGJn9lCCa3yCiCfZvRoTvyzw0cqGyegj8tU1SAnmR6L5ZNw+1L6rDM9fj9tPVsl +JpEdKgfLDW66NHDRqyXTON0pF0iJyh4ewCdQ6Ik0gI2joc1UHYHlgTN8T6onRjf3 +d6+17NDtQdpntPWtU3QqGG/5PfEwkQdkIcpxOtY3z0vxoK2ei+dgdQJecd1pK67R +LFIakqvQJFtZUGR2y0R/DkZ6IyRkSlKxQ03L7ft3fpsgYGV/z5pVoONUZd0G71Qg +d3Ttm9a2erHx8lHR3oXKeSe8xZvIN+8oxOR/WHX8vWxXeGU/yruUw6ZhERKgS8hw +br5mTK2h21QepG8ZjQyfPIeNW1KhaSQTfbTUk7UmpDSKOZIWTk83VFHnr8c42Z0R +P5xgkJU7xS0zvvQISx/mbVvnkNi5RUpe9ozWF/XFLYdrCiXXCL6en7yRWhN/tW9K +WYSVPnxkeLBXMRlI/E060Cw7xwsi0bH67yfe7q+YlSK8WC7/xoGq5I2PHq//TtLS +SAFk5pyuhLFf9Z80TPjndkEKOivdybDt4nbcE/zWK8hw/zB3K4dsowblOiCZJpVB +A7eFNTPjb6GHWrRV75/tmjouCubUf3VO7Q== +=Gwl2 +-----END PGP MESSAGE----- diff --git a/mbsync/mbsyncrc b/mbsync/mbsyncrc new file mode 100644 index 0000000..60b64c3 --- /dev/null +++ b/mbsync/mbsyncrc @@ -0,0 +1,115 @@ +################################# +####### Account airocpss ####### +################################# + +IMAPAccount airocpss +Host imap.exmail.qq.com +User xinyz@airocpss.com +PassCmd "gpg -r xinyz --quiet -d ~/dotfiles/common/pass/airocpss.gpg.asc" +SSLType IMAPS +SSLVersions TLSv1.2 + +# Remote storage +IMAPStore airocpss-remote +Account airocpss + +# Local storage +MaildirStore airocpss-local +Path ~/Mail/airocpss/ +Inbox ~/Mail/airocpss/INBOX + +Channel airocpss-inbox +Master :airocpss-remote:"INBOX" +Slave :airocpss-local:INBOX +Create Both +Expunge Both + +Channel airocpss-sent +Master :airocpss-remote:"Sent Messages" +Slave :airocpss-local:sent +Create Both +Expunge Both + +Channel airocpss-junk +Master :airocpss-remote:"Junk" +Slave :airocpss-local:junk +Create Both +Expunge Both + +Channel airocpss-drafts +Master :airocpss-remote:"Drafts" +Slave :airocpss-local:drafts +Create Both +Expunge Both + +Channel airocpss-trash +Master :airocpss-remote:"Deleted Messages" +Slave :airocpss-local:trash +Create Both +Expunge Both + +Group airocpss +Channel airocpss-inbox +Channel airocpss-sent +Channel airocpss-junk +Channel airocpss-drafts +Channel airocpss-trash + + +################################# +######## Account hotmail ######## +################################# + +IMAPAccount hotmail +Host imap-mail.outlook.com +User yzxin@hotmail.com +PassCmd "gpg -r xinyz --quiet -d ~/dotfiles/common/pass/hotmail.gpg.asc" +SSLType IMAPS +SSLVersions TLSv1.2 + +# Remote storage +IMAPStore hotmail-remote +Account hotmail + +# Local storage +MaildirStore hotmail-local +Path ~/Mail/hotmail/ +Inbox ~/Mail/hotmail/INBOX + +Channel hotmail-inbox +Master :hotmail-remote:"Inbox" +Slave :hotmail-local:INBOX +Create Both +Expunge Both + +Channel hotmail-sent +Master :hotmail-remote:"Sent" +Slave :hotmail-local:sent +Create Both +Expunge Both + +Channel hotmail-junk +Master :hotmail-remote:"Junk" +Slave :hotmail-local:junk +Create Both +Expunge Both + +Channel hotmail-drafts +Master :hotmail-remote:"Drafts" +Slave :hotmail-local:drafts +Create Both +Expunge Both + +Channel hotmail-trash +Master :hotmail-remote:"Deleted" +Slave :hotmail-local:trash +Create Both +Expunge Both + +Group hotmail +Channel hotmail-inbox +Channel hotmail-sent +Channel hotmail-junk +Channel hotmail-drafts +Channel hotmail-trash + diff --git a/msmtp/msmtprc b/msmtp/msmtprc new file mode 100644 index 0000000..4d9f33f --- /dev/null +++ b/msmtp/msmtprc @@ -0,0 +1,28 @@ +defaults +tls on +tls_starttls off +auth on + +account airocpss +host smtp.exmail.qq.com +port 465 +protocol smtp +auth on +user xinyz@airocpss.com +passwordeval "gpg -r xinyz --quiet -d ~/dotfiles/common/pass/airocpss.gpg.asc" +from xinyz@airocpss.com +tls on +tls_starttls off + +account hotmail +host smtp.live.com +port 587 +protocol smtp +auth on +user yzxin@hotmail.com +passwordeval "gpg -r xinyz --quiet -d ~/dotfiles/common/pass/hotmail.gpg.asc" +from yzxin@hotmail.com +tls on +tls_starttls on +tls_certcheck off + diff --git a/mutt/accounts/airocpss b/mutt/accounts/airocpss new file mode 100644 index 0000000..52242b6 --- /dev/null +++ b/mutt/accounts/airocpss @@ -0,0 +1,22 @@ +set from = "xinyz@airocpss.com" +set sendmail = "/usr/local/bin/msmtp -a airocpss" + +# Set folders +set spoolfile = "+airocpss/INBOX" +set postponed = "+airocpss/drafts" +set record = "+airocpss/sent" +set trash = "+airocpss/trash" + +color status cyan default + +macro index o "mbsync airocpss" "run mbsync to sync mail for this account" + +macro index,pager s \ + "set my_old_resolve=\$resolve noresolve\ + nset resolve=\$my_old_resolve\ + +airocpss/junk" \ + "mark as read and move to junk folder" + +macro index,pager i \ + "+airocpss/INBOX" \ + "move message to the inbox" diff --git a/mutt/accounts/hotmail b/mutt/accounts/hotmail new file mode 100644 index 0000000..504a4ed --- /dev/null +++ b/mutt/accounts/hotmail @@ -0,0 +1,23 @@ +set from = "yzxin@hotmail.com" +set sendmail = "/usr/local/bin/msmtp -a hotmail" + +# Set folders +set spoolfile = "+hotmail/INBOX" +set postponed = "+hotmail/drafts" +set record = "+hotmail/sent" +set trash = "+hotmail/trash" + +color status cyan default + +macro index o "mbsync hotmail" "run mbsync to sync mail for this account" + +macro index,pager s \ + "set my_old_resolve=\$resolve noresolve\ + nset resolve=\$my_old_resolve\ + +hotmail/junk" \ + "mark as read and move to junk folder" + +macro index,pager i \ + "+hotmail/INBOX" \ + "move message to the inbox" + diff --git a/mutt/bindings b/mutt/bindings new file mode 100644 index 0000000..8de4d86 --- /dev/null +++ b/mutt/bindings @@ -0,0 +1,40 @@ +# some sane vim-like keybindings +bind index,pager k previous-entry +bind index,pager j next-entry +bind index,pager g noop +bind index,pager \Cu half-up +bind index,pager \Cd half-down +bind pager gg top +bind index gg first-entry +bind pager G bottom +bind index G last-entry + +# Sidebar Navigation +bind index,pager sidebar-next +bind index,pager sidebar-prev +bind index,pager sidebar-open + +# index and pager shortcuts +bind index,pager @ compose-to-sender +bind index,pager R group-reply +bind index sync-mailbox +bind index collapse-thread +# Save all attachments +macro index,pager S "ripmime -i - -d ~/Downloads && rm ~/Downloads/textfile*" "Save all non-text attachments using ripmime" +# opening urls with urlscan +macro index,pager \cb "urlscan" "call urlscan to extract URLs out of a message" +# Sync all email +macro index,pager O "mbsync -a" "run mbsync to sync all mail" + +# View attachments properly. +bind attach view-mailcap + +# Drafts +bind compose P postpone-message +bind index p recall-message + +# finding stuff +bind editor complete-query +macro index F "mu find --clearlinks --format=links --linksdir=~/.mu/results " "mu find" +macro index \cf "~/.mu/results" "mu find results" + diff --git a/mutt/cache/bodies/.gitignore b/mutt/cache/bodies/.gitignore new file mode 100644 index 0000000..a5baada --- /dev/null +++ b/mutt/cache/bodies/.gitignore @@ -0,0 +1,3 @@ +* +!.gitignore + diff --git a/mutt/cache/headers/.gitignore b/mutt/cache/headers/.gitignore new file mode 100644 index 0000000..a5baada --- /dev/null +++ b/mutt/cache/headers/.gitignore @@ -0,0 +1,3 @@ +* +!.gitignore + diff --git a/mutt/colors b/mutt/colors new file mode 100644 index 0000000..5e1b06a --- /dev/null +++ b/mutt/colors @@ -0,0 +1,46 @@ +# basic colors --------------------------------------------------------- +color normal white default +color error red default +color tilde black default +color message cyan default +color markers red white +color attachment white default +color search brightmagenta default +color indicator brightblack yellow +color tree green default + +# sidebarh +color sidebar_new default blue + +# index ---------------------------------------------------------------- + +color index red default "~A" # all messages +color index brightred default "~E" # expired messages +color index white blue "~N" # new messages +color index blue default "~O" # old messages +color index brightmagenta default "~Q" # messages that have been replied to +color index brightwhite default "~R" # read messages +color index white blue "~U" # unread messages +color index brightyellow default "~v" # messages part of a collapsed thread +color index brightyellow default "~P" # messages from me +color index red default "~F" # flagged messages +color index black red "~D" # deleted messages + +# message headers ------------------------------------------------------ + +color hdrdefault brightgreen default +color header brightyellow default "^(From)" +color header blue default "^(Subject)" + +# body ----------------------------------------------------------------- + +color quoted blue default +color quoted1 cyan default +color quoted2 yellow default +color quoted3 red default +color quoted4 brightred default + +color signature brightblack default +color bold black default +color underline black default +color normal default default diff --git a/mutt/mailcap b/mutt/mailcap new file mode 100644 index 0000000..9032dde --- /dev/null +++ b/mutt/mailcap @@ -0,0 +1,21 @@ +# MS Word documents +application/msword; ~/dotfiles/office/view-attachment.sh %s "-" '/Applications/LibreOffice.app' +application/vnd.ms-excel; ~/dotfiles/office/view-attachment.sh %s "-" '/Applications/LibreOffice.app' +application/vnd.openxmlformats-officedocument.presentationml.presentation; ~/dotfiles/office/view-attachment.sh %s "-" '/Applications/LibreOffice.app' +application/vnd.oasis.opendocument.text; ~/dotfiles/office/view-attachment.sh %s "-" '/Applications/LibreOffice.app' + +# Images +image/jpg; ~/dotfiles/office/quicklook.sh %s jpg +image/jpeg; ~/dotfiles/office/quicklook.sh %s jpg +image/pjpeg; ~/dotfiles/office/quicklook.sh %s jpg +image/png; ~/dotfiles/office/quicklook.sh %s png +image/gif; ~/dotfiles/office/quicklook.sh %s gif +video/mp4; ~/dotfiles/office/quicklook.sh %s mp4 +application/pdf; ~/dotfiles/office/quicklook.sh %s pdf + +# HTML +text/html; w3m -I %{charset} -T text/html; copiousoutput; +text/plain; vim %s + +# Unidentified files +application/octet-stream; ~/dotfiles/office/view-attachment.sh %s "-" diff --git a/mutt/muttrc b/mutt/muttrc new file mode 100644 index 0000000..78a5f29 --- /dev/null +++ b/mutt/muttrc @@ -0,0 +1,103 @@ +# paths +set folder = ~/Mail +set header_cache = ~/.mutt/cache/headers +set message_cachedir = ~/.mutt/cache/bodies +set certificate_file = ~/.mutt/cache/certificates.crt +set mailcap_path = ~/.mutt/mailcap +set tmpdir = ~/.mutt/tmp + +# basic options +set wait_key = no +set mbox_type = Maildir +set timeout = 3 +set mail_check = 0 +set delete +set quit +set thorough_search +set mail_check_stats +unset confirmappend +unset move +unset mark_old +unset beep_new + +# compose View Options +set envelope_from # which from? +set edit_headers # show headers when composing +set fast_reply # skip to compose when replying +set askcc # ask for CC: +set fcc_attach # save attachments with the body +set forward_format = "Fwd: %s" # format of subject when forwarding +set forward_decode # decode when forwarding +set attribution = "On %d, %n wrote:" # format of quoting header +set reply_to # reply to Reply to: field +set reverse_name # reply as whomever it was to +set include # include message in replies +set forward_quote # include message in forwards +set editor = "vim" +set text_flowed +unset sig_dashes # no dashes before sig +unset mime_forward # forward attachments as part of body + +# status bar, date format, finding stuff etc. +set status_chars = " *%A" +set status_format = "[ Folder: %f ] [%r%m messages%?n? (%n new)?%?d? (%d to delete)?%?t? (%t tagged)? ]%>─%?p?( %p postponed )?" +set date_format = "%d.%m.%Y %H:%M" +set index_format = "[%Z] %?X?A&-? %D %-20.20F %s" +set sort = threads +set sort_aux = reverse-last-date-received +set uncollapse_jump +set sort_re +set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*" +set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+" +set send_charset = "utf-8:iso-8859-1:us-ascii" +set charset = "utf-8" + +# Pager View Options +set pager_index_lines = 10 +set pager_context = 3 +set pager_stop +set menu_scroll +set tilde +unset markers + +# email headers and attachments +ignore * +unignore from: to: cc: bcc: date: subject: +unhdr_order * +hdr_order from: to: cc: bcc: date: subject: +alternative_order text/plain text/enriched text/html +auto_view text/html + +# sidebar patch config +set sidebar_visible +set sidebar_short_path +set sidebar_folder_indent +set sidebar_width = 25 +set sidebar_divider_char = ' | ' +set sidebar_indent_string = ' '' +set sidebar_format = "%B %* [%?N?%N / ?%S]" + +# Mailboxes to show in the sidebar. +# mailboxes =airocpss +named-mailboxes airoccpss-INBOX =airocpss/INBOX +mailboxes =airocpss/sent =airocpss/drafts =airocpss/junk =airocpss/trash +named-mailboxes hotmail-INBOX =hotmail/INBOX +mailboxes =hotmail/sent =hotmail/drafts =hotmail/junk =hotmail/trash + +# source colors and keybindings +# keeping those in one place makes it easier for my brain +source ~/.mutt/colors +source ~/.mutt/bindings + +# And finally the account config for multiple accounts +############################################################# + +# by default, use airocpss +set realname = "xinyz" +set spoolfile = "+airocpss/INBOX" +source ~/.mutt/accounts/airocpss + +# when changing into other mailboxes, use different adresses etc. +folder-hook airocpss/* source ~/.mutt/accounts/airocpss +folder-hook hotmail/* source ~/.mutt/accounts/hotmail + diff --git a/mutt/tmp/.gitignore b/mutt/tmp/.gitignore new file mode 100644 index 0000000..a5baada --- /dev/null +++ b/mutt/tmp/.gitignore @@ -0,0 +1,3 @@ +* +!.gitignore +