Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

401 wiersze
18 KiB

  1. #!/bin/sh
  2. command -V gpg >/dev/null 2>&1 && GPG="gpg" || GPG="gpg2"
  3. [ -z ${PASSWORD_STORE_DIR+x} ] && PASSWORD_STORE_DIR="$HOME/.password-store"
  4. [ -r "$PASSWORD_STORE_DIR/.gpg-id" ] &&
  5. "$GPG" --list-secret-keys $(cat "$PASSWORD_STORE_DIR/.gpg-id") >/dev/null 2>&1 || {
  6. 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 \`%s --full-gen-key\` first.\\n" "$GPG"
  7. exit
  8. }
  9. ! command -v mbsync >/dev/null && printf "\`mbsync (isync package)\` must be installed to run mutt-wizard.\\n" && exit
  10. prefix="/usr/local"
  11. muttdir="$HOME/.config/mutt" # Main mutt config location
  12. accdir="$muttdir/accounts" # Directory for account settings
  13. maildir="$HOME/.local/share/mail" # Location of mail storage
  14. namere="^[a-z_][a-z0-9_-]*$" # Regex to ensure viable username
  15. emailre=".\+@.\+\\..\+" # Regex to confirm valid email address
  16. muttshare="$prefix/share/mutt-wizard"
  17. mbsyncrc="$HOME/.mbsyncrc"
  18. mwconfig="$muttshare/mutt-wizard.muttrc"
  19. cachedir="$HOME/.cache/mutt-wizard"
  20. muttrc="$muttdir/muttrc"
  21. msmtprc="$HOME/.config/msmtp/config"
  22. issl="IMAPS" # IMAP SSL setting (IMAPS/STARTTLS/None)
  23. # Changed to 'None' for Protonmail Bridge
  24. sssl="STARTTLS" # SMTP SSL setting (SMTPS/STARTTLS/None)
  25. sauth="plain" # SMTP auth method
  26. # Set because msmtp only uses the most common 'plain' method without TLS if it is explicitly set
  27. for x in "/etc/ssl/certs/ca-certificates.crt" "/etc/pki/tls/certs/ca-bundle.crt" "/etc/ssl/ca-bundle.pem" "/etc/pki/tls/cacert.pem" "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem" "/etc/ssl/cert.pem" "/usr/local/share/ca-certificates/"
  28. do
  29. [ -f "$x" ] && sslcert="$x" && break
  30. done || { echo "CA Certificate not found. Please install one or link it to /etc/ssl/certs/ca-certificates.crt" && exit 1 ;}
  31. getaccounts() { accounts="$(find "$accdir" -type f | grep -o "[0-9]-.*.muttrc" | sed "s/-/: /;s/\..*//" | sort -n)" ;}
  32. list() { getaccounts && [ -n "$accounts" ] && echo "$accounts" ;}
  33. getprofiles() { \
  34. unset msmtp_header msmtp_profile mutt_profile mbsync_profile
  35. printf "Creating profiles for \`%s\`..." "$title"
  36. msmtp_header="defaults
  37. auth on
  38. tls on
  39. tls_trust_file $sslcert
  40. logfile ~/.config/msmtp/msmtp.log
  41. "
  42. msmtp_profile="account $title
  43. host $smtp
  44. port $sport
  45. from $fulladdr
  46. user $login
  47. passwordeval \"pass mutt-wizard-$title\"
  48. tls $([ "$sssl" = "None" ] && echo off || echo on)
  49. tls_starttls $([ "$sssl" = "STARTTLS" ] && echo on || echo off)
  50. $([ "$sssl" = "None" ] && echo auth ${sauth:-plain})
  51. "
  52. mbsync_profile="IMAPStore $title-remote
  53. Host $imap
  54. Port $iport
  55. User $login
  56. PassCmd \"pass mutt-wizard-$title\"
  57. AuthMechs LOGIN
  58. SSLType $issl
  59. CertificateFile $sslcert
  60. MaildirStore $title-local
  61. Subfolders Verbatim
  62. Path ~/.local/share/mail/$title/
  63. Inbox ~/.local/share/mail/$title/INBOX
  64. Flatten .
  65. Channel $title
  66. Expunge Both
  67. Master :$title-remote:
  68. Slave :$title-local:
  69. Patterns * !\"[Gmail]/All Mail\"
  70. Create Both
  71. SyncState *
  72. MaxMessages $maxmes
  73. ExpireUnread no
  74. # End profile
  75. "
  76. if [ "$accounttype" = "offline" ]; then
  77. mutt_profile="# vim: filetype=neomuttrc
  78. # muttrc file for account $title
  79. set realname = \"$realname\"
  80. set from = \"$fulladdr\"
  81. set sendmail = \"msmtp -a $title\"
  82. alias me $realname <$fulladdr>
  83. set folder = \"$maildir/$title\"
  84. set header_cache = $cachedir/$title/headers
  85. set message_cachedir = $cachedir/$title/bodies
  86. set mbox_type = Maildir
  87. set crypt_autosign = yes
  88. set crypt_opportunistic_encrypt = yes
  89. set pgp_self_encrypt = yes
  90. set pgp_default_key = $keyid
  91. bind index,pager gg noop
  92. bind index,pager g noop
  93. bind index,pager M noop
  94. bind index,pager C noop
  95. bind index gg first-entry
  96. macro index o \"<shell-escape>mailsync -V $title<enter>\" \"run mbsync to sync $title\"
  97. unmailboxes *
  98. "
  99. else
  100. mutt_profile="# vim: filetype=neomuttrc
  101. # muttrc file for account $title
  102. set realname = \"$realname\"
  103. set from = \"$fulladdr\"
  104. set sendmail = \"msmtp -a $title\"
  105. alias me $realname <$fulladdr>
  106. set folder = \"$([ "$issl" = "None" ] && echo imap || echo imaps)://$login@$imap:$iport\"
  107. set imap_user = \"$login\"
  108. set header_cache = $cachedir/$title/headers
  109. set message_cachedir = $cachedir/$title/bodies
  110. set imap_pass = \"\`pass mutt-wizard-$title\`\"
  111. set crypt_autosign = yes
  112. set crypt_opportunistic_encrypt = yes
  113. set pgp_self_encrypt = yes
  114. set pgp_default_key = $keyid
  115. set mbox_type = Maildir
  116. set ssl_starttls = $([ "$sssl" = "STARTTLS" ] && echo yes || echo no)
  117. set ssl_force_tls = $([ "$sssl" = "SMTPS" ] && echo yes || echo no)
  118. bind index,pager gg noop
  119. bind index,pager g noop
  120. bind index,pager M noop
  121. bind index,pager C noop
  122. bind index gg first-entry
  123. unmailboxes *
  124. "
  125. fi
  126. printf "DONE.\\n"
  127. }
  128. askinfo() { \
  129. printf "Insert the \033[31memail address\033[0m that you want to autoconfigure for mutt/mbsync\\n\tEmail: \033[36m"
  130. read -r fulladdr
  131. keyid=$("$GPG" --list-keys --with-colons "$fulladdr" | awk -F: '/^pub:/ { print $5 }')
  132. printf "\033[0m"
  133. while ! echo "$fulladdr" | grep "$emailre" >/dev/null; do
  134. printf "That is not a valid \033[31memail address\033[0m, please retype the desired email.\\n\\nEmail: \033[36m\t"
  135. read -r fulladdr
  136. printf "\033[0m"
  137. done
  138. domain="$(echo "$fulladdr" | sed "s/.*@//")"
  139. search_query=$domain
  140. case "$domain" in
  141. protonmail.com|protonmail.ch|pm.me)
  142. search_query='protonmail.com' ;;
  143. *)
  144. while : ; do
  145. printf "\nIs your email hosted with Protonmail? [yes/no] "
  146. read -r is_protonmail
  147. case $is_protonmail in
  148. [Yy][Ee][Ss]) search_query='protonmail.com' && break;;
  149. [Nn][Oo]) break;;
  150. *) printf 'Please answer Yes or No'
  151. esac; done;
  152. esac
  153. printf "\\nSearching for \033[32m%s\033[0m in \033[34m\`domains.csv\`\033[0m..." "$domain"
  154. serverinfo="$(grep "^$search_query" "$muttshare/domains.csv" 2>/dev/null)"
  155. if [ -z "$serverinfo" ]; then
  156. printf "Your email domain is not in mutt-wizard's database yet.\\nmutt-wizard will still autoconfigure everything, but you will have to manually type in your service's IMAP and SMTP server information.\\nYou can usually quickly find this by internet searching for it.\\n"
  157. printf "Insert the IMAP server for your email provider (excluding the port number)\\n\033[36m\t"
  158. read -r imap
  159. printf "\033[0mWhat is your server's IMAP port number? (default: 993)\\n\033[36m\t"
  160. read -r iport
  161. iport="${iport:-993}"
  162. while : ; do
  163. printf "\033[0mWhich encryption method to use for IMAP? [None/STARTTLS/IMAPS] (default: IMAPS)\\n\033[36m\t"
  164. read -r issl
  165. issl="${issl:-IMAPS}"
  166. case "$issl" in
  167. [Nn][oO][nN][eE]) issl="None" && break;;
  168. [Ss][Tt][Aa][Rr][Tt][Tt][Ll][Ss]) issl="STARTTLS" && break;;
  169. [Ii][Mm][Aa][Pp][Ss]) issl="IMAPS" && break;;
  170. *) printf 'Please answer None, STARTTLS or IMAPS';;
  171. esac
  172. done
  173. printf "\033[0mInsert the SMTP server for your email provider (excluding the port number)\\n\033[36m\t"
  174. read -r smtp
  175. printf "\033[0mWhat is your server's SMTP port number? (default: 587, 465 also common)\\n\033[36m\t"
  176. read -r sport
  177. sport="${sport:-587}"
  178. [ "$sport" = 465 ] && sssl_default="SMTPS" || sssl_default="STARTTLS"
  179. while : ; do
  180. printf "\033[0mWhich encryption method to use for SMTP? [None/STARTTLS/SMTPS] (default: %s)\\n\033[36m\t" "$sssl_default"
  181. read -r sssl
  182. sssl="${sssl:-$sssl_default}"
  183. case "$sssl" in
  184. [Nn][oO][nN][eE]) sssl="None" && break;;
  185. [Ss][Tt][Aa][Rr][Tt][Tt][Ll][Ss]) sssl="STARTTLS" && break;;
  186. [Ss][Mm][Tt][Pp][Ss]) sssl="SMTPS" && break;;
  187. *) printf 'Please answer None, STARTTLS or SMTPS';;
  188. esac
  189. done
  190. printf "\033[0m\\nGreat! If you want to be helpful, copy the line below and you can add it to the \`domains.csv\` file on Github.\\nThis will make things easier for others who use your email provider.\\n\\n%s,%s,%s,%s,%s\\n\\nAlthough be sure to test to see if these settings work first! ;-)\\n" "$domain" "$imap" "$iport" "$smtp" "$sport"
  191. else
  192. IFS=, read -r service imap iport smtp sport <<EOF
  193. $serverinfo
  194. EOF
  195. 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"
  196. case "$service" in
  197. 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" ;;
  198. protonmail.ch|protonmail.com|pm.me) printf "\033[31mREMEMBER: Protonmail users must install and configure Protonmail Bridge first for the sync to work:\\nhttps://protonmail.com/bridge/\\n\033[0m" && issl="None" ;;
  199. esac
  200. [ "$sport" = 465 ] && sssl="SMTPS"
  201. fi
  202. printf "Enter the \033[35mfull name\033[0m you want to be identified by on this account.\\n\tReal name: "
  203. read -r realname
  204. printf "Enter a short, \033[36mone-word identifier\033[0m for this email account that will distinguish them from any other accounts you add.\\n\tAccount name: "
  205. read -r title
  206. while ! echo "$title" | grep "$namere" >/dev/null || ls "$accdir"/[0-9]"-$title.muttrc" >/dev/null 2>&1; do
  207. printf "\033[31mTry again\033[0m. Pick a nickname that is one word only including lowercase letters and _ or - and that you have \033[1mnot\033[0m used before.\\n\tAccount name: \033[36m\t"
  208. read -r title
  209. printf "\033[0m"
  210. done
  211. printf "If your account has a special username different from your address, insert it now. Otherwise leave this prompt totally blank.\\n\033[34mMost accounts will not have a separate login, so you should probably leave this blank.\033[0m\\n\tLogin(?): \033[36m"
  212. read -r login
  213. printf "\033[0m"
  214. [ -z "$login" ] && login="$fulladdr"
  215. [ "$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
  216. echo "$maxmes" | grep "[1-9]" >/dev/null || maxmes="0"
  217. getpass
  218. getprofiles
  219. mkdir -p "$muttdir" "$accdir" "$cachedir/$title/bodies" "$HOME/.config/msmtp"
  220. getaccounts
  221. for x in $(seq 1 9); do echo "$accounts" | grep "$x" >/dev/null 2>&1 || { export idnum="$x"; break ;}; done
  222. [ ! -f "$msmtprc" ] && echo "$msmtp_header" > "$msmtprc"
  223. echo "$msmtp_profile" >> "$msmtprc"
  224. command -V apt-get >/dev/null 2>&1 && ln -s "$msmtprc" "$HOME/.msmtprc" 2>/dev/null
  225. case "$service" in
  226. protonmail.ch|protonmail.com|pm.me) protonfinger || return 1 ;;
  227. esac
  228. echo "$mutt_profile" > "$accdir/$idnum-$title.muttrc"
  229. echo "$mbsync_profile" >> "$mbsyncrc"
  230. notmuchauto
  231. [ ! -f "$muttrc" ] && echo "# vim: filetype=neomuttrc" > "$muttrc" && echo "muttrc created."
  232. ! grep "^source.*mutt-wizard.muttrc" "$muttrc" >/dev/null && echo "source $mwconfig # mw-autogenerated" >> "$muttrc"
  233. ! grep "^source.*.muttrc" "$muttrc" | grep -v "$mwconfig" >/dev/null && echo "source $accdir/$idnum-$title.muttrc # mw-autogenerated" >> "$muttrc"
  234. echo "macro index,pager i$idnum '<sync-mailbox><enter-command>source $accdir/$idnum-$title.muttrc<enter><change-folder>!<enter>;<check-stats>' \"switch to $fulladdr\" # mw-autogenerated" >> "$muttrc"
  235. }
  236. protonfinger() { printf "Getting Protonmail bridge fingerprint...\\n"
  237. fingerprint="$(msmtp --serverinfo --host=127.0.0.1 --port=1025 --tls --tls-certcheck=off | grep SHA256: | sed 's/^.*: //')"
  238. sed -ibu "s/account $title/&\ntls_trust_file\ntls_fingerprint $fingerprint/" "$msmtprc" ; rm -f "$msmtprc"bu
  239. }
  240. getpass() { while : ; do pass rm -f "mutt-wizard-$title" >/dev/null 2>&1
  241. pass insert "mutt-wizard-$title" && break; done ;}
  242. formatShortcut() { \
  243. while read -r data; do { echo "macro index,pager g$1 \"<change-folder>$data<enter>\" \"go to $2\" # mw-autogenerated"
  244. echo "macro index,pager M$1 \";<save-message>$data<enter>\" \"move mail to $2\" # mw-autogenerated"
  245. echo "macro index,pager C$1 \";<copy-message>$data<enter>\" \"copy mail to $2\" # mw-autogenerated"; } >> "$accdir/$idnum-$title.muttrc"
  246. done ;}
  247. tryconnect() { mkdir -p "$maildir/$title"
  248. if mailboxes="$(mbsync -l "$title" | sed 's/\//./')" >/dev/null 2>&1 && [ -n "$mailboxes" ]; then
  249. [ "$accounttype" = "online" ] && sed -ibu "/IMAPStore $title-remote$/,/# End profile/d" "$mbsyncrc" ; rm -f "$mbsyncrc"bu
  250. printf "\033[32mMailboxes detected.\033[0m\\n"
  251. echo "$mailboxes" | xargs -I {} mkdir -p "$maildir/$title/{}"
  252. return 0
  253. else
  254. printf "\033[31m\033[31mLog-on not successful.\033[0m\\nIt seems that either you inputted the wrong password or server settings, or there are other requirements for your account out of the control of mutt-wizard.\\n"
  255. return 1
  256. fi ;}
  257. finalize() { \
  258. boxes="$(find "$maildir/$title/" -mindepth 1 -type d | sed "s/\ /\\\ /g;s/^.*\//=/;/=\(cur\|new\|tmp\)$/d")"
  259. [ -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
  260. printf "Setting default mailboxes for your Inbox, Sent, Drafts and Trash in mutt...\\n"
  261. spoolfile=$(echo "$boxes" | grep -i -m 1 inbox | sed 's/=/+/g')
  262. record=$(echo "$boxes" | grep -i -m 1 sent | sed 's/=/+/g')
  263. postponed=$(echo "$boxes" | grep -i -m 1 draft | sed 's/=/+/g')
  264. trash=$(echo "$boxes" | grep -i -m 1 trash | sed 's/=/+/g')
  265. sed -ibu "/^mailboxes\|^set record\|^set postponed\|^set trash\|^set spoolfile/d" "$accdir/$idnum-$title.muttrc" ; rm -f "$accdir/$idnum-$title.muttrcbu"
  266. { echo "set spoolfile = \"$spoolfile\""; echo "set record = \"$record\""; echo "set postponed = \"$postponed\""; echo "set trash = \"$trash\""; } >> "$accdir/$idnum-$title.muttrc"
  267. echo "mailboxes $(echo "$boxes" | sed -e "s/^\|$/\"/g" | tr "\n" " ")" >> "$accdir/$idnum-$title.muttrc"
  268. printf "Setting up your keyboard shortcuts for jumping between mailboxes...\\n"
  269. sed -ibu "/# mw-autogenerated/d" "$accdir/$idnum-$title.muttrc" ; rm -f "$accdir/$idnum-$title.muttrcbu"
  270. echo "$boxes" | grep -i inbox | head -n 1 | formatShortcut i inbox
  271. echo "$boxes" | grep -i sent | head -n 1 | formatShortcut s sent
  272. echo "$boxes" | grep -i draft | head -n 1 | formatShortcut d drafts
  273. echo "$boxes" | grep -i trash | head -n 1 | formatShortcut t trash
  274. echo "$boxes" | grep -i spam | head -n 1 | formatShortcut S spam
  275. echo "$boxes" | grep -i junk | head -n 1 | formatShortcut j junk
  276. echo "$boxes" | grep -i archive | head -n 1 | formatShortcut a archive
  277. [ "$accounttype" = "offline" ] && printf "All done.\\n\033[33mYou should now be able to run \`\033[32mmbsync %s\033[33m\` to begin to download your mail.\033[0m\\n" "$title"
  278. command -V urlview >/dev/null 2>&1 && [ ! -f "$HOME/.urlview" ] && echo "COMMAND \$BROWSER" > "$HOME/.urlview"
  279. return 0
  280. }
  281. confirm() { printf "Do you want to %s? [yes/N]\\n\t" "$@" && read -r input && ! echo "$input" | grep -i "^yes$" >/dev/null && printf "That doesn't seem like a yes to me.\\n\\n" && return 1
  282. printf "Are you really, really sure you want to %s?\\n\t" "$@" && read -r input && ! echo "$input" | grep -i "^yes$" >/dev/null && printf "That doesn't seem like a yes to me.\\n\\n" && return 1
  283. return 0 ;}
  284. pick() { printf "Select an accounts to %s:\\n" "$1"
  285. list
  286. read -r input
  287. [ -z "$input" ] && return 1
  288. title="$(echo "$accounts" | grep "$input" | awk '{print $2}')"
  289. [ -z "$title" ] && printf "Invalid response." && return 1
  290. return 0 ;}
  291. delete() { sed -ibu "/IMAPStore $title-remote$/,/# End profile/d" "$mbsyncrc" ; rm -rf "$mbsyncrc"bu
  292. rm -rf "${cachedir:?}/${title:?}" "$accdir/"[1-9]"-$title.muttrc"
  293. sed -ibu "/[0-9]-$title.muttrc/d" "$muttrc" ; rm -f "$muttrc"bu
  294. sed -ibu "/account $title/,/^\(\s*$\|account\)/d" "$msmtprc"; rm -f "$msmtprc"bu
  295. }
  296. choosecron() { ! pgrep cron >/dev/null && echo "No cron manager running. Install/enable one and then select this option again." && return 1
  297. if crontab -l | grep mailsync >/dev/null; then
  298. echo "Active mail sync cronjob detected. Do you want to remove it?"
  299. printf "\033[36m\t"
  300. read -r rmyn
  301. printf "\033[0m"
  302. echo "$rmyn" | grep -i "^y\(es\)*$" >/dev/null && crontab -l | sed '/mailsync/d' | crontab - >/dev/null && echo "Mail sync turned off."
  303. else
  304. echo "How many minutes between each mail sync?"
  305. printf "\033[36m\t"
  306. read -r minnum
  307. printf "\033[0m"
  308. while ! echo "$minnum" | grep "^[0-9]\+$" >/dev/null; do
  309. printf "That doesn't look like a number. How many minutes between each mail sync?\\n\033[36m\t"
  310. read -r minnum
  311. printf "\033[0m"
  312. done
  313. (crontab -l; echo "*/$minnum * * * * $(type mailsync | cut -d' ' -f3) >/dev/null 2>&1") | crontab - >/dev/null &&
  314. echo "Cronjob added. Mail will sync every $minnum minutes. Be sure you have your cron manager running."
  315. fi ;}
  316. asktype() { while : ; do
  317. printf "Do you want to keep your mail for this account offline with mbsync? [yes/no]\\n\t"
  318. read -r offnot
  319. case "$offnot" in
  320. [Yy][Ee][Ss]) accounttype="offline" && break ;;
  321. [Nn][Oo]) accounttype="online" && break ;;
  322. *) echo "Write out either yes or no completely. Try again or press ctrl-c to quit." ;;
  323. esac; done ;}
  324. purge() { confirm "delete all account data" || exit
  325. rm -rf "$mbsyncrc" "$accdir" "$HOME/.config/msmtp" "$cachedir"
  326. crontab -l | sed '/mailsync/d' | crontab - >/dev/null
  327. echo "All configs and account settings have been purged."
  328. sed -ibu "/\# mw-autogenerated/d" "$muttrc" ; rm -f "$muttrc"bu
  329. }
  330. notmuchauto() { \
  331. [ -z "$NOTMUCH_CONFIG" ] && NOTMUCH_CONFIG="$HOME/.notmuch-config"
  332. [ -f "$NOTMUCH_CONFIG" ] && return 0
  333. nmbasic="[database]
  334. path=$maildir
  335. [user]
  336. name=$realname
  337. primary_email=$fulladdr
  338. [new]
  339. tags=unread;inbox;
  340. ignore=.mbsyncstate;.uidvalidity
  341. [search]
  342. exclude_tags=deleted;spam;
  343. [maildir]
  344. synchronize_flags=true
  345. [crypto]
  346. gpg_path=$GPG"
  347. echo "$nmbasic" > "$NOTMUCH_CONFIG" ;}
  348. trap 'echo -e "\033[0m\n"; exit' INT ABRT
  349. case "$1" in
  350. ls) list ;;
  351. add) asktype && askinfo && tryconnect && finalize || delete ;;
  352. pass) pick "change the password of" && getpass ;;
  353. delete) pick delete && confirm "delete the \`$title\` profile" && delete ;;
  354. purge) purge ;;
  355. cron) choosecron ;;
  356. *) cat << EOF
  357. mw: mutt-wizard, auto-configure email accounts for mutt
  358. including downloadable mail with \`isync\`.
  359. Allowed options:
  360. add Add and autoconfigure an email address (9 max.)
  361. ls List configured accounts
  362. delete Pick an account to delete
  363. purge Delete all accounts and settings
  364. cron Enable or disable an autosync via cronjob
  365. all else Print this message
  366. NOTE: Once at least one account is added, you can run
  367. \`mbsync -a\` to begin downloading mail.
  368. EOF
  369. esac