Browse Source

Merge branch 'master' into luke

pull/170/head
otlin100 5 years ago
committed by GitHub
parent
commit
c61a618f8a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions
  1. +3
    -2
      bin/mailsync
  2. +4
    -1
      bin/mw

+ 3
- 2
bin/mailsync View File

@@ -14,14 +14,15 @@ else
notify() { notify-send "mutt-wizard" "📬 $2 new mail(s) in \`$1\` account." ;}
fi

echo " 🔃" > /tmp/imapsyncicon
echo " 🔃" > /tmp/imapsyncicon_$USER
pkill -RTMIN+12 i3blocks

# Run mbsync. You can feed this script different settings.
accounts=$(ls "$HOME/.local/share/mail" | grep """$@")
echo "$accounts" | xargs --max-procs=4 -n 1 -I account mbsync -V account

rm -f /tmp/imapsyncicon
rm -f /tmp/imapsyncicon_$USER

pkill -RTMIN+12 i3blocks

# Check all accounts/mailboxes for new mail. Notify if there is new content.


+ 4
- 1
bin/mw View File

@@ -58,6 +58,7 @@ Slave :$title-local:
Patterns * !\"[Gmail]/All Mail\"
Create Both
SyncState *
MaxMessages $maxmes
# End profile
"

@@ -136,7 +137,7 @@ askinfo() { \
IFS=, read -r service imap iport smtp sport <<EOF
$serverinfo
EOF
printf "\\n\033[3;33mCongrats!\033[0m Server info has automatically be found, so you won't have to look anything up!\\n\t\033[1mIMAP server\033[0m: %s\\n\t\033[1mIMAP port\033[0m: %s\\n\t\033[1mSMTP server\033[0m: %s\\n\t\033[1mSMTP port\033[0m: %s\\nThis data will be used by the wizard.\\n" "$imap" "$iport" "$smtp" "$sport"
printf "\\n\033[3;33mCongrats!\033[0m Server info has automatically been found, so you won't have to look anything up!\\n\t\033[1mIMAP server\033[0m: %s\\n\t\033[1mIMAP port\033[0m: %s\\n\t\033[1mSMTP server\033[0m: %s\\n\t\033[1mSMTP port\033[0m: %s\\nThis data will be used by the wizard.\\n" "$imap" "$iport" "$smtp" "$sport"
case "$service" in
gmail.com) printf "\033[31mREMEMBER: Gmail users must enable \"less secure\" (third-party) applications first for the sync to work:\\nhttps://support.google.com/accounts/answer/6010255\\n\033[0m" ;;
protonmail.*) printf "\033[31mREMEMBER: Protonmail users must install and configure Protonmail Bridge first for the sync to work:\\nhttps://protonmail.com/bridge/\\n\033[0m" && ssltype="None" ;;
@@ -155,6 +156,8 @@ EOF
read -r login
printf "\033[0m"
[ -z "$login" ] && login="$fulladdr"
[ "$accounttype" = "offline" ] && printf "If you want to limit the number of messages kept offline to a number, enter that number below. If you do not want to limit your mail and would like \`mbsync\` to sync all mail, press enter without typing a number.\\n\t" && read -r maxmes
echo "$maxmes" | grep "[1-9]" >/dev/null || maxmes="0"
getpass
getprofiles
mkdir -p "$muttdir" "$accdir" "$cachedir/$title/bodies" "$HOME/.config/msmtp"


Loading…
Cancel
Save