Update Servers/Linux/iRedMail.md
This commit is contained in:
@ -9,11 +9,41 @@ The instructions below are specific to my homelab environment, but can be easily
|
||||
|
||||
Start by connecting to the server / VM via SSH, then issue the commands below:
|
||||
``` sh
|
||||
sudo yum update -y
|
||||
# Elevate to Root User
|
||||
sudo su
|
||||
|
||||
# Define some deployment variables.
|
||||
VERSION="1.6.8" # (1)
|
||||
MAIL_DOMAIN="bunny-lab.io" # (2)
|
||||
POSTMASTER_PASSWORD="SecurePassword101" # (3)
|
||||
|
||||
# Check for Updates in the Package Manager
|
||||
yum update -y
|
||||
|
||||
# Install Extra Packages for Enterprise Linux
|
||||
dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
|
||||
|
||||
# Download the iRedMail binaries and extract them
|
||||
cd /root
|
||||
curl https://codeload.github.com/iredmail/iRedMail/tar.gz/refs/tags/1.6.8 -o iRedMail-1.6.8.tar.gz
|
||||
tar zxf iRedMail-1.6.8.tar.gz
|
||||
curl https://codeload.github.com/iredmail/iRedMail/tar.gz/refs/tags/$VERSION -o iRedMail-$VERSION.tar.gz
|
||||
tar zxf iRedMail-$VERSION.tar.gz
|
||||
```
|
||||
|
||||
1. This is the version of iRedMail you are deploying.
|
||||
2. This is the domain suffix that appears after mailbox names. e.g. `first.last@domain.com`
|
||||
3. For the purposes of the installation, you cannot use symbols in your password here. Keep it to letters and numbers.
|
||||
|
||||
Create the unattend config file for silent deployment (Copy/Paste the one-liner into the SSH terminal). This will automatically generate random 32-character passwords for all of the internal databases. You will set the postmaster password and mail domain in the next step.
|
||||
```
|
||||
(echo "export STORAGE_BASE_DIR='/var/vmail'"; echo "export WEB_SERVER='NGINX'"; echo "export BACKEND_ORIG='PGSQL'"; echo "export BACKEND='PGSQL'"; for var in VMAIL_DB_BIND_PASSWD VMAIL_DB_ADMIN_PASSWD MLMMJADMIN_API_AUTH_TOKEN NETDATA_DB_PASSWD AMAVISD_DB_PASSWD IREDADMIN_DB_PASSWD RCM_DB_PASSWD SOGO_DB_PASSWD SOGO_SIEVE_MASTER_PASSWD IREDAPD_DB_PASSWD FAIL2BAN_DB_PASSWD; do echo "export $var='$(openssl rand -base64 48 | tr -d '+/=' | head -c 32)'"; done; echo "export PGSQL_ROOT_PASSWD='PLACEHOLDER'"; echo "export DOMAIN_ADMIN_PASSWD_PLAIN='PLACEHOLDER'"; echo "export FIRST_DOMAIN='$MAIL_DOMAIN'"; echo "export USE_IREDADMIN='YES'"; echo "export USE_SOGO='YES'"; echo "export USE_NETDATA='YES'"; echo "export USE_FAIL2BAN='YES'") > /root/iRedMail-$VERSION/config
|
||||
|
||||
```
|
||||
|
||||
```jsx title="/root/iRedMail-1.6.8/config"
|
||||
|
||||
```
|
||||
|
||||
# Deploy iRedMail via the Install Script
|
||||
cd /root/iRedMail-1.6.8
|
||||
bash iRedMail.sh
|
||||
```
|
||||
|
Reference in New Issue
Block a user