Author | SHA1 | Message | Date |
---|---|---|---|
Luke Smith |
26a6a1190a
|
Merge pull request #852 from f380cedric/fix/case-insensitive-fs
Fix: find & case-insensitive filesystem |
1 year ago |
Luke Smith | 47d4ec1825 | Merge branch 'wrigleyster-master' | 1 year ago |
Luke Smith | caf2681891 | remove bashism | 1 year ago |
Luke Smith | 9db5d1b4fc | Merge branch 'master' of https://github.com/wrigleyster/mutt-wizard into wrigleyster-master | 1 year ago |
Luke Smith | ef5bac2b55 | remove Protonmail support. POP server now -p | 1 year ago |
jw |
367c10ec3f
|
Silence mailsync, so cron doesn't spam e-mails on every update | 1 year ago |
f380cedric | 3a2f4a55fa |
Fix: find & case-insensitive filesystem
On case-insensitive filesystem, `inbox` and `Inbox` are the same path. Running `find Inbox inbox [expr]` will print twice the same information. Use shell glob instead: `find` will descend into path `inbox`, ignoring letter cases, only once. Fix #828. |
1 year ago |
@@ -99,11 +99,10 @@ The mutt-wizard runs via the command `mw`. Once setup is complete, you'll use | |||||
#### General Settings | #### General Settings | ||||
- `-p` -- Add a Protonmail account. | |||||
- `-f` -- Assume mailbox names and force account configuration without | - `-f` -- Assume mailbox names and force account configuration without | ||||
connecting online at all. | connecting online at all. | ||||
- `-o` -- Configure mutt for an account, but do not keep mail offline. | - `-o` -- Configure mutt for an account, but do not keep mail offline. | ||||
- `-P` -- Use POP protocol instead of IMAP (requires `mpop` installed). | |||||
- `-p` -- Use POP protocol instead of IMAP (requires `mpop` installed). | |||||
## Neomutt user interface | ## Neomutt user interface | ||||
@@ -168,7 +167,7 @@ To give you an example of the interface, here's an idea: | |||||
errors generally. | errors generally. | ||||
- Addition of a manual `man mw` | - Addition of a manual `man mw` | ||||
- Now handles POP protocol via `mpop` for those who prefer it (add an account | - Now handles POP protocol via `mpop` for those who prefer it (add an account | ||||
with the `-P` option). POP configs are still generated automatically. | |||||
with the `-p` option). POP configs are still generated automatically. | |||||
## Help the Project! | ## Help the Project! | ||||
@@ -205,15 +204,6 @@ See Luke's website [here](https://lukesmith.xyz). Email him at | |||||
applications requires turning off two-factor authentication and this will | applications requires turning off two-factor authentication and this will | ||||
circumvent that. You might also need to manually "Enable IMAP" in the | circumvent that. You might also need to manually "Enable IMAP" in the | ||||
settings. | settings. | ||||
- Protonmail accounts require a "Protonmail Bridge" to access | |||||
PM's IMAP and SMTP servers. Configure that before running mutt-wizard. Note | |||||
that when mutt-wizard asks for a password, you should put in your | |||||
[bridge password](https://protonmail.com/bridge/thunderbird#3), not your | |||||
account password. | |||||
- Protonmail bridge is prone to timing out. Watch out for this while adding an | |||||
account. If the bridge times out, try again. It might help to | |||||
[increase the timeout](https://protonmail.com/support/knowledge-base/thunderbird-connection-server-timed-error/) | |||||
in your `mbsyncrc`. | |||||
- If you have a university email or enterprise-hosted email for work, there | - If you have a university email or enterprise-hosted email for work, there | ||||
might be other hurdles or two-factor authentication you have to jump through. | might be other hurdles or two-factor authentication you have to jump through. | ||||
Some, for example, will want you to create a separate IMAP password, etc. | Some, for example, will want you to create a separate IMAP password, etc. | ||||
@@ -56,12 +56,8 @@ syncandnotify() { | |||||
acc="$(echo "$account" | sed "s/.*\///")" | acc="$(echo "$account" | sed "s/.*\///")" | ||||
if [ -z "$opts" ]; then mbsync "$acc"; else mbsync "$opts" "$acc"; fi | if [ -z "$opts" ]; then mbsync "$acc"; else mbsync "$opts" "$acc"; fi | ||||
new=$(find\ | new=$(find\ | ||||
"$HOME/.local/share/mail/$acc/INBOX/new/"\ | |||||
"$HOME/.local/share/mail/$acc/Inbox/new/"\ | |||||
"$HOME/.local/share/mail/$acc/inbox/new/"\ | |||||
"$HOME/.local/share/mail/$acc/INBOX/cur/"\ | |||||
"$HOME/.local/share/mail/$acc/Inbox/cur/"\ | |||||
"$HOME/.local/share/mail/$acc/inbox/cur/"\ | |||||
"$HOME/.local/share/mail/$acc/"[Ii][Nn][Bb][Oo][Xx]/new/\ | |||||
"$HOME/.local/share/mail/$acc/"[Ii][Nn][Bb][Oo][Xx]/cur/\ | |||||
-type f -newer "$lastrun" 2> /dev/null) | -type f -newer "$lastrun" 2> /dev/null) | ||||
newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l) | newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l) | ||||
case 1 in | case 1 in | ||||
@@ -70,14 +66,13 @@ syncandnotify() { | |||||
} | } | ||||
# Sync accounts passed as argument or all. | # Sync accounts passed as argument or all. | ||||
if [ "$#" -eq "0" ]; then | |||||
accounts="$(awk '/^Channel/ {print $2}' "$MBSYNCRC")" | |||||
else | |||||
if [ "$#" -gt "0" ]; then | |||||
for arg in "$@"; do | for arg in "$@"; do | ||||
[ "${arg%${arg#?}}" = '-' ] && opts="${opts:+${opts} }${arg}" && shift 1 | [ "${arg%${arg#?}}" = '-' ] && opts="${opts:+${opts} }${arg}" && shift 1 | ||||
done | done | ||||
accounts=$* | accounts=$* | ||||
fi | fi | ||||
[ -z "$accounts" ] && accounts="$(awk '/^Channel/ {print $2}' "$MBSYNCRC")" | |||||
# Parallelize multiple accounts | # Parallelize multiple accounts | ||||
for account in $accounts; do | for account in $accounts; do | ||||
@@ -86,7 +81,7 @@ done | |||||
wait | wait | ||||
notmuch new 2>/dev/null | |||||
notmuch new --quiet | |||||
#Create a touch file that indicates the time of the last run of mailsync | #Create a touch file that indicates the time of the last run of mailsync | ||||
touch "$lastrun" | touch "$lastrun" |
@@ -262,7 +262,7 @@ togglecron() { cron="$(mktemp)" | |||||
sed -ibu /mailsync/d "$cron"; rm -f "$cron"bu | sed -ibu /mailsync/d "$cron"; rm -f "$cron"bu | ||||
else | else | ||||
echo "Adding automatic mailsync every ${cronmin:-10} minutes..." | echo "Adding automatic mailsync every ${cronmin:-10} minutes..." | ||||
echo "*/${cronmin-10} * * * * $prefix/bin/mailsync" >> "$cron" | |||||
echo "*/${cronmin:-10} * * * * $prefix/bin/mailsync -q" >> "$cron" | |||||
fi && | fi && | ||||
crontab "$cron"; rm -f "$cron" ;} | crontab "$cron"; rm -f "$cron" ;} | ||||
@@ -297,8 +297,7 @@ Options allowed with -a: | |||||
-s SMTP server address | -s SMTP server address | ||||
-S SMTP server port | -S SMTP server port | ||||
-x Password for account (recommended to be in double quotes) | -x Password for account (recommended to be in double quotes) | ||||
-p Install for a Protonmail account. | |||||
-P Add for a POP server instead of IMAP. | |||||
-p Add for a POP server instead of IMAP. | |||||
-X Delete an account's local email too when deleting. | -X Delete an account's local email too when deleting. | ||||
-o Configure address, but keep mail online. | -o Configure address, but keep mail online. | ||||
-f Assume typical English mailboxes without attempting log-on. | -f Assume typical English mailboxes without attempting log-on. | ||||
@@ -333,7 +332,7 @@ reorder() { | |||||
' "$tempfile" >> "$muttrc" | ' "$tempfile" >> "$muttrc" | ||||
} | } | ||||
while getopts "rfpPXlhodTYD:y:i:I:s:S:u:a:n:x:m:t:" o; do case "${o}" in | |||||
while getopts "rfpXlhodTYD:y:i:I:s:S:u:a:n:x:m:t:" o; do case "${o}" in | |||||
l) setact list || exit 1 ;; | l) setact list || exit 1 ;; | ||||
r) setact reorder || exit 1 ;; | r) setact reorder || exit 1 ;; | ||||
d) setact delete || exit 1 ;; | d) setact delete || exit 1 ;; | ||||
@@ -349,22 +348,12 @@ while getopts "rfpPXlhodTYD:y:i:I:s:S:u:a:n:x:m:t:" o; do case "${o}" in | |||||
n) setact add || exit 1 ; realname="$OPTARG" ;; | n) setact add || exit 1 ; realname="$OPTARG" ;; | ||||
m) setact add || exit 1 ; maxmes="$OPTARG" ;; | m) setact add || exit 1 ; maxmes="$OPTARG" ;; | ||||
o) setact add || exit 1 ; type="online" ;; | o) setact add || exit 1 ; type="online" ;; | ||||
P) setact add || exit 1 ; type="pop"; protocol="pop3s" ; iport="${iport:-995}" ;; | |||||
p) setact add || exit 1 ; type="pop"; protocol="pop3s" ; iport="${iport:-995}" ;; | |||||
f) setact add || exit 1 ; force=True ;; | f) setact add || exit 1 ; force=True ;; | ||||
x) setact add || exit 1 ; password="$OPTARG" ;; | x) setact add || exit 1 ; password="$OPTARG" ;; | ||||
X) setact delete || exit 1 ; purge=True ;; | X) setact delete || exit 1 ; purge=True ;; | ||||
t) setact toggle || exit 1 ; cronmin="$OPTARG" ;; | t) setact toggle || exit 1 ; cronmin="$OPTARG" ;; | ||||
T) setact toggle || exit 1 ;; | T) setact toggle || exit 1 ;; | ||||
p) echo "NOTE: Protonmail users must install and configure Protonmail Bridge first for the first sync to work." | |||||
protocol="imap" | |||||
imap="127.0.0.1" | |||||
iport="1143" | |||||
smtp="127.0.0.1" | |||||
sport="1025" | |||||
auth="login" | |||||
tlsline="tls_fingerprint $(msmtp --serverinfo --host=$smtp --port=$sport --tls --tls-certcheck=off | sed -n '/SHA256:/ s/^\s*SHA256:\s*// p')" | |||||
setact add || exit 1 | |||||
;; | |||||
*) mwinfo; exit 1 ;; | *) mwinfo; exit 1 ;; | ||||
esac done | esac done | ||||
@@ -80,9 +80,6 @@ Create settings for an account to be used online only without mail syncing abili | |||||
.B -f | .B -f | ||||
connection will still be attempted in setup to discover mailboxes. | connection will still be attempted in setup to discover mailboxes. | ||||
.TP | .TP | ||||
.B -p | |||||
Add a Protonmail account. Protonmail Bridge must be installed and set up. | |||||
.TP | |||||
.B -X | .B -X | ||||
When removing an email profile with either | When removing an email profile with either | ||||
.I -d | .I -d | ||||
@@ -90,7 +87,7 @@ or | |||||
.I -D, | .I -D, | ||||
also delete the local mail (will not delete the mail on the server). | also delete the local mail (will not delete the mail on the server). | ||||
.TP | .TP | ||||
.B -P | |||||
.B -p | |||||
Use POP protocol instead of IMAP. Requires | Use POP protocol instead of IMAP. Requires | ||||
.I mpop | .I mpop | ||||
to download mail after configuration. Server details can still be given with the | to download mail after configuration. Server details can still be given with the | ||||
@@ -155,9 +152,6 @@ on mutt-wizard's Github <https://github.com/lukesmithxyz/mutt-wizard> or Gitlab | |||||
.B Gmail accounts | .B Gmail accounts | ||||
Google will require you to allow "less-secure" (third party) applications or remove two-factor authentication in order to access their IMAP servers to download your mail. If you use Gmail, be sure to handle this before running mutt-wizard <https://support.google.com/accounts/answer/6010255>. | Google will require you to allow "less-secure" (third party) applications or remove two-factor authentication in order to access their IMAP servers to download your mail. If you use Gmail, be sure to handle this before running mutt-wizard <https://support.google.com/accounts/answer/6010255>. | ||||
.TP | .TP | ||||
.B Protonmail accounts | |||||
Protonmail users must use the Protonmail Bridge <https://protonmail.com/bridge/> to access their IMAP and SMTP servers. This too should be configured before running mutt-wizard. | |||||
.TP | |||||
.B Enterprise and university accounts | .B Enterprise and university accounts | ||||
Many universities and businesses might host their domain's email via Google or another service. This often requires a special IMAP/SMTP-specific password that you must generate and use. Again, mutt-wizard can handle these systems, but only once they've been set up. | Many universities and businesses might host their domain's email via Google or another service. This often requires a special IMAP/SMTP-specific password that you must generate and use. Again, mutt-wizard can handle these systems, but only once they've been set up. | ||||
.TP | .TP | ||||
@@ -217,7 +217,6 @@ parabolas.xyz,mail.parabolas.xyz,993,mail.parabolas.xyz,587 | |||||
paranoici.org,mail.autistici.org,993,smtp.autistici.org,465 | paranoici.org,mail.autistici.org,993,smtp.autistici.org,465 | ||||
paranoid.email,imap.paranoid.email,993,smtp.paranoid.email,25 | paranoid.email,imap.paranoid.email,993,smtp.paranoid.email,25 | ||||
paranoid.network,imap.nixnet.email,143,smtp.nixnet.email,587 | paranoid.network,imap.nixnet.email,143,smtp.nixnet.email,587 | ||||
pm.me,127.0.0.1,1143,127.0.0.1,1025 | |||||
poczta.fm,poczta.interia.pl,993,poczta.interia.pl,465 | poczta.fm,poczta.interia.pl,993,poczta.interia.pl,465 | ||||
poczta.onet.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.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 | polimi.it,outlook.office365.com,993,smtp.office365.com,587 | ||||
@@ -227,8 +226,6 @@ posteo.*,posteo.de,993,posteo.de,587 | |||||
privacy.xyz,imap.nixnet.email,143,smtp.nixnet.email,587 | privacy.xyz,imap.nixnet.email,143,smtp.nixnet.email,587 | ||||
privacyrequired.com,mail.autistici.org,993,smtp.autistici.org,465 | privacyrequired.com,mail.autistici.org,993,smtp.autistici.org,465 | ||||
prokonto.pl,poczta.o2.pl,993,poczta.o2.pl,465 | prokonto.pl,poczta.o2.pl,993,poczta.o2.pl,465 | ||||
protonmail.ch,127.0.0.1,1143,127.0.0.1,1025 | |||||
protonmail.com,127.0.0.1,1143,127.0.0.1,1025 | |||||
purelymail.com,imap.purelymail.com,993,smtp.purelymail.com,465 | purelymail.com,imap.purelymail.com,993,smtp.purelymail.com,465 | ||||
pwned.life,imap.nixnet.email,143,smtp.nixnet.email,587 | pwned.life,imap.nixnet.email,143,smtp.nixnet.email,587 | ||||
qq.com,imap.qq.com,993,smtp.qq.com,587 | qq.com,imap.qq.com,993,smtp.qq.com,587 | ||||