1

Topic: silent install iredmail issue

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.7.1
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: ubuntu 24.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? no
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Trying to install iredmail with config silently as i want to deploy iredmail automatically with ansible so using below config when running the install script


```
export STORAGE_BASE_DIR='/var/vmail'
export WEB_SERVER='NGINX'
export BACKEND_ORIG='MARIADB'
export BACKEND='MYSQL'
export VMAIL_DB_BIND_PASSWD='huA1lYDQzDx8QWLAiCH7eULFYQ2cYXe0'
export VMAIL_DB_ADMIN_PASSWD='8oFHWdadKGT9KVqMRrp05mLR4D7pz8SM'
export MLMMJADMIN_API_AUTH_TOKEN='VQPvOLUlvJGOBZD40twiG5yDOxGl6rN1'
export NETDATA_DB_PASSWD='ut8AimKaAbKPNxuh00Shi7kmpLa8cvCG'
export MYSQL_ROOT_PASSWD='test'
export FIRST_DOMAIN='example.com'
export DOMAIN_ADMIN_PASSWD_PLAIN='test'
export USE_IREDADMIN='YES'
export USE_ROUNDCUBE='YES'
export USE_NETDATA='YES'
export USE_FAIL2BAN='YES'
export AMAVISD_DB_PASSWD='HiJm5nkeFpWhUAg7kp4Ggggp90vS94Z1'
export IREDADMIN_DB_PASSWD='DmwNS13d1oZk04Rwpoq00mu9z2zVU1xV'
export RCM_DB_PASSWD='7tt0ZngqYEDVV7gvmOlYJVv4aEAYCS j4'
export SOGO_DB_PASSWD='BAuxqj13PsXxKs9ENIiAOC0qiLe1QsRw'
export SOGO_SIEVE_MASTER_PASSWD='BrxY08k6YeYn0SbG3WX1qAipVfOxHYuf'
export IREDAPD_DB_PASSWD='RBFLsEOKTAjd5J44rcB7DICkeTCOsRjP'
export FAIL2BAN_DB_PASSWD='RiSeYZG08I8olfwH7AUEH27Rxtx84kEj'
#EOF
```

but everytime when i try to run it it does not install nginx at all while i nthe config it says to use NGINX, why is that?

It also skips a lot of steps

< SKIP > Function: generate_ssl_keys.
[ INFO ] Create required system accounts.
< SKIP > Function: add_user_vmail.
< SKIP > Function: add_user_mlmmj.
< SKIP > Function: add_user_iredadmin.
< SKIP > Function: add_user_iredapd.
< SKIP > Function: postfix_setup.
< SKIP > Function: dovecot_setup.
< SKIP > Function: web_server_config.
< SKIP > Function: mlmmj_config.
< SKIP > Function: mlmmjadmin_config.
< SKIP > Function: clamav_config.
< SKIP > Function: amavisd_config.
< SKIP > Function: sa_config.
< SKIP > Function: iredapd_setup.
< SKIP > Function: cleanup.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: silent install iredmail issue

Remove file "runtime/install.status" under iRedMail directory and try again.

3 (edited by viserion 2024-12-31 00:34:39)

Re: silent install iredmail issue

seems it does not recognize the config file as when i try to install it without the interface popping up it just pops it up while a config is there and contains information


also whenever i start the installation it just cleans config and need to cp it again and when i start the installation it just wont read the config

does it auto remove inside /root/ folder? as my ansible script places the config file from the download folder of the normal user to /root/iRedMail_folder/config but somehow it wont do this?


```
- name: Extract iRedMail installer
  ansible.builtin.unarchive:
    src: /tmp/iRedMail-1.7.1.tar.gz
    dest: /~/
    remote_src: yes

- name: Ensure iRedMail directory exists
  ansible.builtin.file:
    path: /root/iRedMail-1.7.1
    state: directory
    mode: '0755'

- name: Remove install.status if it exists
  ansible.builtin.file:
    path: /root/iRedMail-1.7.1/runtime/install.status
    state: absent

- name: Copy config file using cp command
  ansible.builtin.shell: |
    cp {{ playbook_dir }}/roles/iredmail/files/config /root/iRedMail-1.7.1/config
  args:
    executable: /bin/bash

- name: Verify if config file was copied
  ansible.builtin.command: cat /root/iRedMail-1.7.1/config
  register: config_content

- name: Debug config content
  ansible.builtin.debug:
    msg: "Config file content:\n{{ config_content.stdout }}"

- name: Run iRedMail installer with prepared config
  ansible.builtin.shell: |
    chmod +x iRedMail.sh && \
    AUTO_USE_EXISTING_CONFIG_FILE=y \
    AUTO_INSTALL_WITHOUT_CONFIRM=y \
    AUTO_CLEANUP_REMOVE_SENDMAIL=y \
    AUTO_CLEANUP_REPLACE_FIREWALL_RULES=n \
    AUTO_CLEANUP_RESTART_FIREWALL=n \
    AUTO_CLEANUP_REPLACE_MYSQL_CONFIG=y \
    ./iRedMail.sh
  args:
    chdir: /root/iRedMail-1.7.1
    creates: /etc/iredmail

```

4

Re: silent install iredmail issue

