2013-12-02 03:53:05 +04:00
|
|
|
#!/bin/sh
|
|
|
|
|
2013-12-02 11:06:18 +04:00
|
|
|
echo 'Provisioning Environment with Dovecot and Test Messages'
|
2013-12-02 03:53:05 +04:00
|
|
|
|
|
|
|
# Install and Configure Dovecot
|
|
|
|
|
|
|
|
if which dovecot > /dev/null; then
|
|
|
|
echo 'Dovecot is already installed'
|
|
|
|
else
|
|
|
|
echo 'Installing Dovecot'
|
|
|
|
sudo apt-get -qq -y install dovecot-imapd dovecot-pop3d
|
|
|
|
sudo touch /etc/dovecot/local.conf
|
|
|
|
sudo echo 'mail_location = maildir:/home/%u/Maildir' >> /etc/dovecot/local.conf
|
|
|
|
sudo echo 'disable_plaintext_auth = no' >> /etc/dovecot/local.conf
|
2013-12-19 02:21:55 +04:00
|
|
|
sudo echo 'mail_max_userip_connections = 10000' >> /etc/dovecot/local.conf
|
2013-12-02 03:53:05 +04:00
|
|
|
sudo restart dovecot
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Create "testuser"
|
|
|
|
|
|
|
|
if getent passwd testuser > /dev/null; then
|
|
|
|
echo 'testuser already exists'
|
|
|
|
else
|
2013-12-02 11:06:18 +04:00
|
|
|
echo 'Creating User "testuser"'
|
2013-12-02 03:53:05 +04:00
|
|
|
sudo useradd testuser -m -s /bin/bash
|
|
|
|
echo "testuser:applesauce"|sudo chpasswd
|
2013-12-02 11:06:18 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Setup Email
|
|
|
|
|
2013-12-05 09:57:51 +04:00
|
|
|
/bin/bash /resources/Scripts/ResetMail.sh
|
2013-12-02 11:06:18 +04:00
|
|
|
|
|
|
|
|
|
|
|
echo 'Environment has been provisioned'
|