installmail
Install or reinstall the mail server (Postfix, Dovecot, SASL, Postfwd) and set up SSL, SPF, DKIM, and DMARC for it
- Command:
/go/installmail - Category: Installation
- Required option: None
- Output: Progress messages and package manager output; also logged to
/var/log/go/installmail.log - Last updated: 2026-11-21
On this page: Overview · Quick start · Syntax · Options · Output · Examples · Troubleshooting · Details · See also
Overview
/go/installmail sets up the server so it can send and receive email for your hosted domains. It installs the mail server programs, then calls GoAdmio's other mail commands to configure them. It sets up:
- Postfix, which sends and receives mail
- Dovecot, which lets people read their mail over IMAP and POP3, with Sieve filtering
- SASL, which handles mail logins
- Postfwd, which limits how much mail can be sent (see
postfwd) - SSL certificates for mail, and the SPF, DKIM, and DMARC checks that help your mail avoid spam folders
It installs the mail server only. Webmail programs such as roundcube and snappymail are installed separately.
Before it installs anything, the command checks that your server can send mail to other servers on port 25. Many hosting providers block that port.
The command runs sudo internally, so run it as root or as a user with sudo rights, and the server needs internet access.
[!WARNING] This reinstalls the mail server from scratch. It first removes Postfix, Dovecot, SASL, and Postfwd (and Exim and Sendmail on the RHEL family) and installs them again, so mail is interrupted while it runs and custom mail settings are replaced. The
vmailuser is also deleted with its home folder,/var/vmail, and created again. The command doesn't delete your accounts' own mail folders under/home/<domain>. Run it when a mail outage is acceptable.
Quick start
# Install the mail server
/go/installmail
Syntax
/go/installmail [--skip] [--force]
Every run is recorded in /var/log/go/installmail.log, with the time and the arguments you passed.
Options
| Option | Required | Notes |
|---|---|---|
--skip |
No | Skips the port 25 check and installs anyway. Any argument that contains --skip counts. |
--force |
No | Resets GoAdmio's own mail connection settings to their defaults before installing. See below. |
What --force resets
GoAdmio stores the IMAP and SMTP settings it uses to connect to the mail server. --force sets them back to:
| Setting | Default |
|---|---|
| IMAP | Host localhost, port 143, no encryption, short login off |
| SMTP | No host, port 587, no username, no password |
Output
You see progress messages, such as Installing POSTFIX, the package manager's output, and the names of the steps as they run:
MAILSSL...
POSTCONF...
DOVECONF...
Installing SPF...
DKIM...
Installing DMARC...
When the server already has accounts, you also see TROUBLESHOOT... and AUTODISCOVER....
| Message | Meaning |
|---|---|
Your ISP <name> blocking SMTP Port 25 |
The server can't reach port 25 on Google's mail server, so mail can't be sent. Exit status 1. Nothing is installed. |
Log
Each run appends one line to /var/log/go/installmail.log:
[Nov 21 12:00:00]# installmail --skip
Examples
# Install the mail server (checks port 25 first)
/go/installmail
# Install even if port 25 appears blocked
/go/installmail --skip
# Install and reset GoAdmio's IMAP and SMTP connection settings
/go/installmail --force
# Check that the mail services are running afterward
systemctl status postfix dovecot
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Your ISP <name> blocking SMTP Port 25 |
Your provider blocks outgoing mail on port 25. | Ask the provider to open the port, or run /go/installmail --skip. Mail to other servers won't be delivered until the port is open. Test it later with checkmail. |
| The port check fails even though port 25 is open | The test needs the nc tool, which may be missing, or the network failed for a moment. |
Run package to install nc and whois, then try again. |
| A package fails to install | A repository or network problem. | Read the error, fix it, and run the command again. |
| Mail stopped while the command ran | It removes and reinstalls the mail server. | Expected. Mail resumes when the install and configuration finish. |
gpasswd: group 'opendkim' does not exist (or opendmarc) |
On a first install, the groups may not exist yet at the step that adds postfix to them. |
Run gpasswd -a postfix opendkim and gpasswd -a postfix opendmarc after the install finishes, then restart Postfix. |
| The firewall rules changed | When the server has accounts, the command runs firewall. |
Check the open ports and re-add your own rules with allow. |
| A mail service isn't running | The command enables the services at boot, but doesn't start them itself. | Check with systemctl status and use troubleshoot. |
Details
What gets installed
RHEL family (dnf) |
Debian and Ubuntu (apt) |
|
|---|---|---|
| Removed first | bind-chroot, postfix, postfwd, dovecot, dovecot-pigeonhole, exim, sendmail, and the cyrus-sasl packages |
postfix, postfwd, daemon, the Dovecot packages, sasl2-bin |
| Postfix | postfix, postfix-pcre, postfix-lmdb |
postfix, postfix-pcre, postfix-lmdb |
| Postfwd | postfwd |
postfwd, daemon (runs on 127.0.0.1, port 10040) |
| Dovecot | dovecot, dovecot-pigeonhole |
dovecot-core, dovecot-pop3d, dovecot-imapd, dovecot-sieve, dovecot-managesieved, dovecot-lmtpd |
| SASL | cyrus-sasl, -devel, -gssapi, -md5, -plain |
sasl2-bin |
On the RHEL family, bind-chroot is removed so that Postfix can read the SSL certificate folder.
Steps in order
| Step | Action |
|---|---|
| 1 | Checks that port 25 is reachable (skipped with --skip). |
| 2 | With --force, resets GoAdmio's IMAP and SMTP settings. |
| 3 | Deletes and recreates the vmail user and group (ID 5000, home /var/vmail, no login). |
| 4 | Removes the old mail packages and installs them again (table above). |
| 5 | Creates the Dovecot password file /etc/dovecot/passwd with an account webmaster@<hostname>, readable by root only. |
| 6 | Deletes the folder /home/vmail, and adds the postfix user to the opendkim and opendmarc groups. |
| 7 | Compiles the Sieve junk-mail filters, if they exist (see junk). |
| 8 | Runs mailssl, GoAdmio's postconf and doveconf (which write the Postfix and Dovecot settings), installspf, installdkim, and installdmarc. |
| 9 | If the server has accounts, runs troubleshoot, autodiscover, firewall, checkmx, and vmail. |
| 10 | Enables postfix, postfwd, dovecot, saslauthd, opendkim, opendmarc, and rsyslog at boot. |
[!NOTE] The
webmaster@<hostname>account in step 5 is created with a built-in password hash that is the same on every GoAdmio server. If you don't use that account, remove its line from/etc/dovecot/passwd, or set a password of your own.
flowchart TD
A["installmail"] --> B{"--skip?"}
B -- "No" --> C{"Port 25 reachable?"}
C -- "No" --> X["Print the ISP message, exit 1"]
C -- "Yes" --> D
B -- "Yes" --> D["--force: reset IMAP and SMTP settings"]
D --> E["Recreate the vmail user"]
E --> F["Remove and reinstall Postfix, Dovecot, SASL, Postfwd"]
F --> G["Create the webmaster account, fix groups"]
G --> H["mailssl, postconf, doveconf, SPF, DKIM, DMARC"]
H --> I{"Accounts exist?"}
I -- "Yes" --> J["troubleshoot, autodiscover, firewall, checkmx, vmail"]
I -- "No" --> K["Enable the services at boot"]
J --> K
See also
| Command | Description |
|---|---|
mailssl |
Install SSL certificates for SMTP and IMAP |
doveconf |
Rebuild the Dovecot configuration for the installed Dovecot version, including SSL certificates for the hostname and each domain |
installspf |
Install and configure the Postfix SPF policy daemon |
installdkim |
Install OpenDKIM and configure it for GoAdmio, create the DKIM key of a domain, and print the DNS TXT value for it |
installdmarc |
Install OpenDMARC and set its AuthservID and TrustedAuthservIDs to this server's hostname |
postfwd |
Rebuild the Postfwd rule file that limits how many emails the server, each domain, and each mail login can send |
checkmail |
Test whether outbound mail port 25 works from this server, and whether the SMTP (465) and IMAP (993) SSL certificates are installed |
troubleshoot |
Troubleshoot email problems in GoAdmio |
roundcube |
Install Roundcube webmail on GoAdmio |
snappymail |
Install or upgrade SnappyMail webmail while preserving data |