7 Commits

Author SHA1 Message Date
  Luke Smith 26a6a1190a
Merge pull request #852 from f380cedric/fix/case-insensitive-fs 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 1 year ago
5 changed files with 12 additions and 47 deletions
Split View
  1. +2
    -12
      README.md
  2. +5
    -10
      bin/mailsync
  3. +4
    -15
      bin/mw
  4. +1
    -7
      mw.1
  5. +0
    -3
      share/domains.csv

+ 2
- 12
README.md View File

@@ -99,11 +99,10 @@ The mutt-wizard runs via the command `mw`. Once setup is complete, you'll use

#### General Settings

- `-p` -- Add a Protonmail account.
- `-f` -- Assume mailbox names and force account configuration without
connecting online at all.
- `-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

@@ -168,7 +167,7 @@ To give you an example of the interface, here's an idea:
errors generally.
- Addition of a manual `man mw`
- 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!

@@ -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
circumvent that. You might also need to manually "Enable IMAP" in the
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
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.


+ 5
- 10
bin/mailsync View File

@@ -56,12 +56,8 @@ syncandnotify() {
acc="$(echo "$account" | sed "s/.*\///")"
if [ -z "$opts" ]; then mbsync "$acc"; else mbsync "$opts" "$acc"; fi
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)
newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l)
case 1 in
@@ -70,14 +66,13 @@ syncandnotify() {
}

# 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
[ "${arg%${arg#?}}" = '-' ] && opts="${opts:+${opts} }${arg}" && shift 1
done
accounts=$*
fi
[ -z "$accounts" ] && accounts="$(awk '/^Channel/ {print $2}' "$MBSYNCRC")"

# Parallelize multiple accounts
for account in $accounts; do
@@ -86,7 +81,7 @@ done

wait

notmuch new 2>/dev/null
notmuch new --quiet

#Create a touch file that indicates the time of the last run of mailsync
touch "$lastrun"

+ 4
- 15
bin/mw View File

@@ -262,7 +262,7 @@ togglecron() { cron="$(mktemp)"
sed -ibu /mailsync/d "$cron"; rm -f "$cron"bu
else
echo "Adding automatic mailsync every ${cronmin:-10} minutes..."
echo "*/${cronmin-10} * * * * $prefix/bin/mailsync" >> "$cron"
echo "*/${cronmin:-10} * * * * $prefix/bin/mailsync -q" >> "$cron"
fi &&
crontab "$cron"; rm -f "$cron" ;}

@@ -297,8 +297,7 @@ Options allowed with -a:
-s SMTP server address
-S SMTP server port
-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.
-o Configure address, but keep mail online.
-f Assume typical English mailboxes without attempting log-on.
@@ -333,7 +332,7 @@ reorder() {
' "$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 ;;
r) setact reorder || 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" ;;
m) setact add || exit 1 ; maxmes="$OPTARG" ;;
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 ;;
x) setact add || exit 1 ; password="$OPTARG" ;;
X) setact delete || exit 1 ; purge=True ;;
t) setact toggle || exit 1 ; cronmin="$OPTARG" ;;
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 ;;
esac done



+ 1
- 7
mw.1 View File

@@ -80,9 +80,6 @@ Create settings for an account to be used online only without mail syncing abili
.B -f
connection will still be attempted in setup to discover mailboxes.
.TP
.B -p
Add a Protonmail account. Protonmail Bridge must be installed and set up.
.TP
.B -X
When removing an email profile with either
.I -d
@@ -90,7 +87,7 @@ or
.I -D,
also delete the local mail (will not delete the mail on the server).
.TP
.B -P
.B -p
Use POP protocol instead of IMAP. Requires
.I mpop
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
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
.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
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


+ 0
- 3
share/domains.csv View File

@@ -217,7 +217,6 @@ parabolas.xyz,mail.parabolas.xyz,993,mail.parabolas.xyz,587
paranoici.org,mail.autistici.org,993,smtp.autistici.org,465
paranoid.email,imap.paranoid.email,993,smtp.paranoid.email,25
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.onet.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465
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
privacyrequired.com,mail.autistici.org,993,smtp.autistici.org,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
pwned.life,imap.nixnet.email,143,smtp.nixnet.email,587
qq.com,imap.qq.com,993,smtp.qq.com,587


Loading…
Cancel
Save