25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

443 satır
16 KiB

  1. #!/bin/sh
  2. if [ "$#" -gt 1 ]; then
  3. echo "To many arguments. You will be asked."
  4. exit
  5. fi
  6. if [ -z "$prefix" ]; then
  7. case "$(uname)" in
  8. Linux) prefix="/usr" ;;
  9. *) prefix="/usr/local" ;;
  10. esac
  11. fi
  12. command -V gpg >/dev/null 2>&1 && GPG="gpg" || GPG="gpg2"
  13. [ -z "$PASSWORD_STORE_DIR" ] && PASSWORD_STORE_DIR="$HOME/.password-store"
  14. [ -r "$PASSWORD_STORE_DIR/.gpg-id" ] &&
  15. "$GPG" --list-secret-keys $(cat "$PASSWORD_STORE_DIR/.gpg-id") >/dev/null 2>&1 || {
  16. 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"
  17. exit
  18. }
  19. ! command -v "$prefix/bin/mbsync" >/dev/null && printf "\`mbsync\` must be installed to run mutt-wizard.\\n" && exit
  20. ! command -v "$prefix/bin/msmtp" >/dev/null && printf "\`msmtp\` must be installed.\\n" && exit
  21. ! ( command -v mutt >/dev/null || command -v neomutt >/dev/null ) && printf "\`mutt\` must be installed.\\n" && exit
  22. mwconfigdir=${XDG_CONFIG_HOME:-$HOME/.config}
  23. # Main mutt config location
  24. mwmuttdir="$mwconfigdir/mutt"
  25. # Directory for account settings
  26. mwaccmuttdir="$mwmuttdir/accounts"
  27. # Location of mail storage
  28. mwmaildir="${MAILDIR:-$HOME/mail}"
  29. # Regex to confirm valid email address
  30. mwemailre=".\+@.\+\\..\+"
  31. mwshare="$prefix/share/mutt-wizard"
  32. mwmuttrc="$mwmuttdir/muttrc"
  33. mwmbsyncrc="$mwconfigdir/isync/mbsyncrc"
  34. mwmsmtprc="$mwconfigdir/msmtp/config"
  35. mwsharerc="$mwshare/mutt-wizard.muttrc"
  36. mwcachedir="${XDG_CACHE_HOME:-$HOME/.cache}/mutt-wizard"
  37. mwssltype="IMAPS"
  38. mbsyncbin="$prefix/bin/mbsync -c $mwmbsyncrc"
  39. msmtpbin="$prefix/bin/msmtp"
  40. _mwaddrmwtype(){
  41. mwacc="$mwaddr" # let the user always just deal with his email
  42. mwaccmaildir="$mwmaildir/$mwacc" # mail dir is $MAILDIR/email
  43. mwacccachedir=$mwcachedir/${mwaddr//[.@]/_} # @ cannot stay because of mutt, . could
  44. mwaccmuttrc="$mwaccmuttdir/$mwidnum-$mwacc.mwonofftype.$mwtype.muttrc"
  45. mwpass=mutt-wizard-$mwaddr
  46. [ -n "$mwidnum" ] && mwaccmuttrc="$mwaccmuttdir/$mwidnum-$mwacc.mwonofftype.$mwtype.muttrc"
  47. }
  48. for mwcrt 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/"
  49. do
  50. [ -f "$mwcrt" ] && mwsslcert="$mwcrt" && break
  51. done || { echo "CA Certificate not found. Please install one or link it to /etc/ssl/certs/ca-certificates.crt" && exit 1 ;}
  52. _mwgetaccounts() {
  53. mwaccounts="$(find "$mwaccmuttdir" -type f | grep -o "[1-9]-.*.muttrc" | sed "s/-/: /;s/\.muttrc//" | sort -n)"
  54. }
  55. _mwlist() {
  56. _mwgetaccounts && [ -n "$mwaccounts" ] && echo "${mwaccounts//.mwonofftype./ }"
  57. }
  58. _mwadd() {
  59. _mwasktype && _mwaskinfo && _mwtryconnect && _mwfinalize || _mwdelete
  60. }
  61. _mwgetprofiles() {
  62. unset mwmsmtpheader mwmsmtpprofile mwmuttprofile mwmbsyncprofile
  63. printf "Creating profiles for \`%s\`..." "$mwaddr"
  64. mwmsmtpheader="defaults
  65. auth on
  66. tls on
  67. tls_trust_file $mwsslcert
  68. logfile ${XDG_LOG_HOME:-$HOME}/msmtp.log
  69. "
  70. mwmsmtpprofile="account $mwacc
  71. host $mwsmtp
  72. port $mwsport
  73. from $mwaddr
  74. user $mwlogin
  75. passwordeval \"pass $mwpass\"
  76. $mwstarttlsoff
  77. "
  78. mwmbsyncprofile="IMAPStore $mwacc-remote
  79. Host $mwimap
  80. Port $mwiport
  81. User $mwlogin
  82. PassCmd \"pass $mwpass\"
  83. SSLType $mwssltype
  84. CertificateFile $mwsslcert
  85. MaildirStore $mwacc-local
  86. Subfolders Verbatim
  87. Path $mwaccmaildir/
  88. Inbox $mwaccmaildir/INBOX
  89. Flatten .
  90. Channel $mwacc
  91. Expunge Both
  92. Master :$mwacc-remote:
  93. Slave :$mwacc-local:
  94. Patterns * !\"[Gmail]/All Mail\"
  95. Create Both
  96. SyncState *
  97. MaxMessages 0
  98. # End profile
  99. "
  100. if [ "$mwtype" = "offline" ]; then
  101. mwmuttprofile="# vim: filetype=neomuttrc
  102. # muttrc file for account $mwaddr
  103. set realname = \"$mwname\"
  104. set from = \"$mwaddr\"
  105. set sendmail = \"$msmtpbin -a $mwacc\"
  106. alias me $mwname <$mwaddr>
  107. set folder = \"$mwaccmaildir\"
  108. set mbox_type = Maildir
  109. macro index gm \"<shell-escape>mailsync $mwacc<enter>\" \"sync mail $mwaddr\"
  110. unmailboxes *
  111. "
  112. else
  113. mwmuttprofile="# vim: filetype=neomuttrc
  114. # muttrc file for account $mwaddr
  115. set realname = \"$mwname\"
  116. set from = \"$mwaddr\"
  117. set sendmail = \"$msmtpbin -a $mwacc\"
  118. alias me $mwname <$mwaddr>
  119. set folder = \"imaps://$mwaddr@$mwimap:$mwiport\"
  120. set header_cache = \"$mwacccachedir\"
  121. set message_cachedir = \$header_cache
  122. set imap_user = \"$mwlogin\"
  123. set imap_pass = \"\`pass $mwpass\`\"
  124. account-hook \$folder 'set imap_user=\"$mwlogin\" imap_pass=\"\`pass $mwpass\`\"'
  125. set mbox_type = Maildir
  126. set ssl_starttls = yes
  127. set ssl_force_tls = yes
  128. unmailboxes *
  129. "
  130. fi
  131. printf "DONE.\\n"
  132. }
  133. _mwaskinfo() {
  134. if [ -z "$mwaddr" ]; then
  135. printf "Type the \033[31memail address\033[0m\\n\t\033[36m"
  136. read -r mwaddr
  137. printf "\033[0m"
  138. while ! echo "$mwaddr" | grep "$mwemailre" >/dev/null; do
  139. printf "That is not a valid \033[31memail address\033[0m, please retype\\n\t\033[36m"
  140. read -r mwaddr
  141. printf "\033[0m"
  142. done
  143. fi
  144. mwdomain="$(echo "$mwaddr" | sed "s/.*@//")"
  145. printf "\\nSearching for \033[32m%s\033[0m in \033[34m\`domains.csv\`\033[0m..." "$mwdomain"
  146. mwserverinfo="$(grep "^$mwdomain" "$mwshare/domains.csv" 2>/dev/null)"
  147. if [ -z "$mwserverinfo" ]; then
  148. printf "Your email domain is not known to mutt-wizard.\\nType in your settings.\\nUsually you find them by an internet search.\\n"
  149. printf "Type the IMAP server (excluding the port number)\\n\033[36m\t"
  150. read -r mwimap
  151. printf "\033[0mIMAP port number (usually 993)\\n\033[36m\t"
  152. read -r mwiport
  153. printf "\033[0mSMTP server (excluding the port number)\\n\033[36m\t"
  154. read -r mwsmtp
  155. printf "\033[0mSMTP port number (usually 587 or 465)\\n\033[36m\t"
  156. read -r mwsport
  157. printf "\033[0m\\nIf you want, you can copy the line below and add it to the \`domains.csv\` file on Github, for others.\\n\\n%s,%s,%s,%s,%s\\n\\nBut be sure the setting works, first! ;-)\\n" "$mwdomain" "$mwimap" "$mwiport" "$mwsmtp" "$mwsport"
  158. else
  159. IFS=, read -r mwservice mwimap mwiport mwsmtp mwsport <<EOF
  160. $mwserverinfo
  161. EOF
  162. printf "\\n\033[3;33mCongrats!\033[0m Server info is known, so you don't need to look it 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\\n" "$mwimap" "$mwiport" "$mwsmtp" "$mwsport"
  163. case "$mwservice" in
  164. gmail.com) printf "\033[31mGmail: \"less secure\" must be enabled before you continue.\\nDo it now, if you have not done it already:\\nhttps://support.google.com/accounts/answer/6010255\\n\033[0m" ;;
  165. protonmail.ch|protonmail.com|pm.me) printf "\033[31mProtonmail: Users must install and configure Protonmail Bridge for the sync to work:\\nhttps://protonmail.com/bridge/\\n\033[0m" && ssltype="None" ;;
  166. esac
  167. [ "$mwsport" = 465 ] && mwstarttlsoff="tls_starttls off"
  168. fi
  169. if [ -z "$mwname" ]; then
  170. printf "Name to associate to email.\\n\t"
  171. read -r mwname
  172. fi
  173. if [ -z "$mwlogin" ]; then
  174. printf "Type your account username if different from your email address.\\n\033[34mFor most accounts you can probably leave this blank.\033[0m\\n\tLogin(?): \033[36m"
  175. read -r mwlogin
  176. printf "\033[0m"
  177. [ -z "$mwlogin" ] && mwlogin="$mwaddr"
  178. fi
  179. # if the user has a pass entry he could provide it via mwpass
  180. if [ -z "$mwpass" ]; then
  181. mwpass=mutt-wizard-$mwaddr
  182. _mwgetpass
  183. fi
  184. unset mwidnum
  185. _mwaddrmwtype
  186. _mwgetprofiles
  187. mkdir -p "$mwmuttdir" "$mwaccmuttdir" "${mwmsmtprc%/*}" "${mwmbsyncrc%/*}"
  188. if [ ! -f "$mwmsmtprc" ]; then
  189. echo "$mwmsmtpheader" > "$mwmsmtprc"
  190. else
  191. sed -i "/account $mwacc/,/^\(\s*$\|account\)/d" "$mwmsmtprc"
  192. fi
  193. echo "$mwmsmtpprofile" >> "$mwmsmtprc"
  194. case "$mwservice" in
  195. protonmail.ch|protonmail.com|pm.me) protonfinger || return 1 ;;
  196. esac
  197. [ -f "$mwmbsyncrc" ] && sed -i "/IMAPStore $mwacc-remote$/,/# End profile/d" "$mwmbsyncrc"
  198. echo "$mwmbsyncprofile" >> "$mwmbsyncrc"
  199. #mwaccmuttrc
  200. mwaccmuttrc="$mwaccmuttdir/$(find "$mwaccmuttdir" -type f | grep -m 1 -o "[1-9]-$mwacc.mwonofftype.$mwtype.muttrc")"
  201. if [[ ! -f "$mwaccmuttrc" ]]; then
  202. # new mwidnum = first one missing
  203. _mwgetaccounts
  204. for mwx in $(seq 1 9); do echo "$mwaccounts" | grep "$mwx:" >/dev/null 2>&1 || { export mwidnum="$mwx"; break ;}; done
  205. mwaccmuttrc="$mwaccmuttdir/$mwidnum-$mwacc.mwonofftype.$mwtype.muttrc"
  206. else
  207. mwidnum=${mwaccmuttrc%%-*}
  208. mwidnum=${mwidnum##*/}
  209. fi
  210. echo "$mwmuttprofile" > "$mwaccmuttrc"
  211. [ ! -f "$mwmuttrc" ] && echo "# vim: filetype=neomuttrc" > "$mwmuttrc" && echo "muttrc created."
  212. ! grep "source $mwsharerc" "$mwmuttrc" >/dev/null && echo "source $mwsharerc # mw-autogenerated" >> "$mwmuttrc"
  213. if [ "$mwtype" = "offline" ]; then
  214. ! grep "^macro .* gM .*" "$mwmuttrc" >/dev/null && echo "macro index gM '<shell-escape>mailsync -Va<enter>' \"sync all mail\" # mw-autogenerated" >> "$mwmuttrc"
  215. fi
  216. ! grep "^source.*$mwaccmuttrc" "$mwmuttrc" >/dev/null && echo "source $mwaccmuttrc # mw-autogenerated" >> "$mwmuttrc"
  217. return 0
  218. }
  219. _mwprotonfinger() {
  220. printf "Getting Protonmail bridge fingerprint...\\n"
  221. mwfingerprint="$($msmtpbin --serverinfo --host=127.0.0.1 --port=1025 --tls --tls-certcheck=off)" || return 1
  222. sed -i "s/account $mwacc/&\ntls_trust_file\ntls_fingerprint $mwfingerprint/" "$mwmsmtprc"
  223. }
  224. _mwgetpass() {
  225. while : ; do pass rm -f "$mwpass" >/dev/null 2>&1
  226. pass insert "$mwpass" && break; done ;}
  227. _mwtryconnect() {
  228. if [ ! -d "$mwaccmaildir" ]; then
  229. mwaccmaildirWasThere="NO" # we need to remove again for "online"
  230. mkdir -p "$mwaccmaildir"
  231. fi
  232. if [ -z "$mailboxes" ]; then
  233. mailboxes="$($mbsyncbin -l $mwacc | sed 's/\//./')" >/dev/null 2>&1
  234. fi
  235. if [ -n "$mailboxes" ]; then
  236. mwspoolfile=$(echo "$mailboxes" | grep -i -m 1 inbox | sed -ne 's/.*/+\0/p')
  237. [ -z "$mwspoolfile" ] && return 1
  238. #make directories
  239. printf "\033[32mMailboxes detected.\033[0m\\n"
  240. echo "$mailboxes" | xargs -I {} mkdir -p "$mwaccmaildir/{}/"{cur,new,tmp}
  241. record=$(echo "$mailboxes" | grep -i -m 1 sent | sed -ne 's/.*/+\0/p')
  242. [ -z "$mwrecord" ] && mkdir -p "$mwaccmaildir/Sent/"{cur,new,tmp} && record="Sent"
  243. postponed=$(echo "$mailboxes" | grep -i -m 1 draft | sed -ne 's/.*/+\0/p')
  244. [ -z "$mwpostponed" ] && mkdir -p "$mwaccmaildir/Drafts/"{cur,new,tmp} && postponed="Drafts"
  245. trash=$(echo "$mailboxes" | grep -i -m 1 trash | sed -ne 's/.*/+\0/p')
  246. [ -z "$mwtrash" ] && mkdir -p "$mwaccmaildir/Trash/"{cur,new,tmp} && trash="Trash"
  247. return 0
  248. else
  249. 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"
  250. return 1
  251. fi
  252. }
  253. _mwfinalize() { # new mwaccmuttrc
  254. mwboxes="$(find "$mwaccmaildir/" -name cur | sed "s,$mwaccmaildir/,,g;s,/cur,,")"
  255. if [[ "$mwboxes" =~ ^[[:space:]]*$ ]]; then
  256. 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" "$mwacc"
  257. return
  258. fi
  259. mwaccmutt="${email//[.@]/_}"
  260. muttsync=$(printf '<sync-mailbox><enter-command>source %s<enter><change-folder>!<enter>;<check-stats>' $mwaccmuttrc)
  261. cat >> "$mwaccmuttrc" <<EOF
  262. set spoolfile = "$mwspoolfile"
  263. set record = "$mwrecord"
  264. set postponed = "$mwpostponed"
  265. set trash = "$mwtrash"
  266. folder-hook \$folder '$muttsync'
  267. macro index,pager i$mwidnum '$muttsync' "switch to $mwacc"
  268. mailboxes =$mwaccmutt ===================== $(echo "$mwboxes" | sed -e "s/ //g;s/.*/\"=\0\"/g" | tr "\n" " ")
  269. EOF
  270. for mwabox in $mwboxes; do
  271. mwbox=${mwabox##*/}
  272. mwbox=${mwbox##*.}
  273. mwboxi=${mwbox::2}
  274. mwboxi=${mwboxi,,}
  275. cat >> $mwaccmuttrc <<EOF
  276. macro index,pager i$mwboxi "<change-folder>=$mwabox<enter>" "go to $mwbox"
  277. macro index,pager M$mwboxi "<save-message>=$mwabox<enter>" "move mail to $mwbox"
  278. macro index,pager C$mwboxi "<copy-message>=$mwabox<enter>" "copy mail to $mwbox"
  279. EOF
  280. done
  281. if [ "$mwtype" = "offline" ]; then
  282. _mwnotmuchauto
  283. printf "All done.\\n\033[33mYou can now run \`\033[32mmailsync [%s]\033[33m\` to sync your mail.\033[0m\\n" "$mwacc"
  284. else
  285. mkdir -p "$mwacccachedir"
  286. sed -i "/IMAPStore $mwacc-remote$/,/# End profile/d" "$mwmbsyncrc"
  287. [ "$mwaccmaildirWasThere" = "NO" ] && rm -rf "$mwaccmaildir"
  288. fi
  289. return 0
  290. }
  291. _mwconfirm() {
  292. printf "[y/N]: Do you want to %s?\\n\t" "$@" && read -r mwinput && ! echo "$mwinput" | grep -i "^y$\|^yes$" >/dev/null && printf "That doesn't seem like a yes to me.\\n\\n" && return 1
  293. return 0 ;
  294. }
  295. _mwpick() {
  296. printf "Select an accounts to %s:\\n" "$1"
  297. _mwlist
  298. [ -z "$mwpick" ] && read -r mwpick
  299. mwidnum="$mwpick"
  300. [ -z "$mwidnum" ] && return 1
  301. mwaddr="$(echo "$mwaccounts" | grep "$mwidnum:" | sed "s/\.mwonofftype\./ /" | awk '{print $2}')"
  302. mwtype="$(echo "$mwaccounts" | grep "$mwidnum:" | sed "s/\.mwonofftype\./ /" | awk '{print $3}')"
  303. _mwaddrmwtype
  304. [ -z "$mwacc" ] && printf "Invalid response." && return 1
  305. return 0 ;
  306. }
  307. _mwdelete() {
  308. rm -f "$mwaccmuttrc"
  309. sed -i "/$mwaccmuttrc/d" "$mwmuttrc"
  310. if [ "$mwtype" = "offline" ]; then
  311. sed -i "/IMAPStore $mwacc-remote$/,/# End profile/d" "$mwmbsyncrc"
  312. sed -i "/account $mwacc/,/^\(\s*$\|account\)/d" "$mwmsmtprc"
  313. else
  314. rm -rf "$mwacccachedir"
  315. fi
  316. }
  317. _mwcron() {
  318. ! pgrep cron >/dev/null && echo "No cron manager running. Install/enable one and then select this option again." && return 1
  319. if crontab -l | grep mailsync >/dev/null; then
  320. echo "Active mail sync cronjob detected. Do you want to remove it?"
  321. printf "\033[36m\t"
  322. [ -z "$mwcronremove" ] && read -r mwcronremove
  323. printf "\033[0m"
  324. echo "$mwcronremove" | grep -i "^y\(es\)*$" >/dev/null && crontab -l | sed '/mailsync/d' | crontab - >/dev/null && echo "Mail sync turned off."
  325. else
  326. echo "How many minutes between each mail sync?"
  327. printf "\033[36m\t"
  328. [ -z $mwcronminutes ] && read -r mwcronminutes
  329. printf "\033[0m"
  330. while ! echo "$mwcronminutes" | grep "^[1-9]\+$" >/dev/null; do
  331. printf "That doesn't look like a number. How many minutes between each mail sync?\\n\033[36m\t"
  332. read -r mwcronminutes
  333. printf "\033[0m"
  334. done
  335. (crontab -l; echo "*/$mwcronminutes * * * * export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus; export DISPLAY=:0; $(type mailsync | cut -d' ' -f3)") | crontab - &&
  336. echo "Cronjob added. Mail will sync every $mwcronminutes minutes. Be sure you have your cron manager running."
  337. fi
  338. }
  339. _mwasktype() {
  340. if [ -z "$mwtype" ]; then
  341. while : ; do
  342. printf "[yes/no]: Local mail via mbsync? No: Mutt remotes (slower)\\n\t"
  343. read -r mwoffline
  344. case "$mwoffline" in
  345. [Yy][Ee][Ss]) mwtype="offline" && break ;;
  346. [Nn][Oo]) mwtype="online" && break ;;
  347. *) echo "Write out either yes or no completely. Try again or press ctrl-c to quit." ;;
  348. esac
  349. done
  350. fi
  351. }
  352. _mwpurge() {
  353. _mwconfirm "delete all account data" || exit
  354. rm -rf "$mwaccmuttdir" "${mwmsmtprc%/*}" "${mwmbsyncrc%/*}" "$mwcachedir"
  355. sed -i "/\# mw-autogenerated/d" "$mwmuttrc"
  356. pgrep cron >/dev/null && crontab -l | sed '/mailsync/d' | crontab - >/dev/null
  357. echo "All configs and account settings have been purged."
  358. }
  359. _mwnotmuchauto() {
  360. [ -z "$NOTMUCH_CONFIG" ] && NOTMUCH_CONFIG="$HOME/.notmuch-config"
  361. [ -f "$NOTMUCH_CONFIG" ] && return 0
  362. mwnmbasic="[database]
  363. path=$mwmaildir
  364. [user]
  365. name=$mwname
  366. primary_email=$mwaddr
  367. [new]
  368. tags=unread;inbox;
  369. ignore=
  370. [search]
  371. exclude_tags=deleted;spam;
  372. [maildir]
  373. synchronize_flags=true
  374. [crypto]
  375. gpg_path=$GPG"
  376. mkdir -p "${NOTMUCH_CONFIG%/*}"
  377. echo "$mwnmbasic" > "$NOTMUCH_CONFIG"
  378. }
  379. trap 'echo -e "\033[0m\n"; exit' STOP INT ABRT KILL
  380. if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
  381. case "$1" in
  382. ls) _mwlist ;;
  383. add) _mwadd ;;
  384. pass) _mwpick "change the password of" && _mwgetpass ;;
  385. delete) _mwpick delete && _mwconfirm "delete the \`$mwacc\` profile" && _mwdelete ;;
  386. purge) _mwpurge ;;
  387. cron) _mwcron ;;
  388. *) cat << EOF
  389. mw: mutt-wizard, auto-configure email accounts for mutt
  390. including downloadable mail with \`isync\`.
  391. Allowed options:
  392. add Add and autoconfigure an email address (9 max.)
  393. ls List configured accounts
  394. delete Pick an account to delete
  395. purge Delete all accounts and settings
  396. cron Enable or disable an autosync via cronjob
  397. all else Print this message
  398. NOTE: Once at least one account is added, you can run
  399. \`mailsync -a\` to begin downloading mail.
  400. EOF
  401. esac
  402. fi