Merge branch 'master' into patch-1

This commit is contained in:
luukvbaal 2019-05-30 16:54:38 +02:00 committed by GitHub
commit 70257daa83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 41 additions and 17 deletions

View File

@ -53,7 +53,7 @@ There's a chance of errors if you use a slow-release distro like Ubuntu, Debian
### Optional
- `w3m` - view HTML email and images in neomutt.
- `[notmuch](notmuch)` - index and search mail. Install it and run `notmuch setup`, tell it that your mail is in `~/.local/share/mail/` (although `mw` will do this automatically if you haven't set notmuch up before). You can run it in mutt with `ctrl-f`. Run `notmuch new` to process new mail, although the included `mailsync` script does this for you.
- `notmuch` - index and search mail. Install it and run `notmuch setup`, tell it that your mail is in `~/.local/share/mail/` (although `mw` will do this automatically if you haven't set notmuch up before). You can run it in mutt with `ctrl-f`. Run `notmuch new` to process new mail, although the included `mailsync` script does this for you.
- `libnotify`/`libnotify-bin` - allows notifications when syncthing mail with `mailsync`
- `abook` - a terminal-based address book. Pressing tab while typing an address to send mail to will suggest contacts that are in your abook.
- A cron manager - if you want to enable the auto-sync feature.

View File

@ -40,7 +40,7 @@ syncandnotify() {
fi
}
# Run
# Sync accounts passed as argument or all.
if [ "$#" -eq "0" ]; then
accounts="$(ls "$HOME/.local/share/mail")"
else

View File

@ -1,5 +1,11 @@
#!/bin/bash
height=$(stty size | awk 'BEGIN {FS = " "} {print $1;}')
width=$(stty size | awk 'BEGIN {FS = " "} {print $2;}')
#get image resolution
resolution=$(identify $1 | awk '{print $3}')
IFS='x' # x is set as delimiter
read -ra ADDR <<< "$resolution"
width=${ADDR[0]}
height=${ADDR[1]}
### Display Image / offset with mutt bar
echo -e "2;3;\n0;1;210;20;$((width*7-250));$((height*14-100));0;0;0;0;$1\n4;\n3;" | /usr/lib/w3m/w3mimgdisplay &
echo -e "2;3;\n0;1;0;42;$((width));$((height));0;0;0;0;$1\n4;\n3;" | /usr/lib/w3m/w3mimgdisplay &

20
bin/mw
View File

@ -1,13 +1,17 @@
#!/bin/sh
command -V gpg >/dev/null 2>&1 && GPG="gpg" || GPG="gpg2"
! "$GPG" --list-secret-keys $(cat "$HOME/.password-store/.gpg-id") >/dev/null 2>&1 && printf "\`pass\` must be installed and initialized to encrypt passwords.\\nBe sure it is installed and run \`pass init <yourgpgemail>\`.\\nIf you don't have a GPG public private key pair, run \`$GPG --full-gen-key\` first.\\n" && exit
[ -r "$HOME/.password-store/.gpg-id" ] &&
"$GPG" --list-secret-keys $(cat "$HOME/.password-store/.gpg-id") >/dev/null 2>&1 || {
printf "\`pass\` must be installed and initialized to encrypt passwords.\\nBe sure it is installed and run \`pass init <yourgpgemail>\`.\\nIf you don't have a GPG public private key pair, run \`$GPG --full-gen-key\` first.\\n"
exit
}
! command -v mbsync >/dev/null && printf "\`mbsync\` must be installed to run mutt-wizard.\\n" && exit
if [[ "$OSTYPE" == "darwin"* ]]; then
prefix="/usr/local"
else
prefix="/usr"
fi
case "$(uname)" in
Linux) prefix="/usr" ;;
*) prefix="/usr/local" ;;
esac
muttdir="$HOME/.config/mutt" # Main mutt config location
accdir="$muttdir/accounts" # Directory for account settings
maildir="$HOME/.local/share/mail" # Location of mail storage
@ -212,7 +216,7 @@ tryconnect() { mkdir -p "$maildir/$title"
fi ;}
finalize() { \
boxes="$(find "$maildir/$title/" -mindepth 1 -maxdepth 1 | sed "s/^.*\//=/")"
boxes="$(find "$maildir/$title/" -mindepth 1 -maxdepth 1 | sed "s/\ /\\\ /g;s/^.*\//=/")"
[ -z "$boxes" ] && printf "\033[31mNo local mailboxes have been detected for %s.\033[0m\\nThis means that mbsync has not been successfully run.\\nRun mbsync, and if it has an error, be sure to check your password and server settings manually if needbe.\\n" "$title" && return
printf "Setting default mailboxes for your Inbox, Sent, Drafts and Trash in mutt...\\n"
spoolfile=$(echo "$boxes" | grep -i -m 1 inbox | sed 's/=/+/g')
@ -309,6 +313,8 @@ synchronize_flags=true
gpg_path=$GPG"
echo "$nmbasic" > "$NOTMUCH_CONFIG" ;}
trap 'echo -e "\033[0m\n"' INT
case "$1" in
ls) list ;;
add) asktype && askinfo && tryconnect && finalize || delete ;;