Setup a VM and finish the iRedMail installation (at least the setup wizard) then you get a working `config` file, copy it for your Ansible installation.

5

Re: silent install iredmail issue

viserion wrote:

    creates: /etc/iredmail

iRedMail installer creates /etc/iredmail-release, not /etc/iredmail

6 (edited by viserion 2025-01-06 21:03:27)

Re: silent install iredmail issue

i did follow the iredmail installation till it ask to verify if i agree then i enter N and then i use that same config to install a new one but it says the following:

```
viserion@mail:/tmp/iRedMail-1.7.1$ sudo ./iRedMail.sh -d
[ INFO ] Checking configuration file: /tmp/iRedMail-1.7.1/config ... [ INFO ] Found, but not finished. Launching installa
tion wizard.
```

After it said above it also cleans the config so it is empty.

Below is the config i obtained after ocmpleting install:

export STORAGE_BASE_DIR='/var/vmail'
export WEB_SERVER='NGINX'
export BACKEND_ORIG='MARIADB'
export BACKEND='MYSQL'
export VMAIL_DB_BIND_PASSWD='X263K1emmGnUws94HwOQjlh2wSSxXezq'
export VMAIL_DB_ADMIN_PASSWD='dEixZlaN20C1nXdWFaPVZap1LSSmMHOW'
export MLMMJADMIN_API_AUTH_TOKEN='D2ZMxOiloIkh2OVxd3sM4FOXoPPd3DGG'
export NETDATA_DB_PASSWD='woceMlTUWMArQyp9HON1TRedum0eU0O7'
export MYSQL_ROOT_PASSWD=''
export FIRST_DOMAIN='example.com'
export DOMAIN_ADMIN_PASSWD_PLAIN=''
export USE_IREDADMIN='YES'
export USE_ROUNDCUBE='YES'
export USE_NETDATA='YES'
export USE_FAIL2BAN='YES'
export AMAVISD_DB_PASSWD='5Qa8r6sv1pzN0OtYqTBiTTC2q5lrNBzN'
export IREDADMIN_DB_PASSWD='V2dLxzobkdngH9ouMZE4qekJjTQ5mtTm'
export RCM_DB_PASSWD='qD87S2n0nz2umClh05IFtZWXgPpdOFTz'
export SOGO_DB_PASSWD='ZtIOki7L42Y6q26U7MOv91vJdGa0LpbO'
export SOGO_SIEVE_MASTER_PASSWD='7JWqSw5Nvlw0GhDwiJu85UQvDGrZ36GW'
export IREDAPD_DB_PASSWD='3dkvCaQqgov8UbyB5UGZuDhsn7PictIP'
export FAIL2BAN_DB_PASSWD='UEFMAKHG9dAAkJ5Q1TG6FmZp7MQUiUWz'
#EOF

7

Re: silent install iredmail issue

it somehow works now but it still requires me to press enter which is not possible when running ansible. Is there a way to bypass this?

8

Re: silent install iredmail issue

also it crashes with dovecat installation with below error:

x dovecot.service - Dovecot IMAP/POP3 email server
     Loaded: loaded (/lib/systemd/system/dovecot.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2025-01-06 15:45:37 CET; 5ms ago
       Docs: man:dovecot(1)
    Process: 52606 ExecStart=/usr/sbin/dovecot -F (code=exited, status=89)
   Main PID: 52606 (code=exited, status=89)
        CPU: 12ms

Jan 06 15:45:37 viserion-Virtual-Machine systemd[1]: Starting Dovecot IMAP/POP3 email server...
Jan 06 15:45:37 viserion-Virtual-Machine dovecot[52606]: doveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/10-ssl.conf line 12: ssl_cert: Can't open file /etc/dovecot/private/dovecot.pem: No such file or directory
Jan 06 15:45:37 viserion-Virtual-Machine systemd[1]: dovecot.service: Main process exited, code=exited, status=89/n/a
Jan 06 15:45:37 viserion-Virtual-Machine systemd[1]: dovecot.service: Failed with result 'exit-code'.
Jan 06 15:45:37 viserion-Virtual-Machine systemd[1]: Failed to start Dovecot IMAP/POP3 email server.
dpkg: error processing package dovecot-core (--configure):
installed dovecot-core package post-installation script subprocess returned error exit status 1
Processing triggers for php8.1-cli (8.1.2-1ubuntu2.20) ...
Processing triggers for php8.1-fpm (8.1.2-1ubuntu2.20) ...
Errors were encountered while processing:
dovecot-core
E: Sub-process /usr/bin/dpkg returned an error code (1)
<< ERROR >> Installation failed, please check the terminal output.
<< ERROR >> If you're not sure what the problem is, try to get help in iRedMail
<< ERROR >> forum: https://forum.iredmail.org/

9 (edited by viserion 2025-01-06 23:05:21)

Re: silent install iredmail issue

he also still ask about firewall rules at the end which again requires input which is not possible when running ansible. it should be silent install so no user input required but still asks for it


Processing triggers for install-info (6.8-4build1) ...
Processing triggers for man-db (2.10.2-1) ...
Adding component(s) 'multiverse' to all repositories.
Press [ENTER] to continue or Ctrl-c to cancel.

10

Re: silent install iredmail issue

There is no complete unattended silent install afaik