Creating bdsmail users

This commit is contained in:
Bob Mottram 2018-02-12 19:53:25 +00:00
parent c1643e475b
commit 4d06910eb0
1 changed files with 6 additions and 4 deletions

View File

@ -64,10 +64,12 @@ function bdsmail_configure_users {
fi
# Create a directory where i2p mail will be stored
if [ ! -d /home/$USERNAME/Maildir/i2p/cur ]; then
if [ ! -d /home/$USERNAME/Maildir/i2p/new ]; then
mkdir -p /home/$USERNAME/Maildir/i2p/cur
mkdir -p /home/$USERNAME/Maildir/i2p/new
chown -R $USERNAME:$USERNAME /home/$USERNAME/Maildir/i2p
$BDSMAIL_DIR/bin/newmail $MY_USERNAME /home/$MY_USERNAME/MailDir/i2p
fi
fi
done
@ -225,8 +227,9 @@ function remove_bdsmail {
sed -i 's| =i2p||g' /home/$USERNAME/.muttrc
fi
# NOTE: leave Maildir/i2p. We might want to archive that
# NOTE: leave Maildir/i2p/cur. We might want to archive that
# or just be reinstalling the system without losing mail
rm -rf /home/$USERNAME/Maildir/i2p/new
fi
done
@ -350,11 +353,10 @@ function install_bdsmail {
# Create mutt configuration
mkdir /etc/skel/.mutt
echo 'set mbox_type=Maildir' > /etc/skel/.mutt/bdsmail
echo 'set mbox="~/Maildir/i2p"' >> /etc/skel/.mutt/bdsmail
echo 'set smtp_url=smtp://127.0.0.1:2525/' >> /etc/skel/.mutt/bdsmail
echo 'set use_from=yes' >> /etc/skel/.mutt/bdsmail
echo "set from=username@${bds_domain}" >> /etc/skel/.mutt/bdsmail
echo "set spoolfile=$BDSMAIL_DIR/mail/username" >> /etc/skel/.mutt/bdsmail
echo "set spoolfile=~/Maildir/i2p" >> /etc/skel/.mutt/bdsmail
# mutt configuration for the admin user
if [ ! -d /home/$MY_USERNAME/.mutt ]; then