View File

@ -1,9 +1,8 @@
#!/bin/sh
# Helps open a file with xdg-open from mutt in a external program without weird side effects.
[ $(uname) = "Darwin" ] && opener="open" || opener="setsid xdg-open"
base=$(basename "$1")
ext="${base##*.}"
file=$(mktemp -u --suffix=".$ext")
mkdir -p "/tmp/$USER-mutt-tmp"
file="/tmp/$USER-mutt-tmp/$(basename "$1")"
rm -f "$file"
cp "$1" "$file"
$opener "$file" >/dev/null 2>&1 &

View File

@ -7,6 +7,7 @@ activist.com,imap.mail.com,993,smtp.mail.com,587
adexec.com,imap.mail.com,993,smtp.mail.com,587
airmail.cc,mail.cock.li,993,mail.cock.li,587
allergist.com,imap.mail.com,993,smtp.mail.com,587
alumni.bits-pilani.ac.in,imap.gmail.com,993,smtp.gmail.com,465
alumni.com,imap.mail.com,993,smtp.mail.com,587
alumnidirector.com,imap.mail.com,993,smtp.mail.com,587
alunos.utfpr.edu.br,imap.gmail.com,993,smtp.gmail.com,587
@ -41,6 +42,8 @@ chemist.com,imap.mail.com,993,smtp.mail.com,587
chrissx.ga,chrissx.ga,993,chrissx.ga,25
clerk.com,imap.mail.com,993,smtp.mail.com,587
clubmember.org,imap.mail.com,993,smtp.mail.com,587
cmail.carleton.ca,imap-mail.outlook.com,993,smtp-mail.outlook.com,587
carleton.ca,imap-mail.outlook.com,993,smtp-mail.outlook.com,587
cocaine.ninja,mail.cock.li,993,mail.cock.li,587
cock.email,mail.cock.li,993,mail.cock.li,587
cock.li,mail.cock.li,993,mail.cock.li,587
@ -56,6 +59,7 @@ counsellor.com,imap.mail.com,993,smtp.mail.com,587
cryptolab.net,mail.autistici.org,993,smtp.autistici.org,465
cumallover.me,mail.cock.li,993,mail.cock.li,587
cyberservices.com,imap.mail.com,993,smtp.mail.com,587
datentopf.org,mail.datentopf.org,993,mail.datentopf.org,587
deliveryman.com,imap.mail.com,993,smtp.mail.com,587
dicksinhisan.us,mail.cock.li,993,mail.cock.li,587
dicksinmyan.us,mail.cock.li,993,mail.cock.li,587
@ -66,8 +70,10 @@ dr.com,imap.mail.com,993,smtp.mail.com,587
duke.edu,outlook.office365.com,993,smtp.office365.com,587
email.arizona.edu,imap.gmail.com,993,smtp.gmail.com,587
email.com,imap.mail.com,993,smtp.mail.com,587
eneco.com,outlook.office365.com,993,smtp.office365.com,587
engineer.com,imap.mail.com,993,smtp.mail.com,587
erciyes.edu.tr,posta.erciyes.edu.tr,993,smtp.erciyes.edu.tr,587
ethancoe.com,mail.privateemail.com,993,mail.privateemail.com,465
europe.com,imap.mail.com,993,smtp.mail.com,587
fastmail.com,imap.fastmail.com,993,smtp.fastmail.com,465
fastmail.fm,imap.fastmail.com,993,smtp.fastmail.com,465
@ -99,6 +105,7 @@ hotmail.fr,imap-mail.outlook.com,993,smtp-mail.outlook.com,587
hushmail.com,imap.hushmail.com,993,smtp.hushmail.com,465
illinois.edu, imap.gmail.com,993,smtp.gmail.com,465
iname.com,imap.mail.com,993,smtp.mail.com,587
inf.h-brs.de,imap.inf.h-brs.de,993,smtp.inf.h-brs.de,587
insiberia.net,mail.autistici.org,993,smtp.autistici.org,465
insicuri.net,mail.autistici.org,993,smtp.autistici.org,465
interia.eu,poczta.interia.pl,993,poczta.interia.pl,465
@ -113,7 +120,7 @@ live.com,imap-mail.outlook.com,993,smtp-mail.outlook.com,587
logorroici.org,mail.autistici.org,993,smtp.autistici.org,465
loves.dicksinhisan.us,mail.cock.li,993,mail.cock.li,587
loves.dicksinmyan.us,mail.cock.li,993,mail.cock.li,587
lukesmith.xyz,imap.yandex.com,993,smtp.yandex.com,587
lukesmith.xyz,mail.lukesmith.xyz,993,mail.lukesmith.xyz,587
mail.com,imap.mail.com,993,smtp.mail.com,587
mail.ru,imap.mail.ru,993,smtp.mail.ru,465
mailbox.org,imap.mailbox.org,993,smtps.mailbox.org,465
@ -134,7 +141,7 @@ one.com,imap.one.com,993,send.one.com,465
onenetbeyond.org,mail.autistici.org,993,smtp.autistici.org,465
onet.com.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465
onet.eu,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465
onet.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465
onet.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,587
online.de,imap.1und1.de,993,smtp.1und1.de,465
op.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465
opoczta.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465
@ -146,6 +153,8 @@ paranoici.org,mail.autistici.org,993,smtp.autistici.org,465
pm.me,127.0.0.1,1143,127.0.0.1,1025
poczta.fm,poczta.interia.pl,993,poczta.interia.pl,465
poczta.onet.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465
polimi.it,outlook.office365.com,993,smtp.office365.com,587
mail.polimi.it,outlook.office365.com,993,smtp.office365.com,587
post.com,imap.mail.com,993,smtp.mail.com,587
posteo.de,posteo.de,993,posteo.de,587
posteo.net,posteo.de,993,posteo.de,587
@ -158,11 +167,13 @@ redchan.it,mail.cock.li,993,mail.cock.li,587
runbox.com,mail.runbox.com,993,mail.runbox.com,587
rwth-aachen.de,mail.rwth-aachen.de,993,mail.rwth-aachen.de,587
sapo.pt,imap.sapo.pt,993,smtp.sapo.pt,587
smail.inf.h-brs.de,imap.inf.h-brs.de,993,smtp.inf.h-brs.de,587
southwales.ac.uk,imap.gmail.com,993,smtp.gmail.com,587
spoko.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465
stronzi.org,mail.autistici.org,993,smtp.autistici.org,465
stud.tu-darmstadt.de,imap.stud.tu-darmstadt.de,993,smtp.tu-darmstadt.de,465
stud.uis.no,outlook.office365.com,993,smtp.office365.com,587
student.rmit.edu.au,outlook.office365.com,993,smtp.office365.com,587
students.southwales.ac.uk,imap.gmail.com,993,smtp.gmail.com,587
studserv.uni-leipzig.de,studserv.uni-leipzig.de,993,studserv.uni-leipzig.de,25
subvertising.org,mail.autistici.org,993,smtp.autistici.org,465
@ -179,8 +190,10 @@ uach.mx,imap.gmail.com,993,smtp.gmail.com,587
uoregon.edu,imap.uoregon.edu,993,smtp.uoregon.edu,587
uqtr.ca,outlook.office365.com,993,smtp.office365.com,587
usa.com,imap.mail.com,993,smtp.mail.com,587
uw.edu,imap.gmail.com,993,smtp.gmail.com,465
uymail.com,imap.mail.com,993,smtp.mail.com,587
vip.onet.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465
vivaldi.net,imap.vivaldi.net,993,smtp.vivaldi.net,587
vp.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465
vt.edu,imap.gmail.com,993,smtp.gmail.com,587
waifu.club,mail.cock.li,993,mail.cock.li,587

