|
|
@@ -199,9 +199,8 @@ writeinfo() { mkdir -p "$muttdir" "$accdir" "$cachedir/$fulladdr/bodies" "${XDG_ |
|
|
|
# On Ubuntu/Debian, a link is needed since they use an older version. |
|
|
|
command -V apt-get >/dev/null 2>&1 && ln -s "$msmtprc" "$HOME/.msmtprc" 2>/dev/null |
|
|
|
|
|
|
|
# Create the mbsync config file. |
|
|
|
mkdir -p "${mbsyncrc%/*}" |
|
|
|
echo "$mbsync_profile" >> "$mbsyncrc" |
|
|
|
# Create the mbsync config file if local account. |
|
|
|
[ -z "${online+x}" ] && mkdir -p "${mbsyncrc%/*}" && echo "$mbsync_profile" >> "$mbsyncrc" |
|
|
|
|
|
|
|
# Create a muttrc for viewing mail. |
|
|
|
echo "$mutt_profile" > "$accdir/$idnum-$fulladdr.muttrc" |
|
|
@@ -230,14 +229,10 @@ Junk |
|
|
|
Trash |
|
|
|
Sent |
|
|
|
Archive" && return 0 |
|
|
|
if mailboxes="$(mbsync -l "$fulladdr" | sed 's/\//./')" >/dev/null 2>&1 && [ -n "$mailboxes" ]; then |
|
|
|
[ -n "${online+x}" ] && sed -ibu "/IMAPStore $fulladdr-remote$/,/# End profile/d" "$mbsyncrc" ; rm -f "$mbsyncrc"bu |
|
|
|
return 0 |
|
|
|
else |
|
|
|
echo "$mailboxes" |
|
|
|
echo "Log-on not successful." |
|
|
|
return 1 |
|
|
|
fi ;} |
|
|
|
info="$(curl -s --user "$login:$(pass $pass_prefix$fulladdr)" --url "${protocol:-imaps}://$imap")" || |
|
|
|
{ echo "Log-on not successful." ; exit 1 ;} |
|
|
|
mailboxes="$(echo "$info" | sed "s/.*\" //" | tr -d '
')" |
|
|
|
} |
|
|
|
|
|
|
|
finalize() { echo "$mailboxes" | xargs -I {} mkdir -p "$maildir/$fulladdr/{}/cur" "$maildir/$fulladdr/{}/tmp" "$maildir/$fulladdr/{}/new" |
|
|
|
sed -ibu "/$marker/d" "$accdir/$idnum-$fulladdr.muttrc" ; rm -f "$accdir/$idnum-$fulladdr.muttrcbu" |
|
|
|