
iRedMail is an open-source email server solution that enables the deployment of a fully functional email system. It integrates multiple components for mail transfer, retrieval, storage, virus scanning, spam detection, and secure communication. iRedMail uses the Postfix mail transfer agent and includes a web administration interface for managing email accounts, domains, and other server settings.
This article explains how to install iRedMail on a Debian 12 server.
Before you begin:
mail.example.com and example.com.25 to be unblocked on your instance.iRedMail is not available in the default package repositories on Debian 12. Follow the steps below to set up the server and install iRedMail using the latest installation script.
Change the server hostname to your mail domain.
Open the /etc/hosts file.
Add your mail domain mail.example.com as a value of 127.0.1.1.
Save and close the file.
The above host configuration enables the server to resolve your mail domain to the system address.
Download the latest iRedMail installation archive using wget. 1.7.1 in the URL with the latest version number.
The above command downloads the archive version 1.7.1. Visit the official iRedMail download page to verify the latest version to download on your server.
Extract files from the archive.
Switch to the extracted files directory.
Enable execute permissions to the iRedMail installation script.
Run the automatic installation script to install iRedMail on your server.
Reply to the following prompts to install iRedMail on your server.
Press Enter to start the installation process.
Default mail storage path: Press Enter to use the default /var/vmail directory.
Preferred web server: Keep Nginx selected and press Enter to enable the web server.
Choose Preferred backend uses to store mail accounts: Press the Down arrow key and press Space to select MariaDB as the database backend.
LDAP suffix: Press Enter to use the default domain format to create a directory tree.
Password for MySQL administrator: Enter a new strong password to assign the root database user account on your server.
Your first domain name: Enter your domain to use when sending and receiving emails on the server. For example, example.com
Password for the mail domain administrator: Enter a new strong password to assign the postmaster mail administrator account.
Optional components: Select optional components to install on your server and press Enter to apply changes.
Enter Y when prompted to continue and save your iRedMail installation options.
Enter Y to allow SSH connections on the default port 22 through the firewall.
Reboot the server to apply the iRedMail installation changes.
Open the HTTP port.
Open the HTTPS port.
Open the mail port 25.
Follow the steps below to configure DNS records such as SPF, DMARC, and DKIM to enable the delivery of emails from your mail server.
Log in to your domain registrar such as Vultr DNS and create the following DNS records.
Create a new MX (Mail Exchange) record with the following details.
MX@10mail.example.comCreate a new SPF (Sender Policy Framework) record with the following details. Replace 192.0.2.1 with your actual server IP address.
TXT@"v=spf1 a mx ip4:192.0.2.1 -all"Create a new TXT record to set up SPF. Set the record name to @. If you're using a subdomain for the email address domain, set the record name to the subdomain. Set the data to the text below. Replace 192.0.2.1 with your server's IP address.
The SPF record instructs the recipient server to only allow mail from your server's IP address.
Create a new DMARC (Domain-based Message Authentication, Reporting, and Conformance) record with the following details. Replace dmarc-reports@example.com with your domain administrator's email.
TXT_dmarc"v=DMARC1; p=reject; rua=mailto:dmarc-reports@example.com; pct=100"Create a new DKIM (DomainKeys Identified Mail) record:
Run the following command in your server's terminal to view your domain's DKIM records generated by the amavisd iRedmail utility.
Your output should similar to the one below.
Copy all contents in bracelets () to use as your DKIM record's data.
Create a new TXT record using the generated DKIM information with the following details.
TXTdkim._domainkey"<iredmail-dkim-data>"Test your DKIM keys configuration using amavisd to verify the DNS record.
Output:
Access your instance's management page and navigate to the Settings tab.
Click the reverse DNS field in your IPV4 section and replace the existing data with your domain name.
Follow the steps below to generate Let's Encrypt SSL certificates to replace the default iRedMail self-signed certificates.
Install the Snapd package manager.
Install Certbot using snap.
Activate the system-wide Certbot command.
Request a new SSL certificate for your active domains. Replace example.com and mail.example.com with the actual domains pointing to your server's IP address, and hello@example.com with your email.
Your output should be similar to the one below when successful.
Change the Let's Encrypt SSL directory permissions to enable read privileges for other applications such as Postfix and Dovecot on the server.
Back up the default iRedMail SSL certificate file.
Back up the default iRedMail private key file.
Link your domain's Let's Encrypt certificate file to the iRedMail.crt file.
Link the Let's Encrypt private key to iRedMail.key.
Restart the Postfix, Dovecot, and Nginx system services.
Follow the steps below to access the iRedMail web administration interface to manage user accounts, email domains and view mail logs on the server.
Access the iRedMail web administration interface using your management domain.
Log in to the iRedMail interface using your first email domain's administrator email and password your set during the installation process:
postmaster@example.com<Administrator-Password>
Click the Add drop-down and select User from the list to set up a new email account.
Enter your desired email information and click Add to create the new user.
Add the /mail path to your domain in new web browser window to access the Roundcube Webmail interface and manage your email.
Enter your Postmaster user and password to log in to its webmail interface.
Click Compose to create a new test email to your new user email. For example, user1@example.com.
Click Send to send the test email and verify that it's successful.
Click Logout in the bottom left to exit the Roundcube interface.
Log in to Roundcube using the new email user you created earlier to access the email sent from the postmaster account.
Click the header link within Headers.
Verify your domain's DKIM values sent to all mail domains.
You have installed iRedMail on a Debian 12 server and configured DNS records to enable the secure delivery of emails. iRedMail enables the hosting and delivery to emails by integrating webmail solutions such as Roundcube to enable access to active email accounts. For more information, visit the iRedmail documentation.
0 Comments
Be the first to comment and share your perspective with the community.