1 ADDRESS IMAP imap port SMTP smtp port
7 adexec.com imap.mail.com 993 smtp.mail.com 587
8 airmail.cc mail.cock.li 993 mail.cock.li 587
9 allergist.com imap.mail.com 993 smtp.mail.com 587
10 alumni.bits-pilani.ac.in imap.gmail.com 993 smtp.gmail.com 465
11 alumni.com imap.mail.com 993 smtp.mail.com 587
12 alumnidirector.com imap.mail.com 993 smtp.mail.com 587
13 alunos.utfpr.edu.br imap.gmail.com 993 smtp.gmail.com 587
42 chrissx.ga chrissx.ga 993 chrissx.ga 25
43 clerk.com imap.mail.com 993 smtp.mail.com 587
44 clubmember.org imap.mail.com 993 smtp.mail.com 587
45 cmail.carleton.ca imap-mail.outlook.com 993 smtp-mail.outlook.com 587
46 carleton.ca imap-mail.outlook.com 993 smtp-mail.outlook.com 587
47 cocaine.ninja mail.cock.li 993 mail.cock.li 587
48 cock.email mail.cock.li 993 mail.cock.li 587
49 cock.li mail.cock.li 993 mail.cock.li 587
59 cryptolab.net mail.autistici.org 993 smtp.autistici.org 465
60 cumallover.me mail.cock.li 993 mail.cock.li 587
61 cyberservices.com imap.mail.com 993 smtp.mail.com 587
62 datentopf.org mail.datentopf.org 993 mail.datentopf.org 587
63 deliveryman.com imap.mail.com 993 smtp.mail.com 587
64 dicksinhisan.us mail.cock.li 993 mail.cock.li 587
65 dicksinmyan.us mail.cock.li 993 mail.cock.li 587
70 duke.edu outlook.office365.com 993 smtp.office365.com 587
71 email.arizona.edu imap.gmail.com 993 smtp.gmail.com 587
72 email.com imap.mail.com 993 smtp.mail.com 587
73 eneco.com outlook.office365.com 993 smtp.office365.com 587
74 engineer.com imap.mail.com 993 smtp.mail.com 587
75 erciyes.edu.tr posta.erciyes.edu.tr 993 smtp.erciyes.edu.tr 587
76 ethancoe.com mail.privateemail.com 993 mail.privateemail.com 465
77 europe.com imap.mail.com 993 smtp.mail.com 587
78 fastmail.com imap.fastmail.com 993 smtp.fastmail.com 465
79 fastmail.fm imap.fastmail.com 993 smtp.fastmail.com 465
105 hushmail.com imap.hushmail.com 993 smtp.hushmail.com 465
106 illinois.edu imap.gmail.com 993 smtp.gmail.com 465
107 iname.com imap.mail.com 993 smtp.mail.com 587
108 inf.h-brs.de imap.inf.h-brs.de 993 smtp.inf.h-brs.de 587
109 insiberia.net mail.autistici.org 993 smtp.autistici.org 465
110 insicuri.net mail.autistici.org 993 smtp.autistici.org 465
111 interia.eu poczta.interia.pl 993 poczta.interia.pl 465
120 logorroici.org mail.autistici.org 993 smtp.autistici.org 465
121 loves.dicksinhisan.us mail.cock.li 993 mail.cock.li 587
122 loves.dicksinmyan.us mail.cock.li 993 mail.cock.li 587
123 lukesmith.xyz imap.yandex.com mail.lukesmith.xyz 993 smtp.yandex.com mail.lukesmith.xyz 587
124 mail.com imap.mail.com 993 smtp.mail.com 587
125 mail.ru imap.mail.ru 993 smtp.mail.ru 465
126 mailbox.org imap.mailbox.org 993 smtps.mailbox.org 465
141 onenetbeyond.org mail.autistici.org 993 smtp.autistici.org 465
142 onet.com.pl imap.poczta.onet.pl 993 smtp.poczta.onet.pl 465
143 onet.eu imap.poczta.onet.pl 993 smtp.poczta.onet.pl 465
144 onet.pl imap.poczta.onet.pl 993 smtp.poczta.onet.pl 465 587
145 online.de imap.1und1.de 993 smtp.1und1.de 465
146 op.pl imap.poczta.onet.pl 993 smtp.poczta.onet.pl 465
147 opoczta.pl imap.poczta.onet.pl 993 smtp.poczta.onet.pl 465
153 pm.me 127.0.0.1 1143 127.0.0.1 1025
154 poczta.fm poczta.interia.pl 993 poczta.interia.pl 465
155 poczta.onet.pl imap.poczta.onet.pl 993 smtp.poczta.onet.pl 465
156 polimi.it outlook.office365.com 993 smtp.office365.com 587
157 mail.polimi.it outlook.office365.com 993 smtp.office365.com 587
158 post.com imap.mail.com 993 smtp.mail.com 587
159 posteo.de posteo.de 993 posteo.de 587
160 posteo.net posteo.de 993 posteo.de 587
167 runbox.com mail.runbox.com 993 mail.runbox.com 587
168 rwth-aachen.de mail.rwth-aachen.de 993 mail.rwth-aachen.de 587
169 sapo.pt imap.sapo.pt 993 smtp.sapo.pt 587
170 smail.inf.h-brs.de imap.inf.h-brs.de 993 smtp.inf.h-brs.de 587
171 southwales.ac.uk imap.gmail.com 993 smtp.gmail.com 587
172 spoko.pl imap.poczta.onet.pl 993 smtp.poczta.onet.pl 465
173 stronzi.org mail.autistici.org 993 smtp.autistici.org 465
174 stud.tu-darmstadt.de imap.stud.tu-darmstadt.de 993 smtp.tu-darmstadt.de 465
175 stud.uis.no outlook.office365.com 993 smtp.office365.com 587
176 student.rmit.edu.au outlook.office365.com 993 smtp.office365.com 587
177 students.southwales.ac.uk imap.gmail.com 993 smtp.gmail.com 587
178 studserv.uni-leipzig.de studserv.uni-leipzig.de 993 studserv.uni-leipzig.de 25
179 subvertising.org mail.autistici.org 993 smtp.autistici.org 465
190 uoregon.edu imap.uoregon.edu 993 smtp.uoregon.edu 587
191 uqtr.ca outlook.office365.com 993 smtp.office365.com 587
192 usa.com imap.mail.com 993 smtp.mail.com 587
193 uw.edu imap.gmail.com 993 smtp.gmail.com 465
194 uymail.com imap.mail.com 993 smtp.mail.com 587
195 vip.onet.pl imap.poczta.onet.pl 993 smtp.poczta.onet.pl 465
196 vivaldi.net imap.vivaldi.net 993 smtp.vivaldi.net 587
197 vp.pl imap.poczta.onet.pl 993 smtp.poczta.onet.pl 465
198 vt.edu imap.gmail.com 993 smtp.gmail.com 587
199 waifu.club mail.cock.li 993 mail.cock.li 587