├── .github
└── ISSUE_TEMPLATE
│ └── issue-or-bug-report.md
├── .gitignore
├── ChangeLog
├── Documentations
├── LICENSE
├── README.md
├── conf
├── amavisd
├── clamav
├── core
├── dovecot
├── fail2ban
├── global
├── iredadmin
├── iredapd
├── logwatch
├── memcached
├── mlmmj
├── mysql
├── netdata
├── nginx
├── openldap
├── php
├── postfix
├── postgresql
├── roundcube
├── sogo
├── spamassassin
└── web_server
├── dialog
├── config_via_dialog.sh
├── ldap_config.sh
├── mysql_config.sh
├── optional_components.sh
├── pgsql_config.sh
├── virtual_domain_config.sh
└── web_applications.sh
├── functions
├── amavisd.sh
├── backend.sh
├── clamav.sh
├── cleanup.sh
├── dovecot.sh
├── fail2ban.sh
├── iredadmin.sh
├── iredapd.sh
├── ldap_server.sh
├── mlmmj.sh
├── mysql.sh
├── netdata.sh
├── nginx.sh
├── openldap.sh
├── optional_components.sh
├── packages.sh
├── packages_freebsd.sh
├── php.sh
├── postfix.sh
├── postgresql.sh
├── roundcubemail.sh
├── sogo.sh
├── spamassassin.sh
├── system_accounts.sh
└── web_server.sh
├── iRedMail.sh
├── pkgs
├── get_all.sh
├── pkgs.freebsd.sha256
├── pkgs.openbsd.sha256
└── pkgs.sha256
├── samples
├── amavisd
│ ├── amavisd.conf
│ ├── amavisd.mysql
│ ├── amavisd.pgsql
│ ├── amavisd.schema
│ └── default_spam_policy.sql
├── dovecot
│ ├── dovecot-last-login.conf
│ ├── dovecot-ldap.conf
│ ├── dovecot-share-folder.conf
│ ├── dovecot-sql.conf
│ ├── dovecot-used-quota.conf
│ ├── dovecot.conf
│ ├── dovecot.sieve
│ ├── dovecot2-quota-warning.sh
│ ├── sql
│ │ ├── imap_share_folder.mysql
│ │ ├── last_login.mysql
│ │ └── used_quota.mysql
│ └── systemd
│ │ └── override.conf
├── fail2ban
│ ├── action.d
│ │ └── banned_db.conf
│ ├── bin
│ │ └── fail2ban_banned_db
│ ├── fail2ban.local
│ ├── filter.d
│ │ ├── dovecot.iredmail.conf
│ │ ├── postfix-pregreet.iredmail.conf
│ │ ├── postfix.iredmail.conf
│ │ └── roundcube.iredmail.conf
│ ├── jail.d
│ │ ├── dovecot.local
│ │ ├── nginx-http-auth.local
│ │ ├── postfix-pregreet.local
│ │ ├── postfix.local
│ │ ├── roundcube.local
│ │ ├── sogo.local
│ │ └── sshd.local
│ ├── jail.local
│ ├── openbsd
│ │ └── rc
│ └── sql
│ │ ├── fail2ban.mysql
│ │ └── fail2ban.pgsql
├── firewall
│ ├── firewalld
│ │ ├── services
│ │ │ └── ssh.xml
│ │ └── zones
│ │ │ └── iredmail.xml
│ ├── iptables
│ │ ├── ip6tables.init.debian
│ │ ├── ip6tables.rules
│ │ ├── iptables.init.debian
│ │ └── iptables.rules
│ └── nftables.conf
├── freebsd
│ ├── newsyslog.conf.d
│ │ ├── dovecot.conf
│ │ ├── iredapd.conf
│ │ ├── mlmmjadmin.conf
│ │ ├── php-fpm.conf
│ │ └── slapd.conf
│ └── syslog.d
│ │ ├── dovecot.conf
│ │ ├── fail2ban.conf
│ │ ├── iredapd.conf
│ │ ├── mlmmjadmin.conf
│ │ ├── php-fpm.conf
│ │ └── slapd.conf
├── iredmail
│ ├── iredmail.mysql
│ ├── iredmail.pgsql
│ └── iredmail.schema
├── logrotate
│ ├── dovecot
│ ├── iredapd
│ ├── mlmmjadmin
│ ├── openldap
│ └── php-fpm
├── mlmmj
│ ├── mlmmj-amime-receive
│ └── mlmmjadmin.settings.py
├── mysql
│ ├── my.cnf
│ └── sql
│ │ ├── add_first_domain_and_user.sql
│ │ ├── delete_anonymous_user.sql
│ │ ├── init_vmail_db.sql
│ │ └── remote_grant_permission.sql
├── netdata
│ ├── go.d.conf
│ ├── go.d
│ │ ├── fail2ban.conf
│ │ ├── memcached.conf
│ │ ├── mysql.conf
│ │ ├── nginx.conf
│ │ ├── openldap.conf
│ │ ├── phpfpm.conf
│ │ └── postgres.conf
│ ├── health_alarm_notify.conf
│ ├── netdata.conf
│ ├── python.d.conf
│ └── systemd-limits.conf
├── nginx
│ ├── conf-available
│ │ ├── 0-general.conf
│ │ ├── cache.conf
│ │ ├── client_max_body_size.conf
│ │ ├── default_type.conf
│ │ ├── gzip.conf
│ │ ├── headers.conf
│ │ ├── log.conf
│ │ ├── mime_types.conf
│ │ ├── php_fpm.conf
│ │ ├── sendfile.conf
│ │ ├── server_tokens.conf
│ │ └── types_hash_max_size.conf
│ ├── nginx.conf
│ ├── sites-available
│ │ ├── 00-default-ssl.conf
│ │ └── 00-default.conf
│ └── templates
│ │ ├── adminer.tmpl
│ │ ├── fastcgi_php.tmpl
│ │ ├── hsts.tmpl
│ │ ├── iredadmin-subdomain.tmpl
│ │ ├── iredadmin.tmpl
│ │ ├── misc.tmpl
│ │ ├── netdata-subdomain.tmpl
│ │ ├── netdata.tmpl
│ │ ├── php-catchall.tmpl
│ │ ├── redirect_to_https.tmpl
│ │ ├── roundcube-subdomain.tmpl
│ │ ├── roundcube.tmpl
│ │ ├── sogo-subdomain.tmpl
│ │ ├── sogo.tmpl
│ │ ├── ssl.tmpl
│ │ └── stub_status.tmpl
├── openbsd
│ ├── ldapd.conf
│ └── pf.conf
├── openldap
│ ├── calentry.schema
│ ├── calresource.schema
│ ├── ldap.conf
│ └── slapd.conf
├── php
│ └── fpm
│ │ └── pool.d
│ │ └── www.conf
├── postfix
│ ├── command_filter.pcre
│ ├── freebsd
│ │ └── mailer.conf
│ ├── helo_access.pcre
│ ├── ldap
│ │ ├── catchall_maps.cf
│ │ ├── recipient_bcc_maps_domain.cf
│ │ ├── recipient_bcc_maps_user.cf
│ │ ├── relay_domains.cf
│ │ ├── sender_bcc_maps_domain.cf
│ │ ├── sender_bcc_maps_user.cf
│ │ ├── sender_dependent_relayhost_maps_domain.cf
│ │ ├── sender_dependent_relayhost_maps_user.cf
│ │ ├── sender_login_maps.cf
│ │ ├── transport_maps_domain.cf
│ │ ├── transport_maps_user.cf
│ │ ├── virtual_alias_maps.cf
│ │ ├── virtual_group_maps.cf
│ │ ├── virtual_group_members_maps.cf
│ │ ├── virtual_mailbox_domains.cf
│ │ └── virtual_mailbox_maps.cf
│ ├── main.cf
│ ├── main.cf.amavisd
│ ├── main.cf.dovecot
│ ├── main.cf.ldap
│ ├── main.cf.mlmmj
│ ├── main.cf.mysql
│ ├── main.cf.pgsql
│ ├── main.cf.postscreen
│ ├── master.cf
│ ├── mysql
│ │ ├── catchall_maps.cf
│ │ ├── domain_alias_catchall_maps.cf
│ │ ├── domain_alias_maps.cf
│ │ ├── recipient_bcc_maps_domain.cf
│ │ ├── recipient_bcc_maps_user.cf
│ │ ├── relay_domains.cf
│ │ ├── sender_bcc_maps_domain.cf
│ │ ├── sender_bcc_maps_user.cf
│ │ ├── sender_dependent_relayhost_maps.cf
│ │ ├── sender_login_maps.cf
│ │ ├── transport_maps_domain.cf
│ │ ├── transport_maps_maillist.cf
│ │ ├── transport_maps_user.cf
│ │ ├── virtual_alias_maps.cf
│ │ ├── virtual_mailbox_domains.cf
│ │ └── virtual_mailbox_maps.cf
│ ├── pgsql
│ │ ├── catchall_maps.cf
│ │ ├── domain_alias_catchall_maps.cf
│ │ ├── domain_alias_maps.cf
│ │ ├── recipient_bcc_maps_domain.cf
│ │ ├── recipient_bcc_maps_user.cf
│ │ ├── relay_domains.cf
│ │ ├── sender_bcc_maps_domain.cf
│ │ ├── sender_bcc_maps_user.cf
│ │ ├── sender_dependent_relayhost_maps.cf
│ │ ├── sender_login_maps.cf
│ │ ├── transport_maps_domain.cf
│ │ ├── transport_maps_maillist.cf
│ │ ├── transport_maps_user.cf
│ │ ├── virtual_alias_maps.cf
│ │ ├── virtual_mailbox_domains.cf
│ │ └── virtual_mailbox_maps.cf
│ └── postscreen_access.cidr
├── postgresql
│ └── sql
│ │ ├── add_first_domain_and_user.sql
│ │ ├── grant_permissions.sql
│ │ └── init_vmail_db.sql
├── roundcubemail
│ ├── config.inc.php
│ └── global_ldap_address_book.inc.php
├── rsyslog.d
│ ├── 1-iredmail-dovecot.conf
│ ├── 1-iredmail-fail2ban.conf
│ ├── 1-iredmail-iredapd.conf
│ ├── 1-iredmail-mlmmjadmin.conf
│ ├── 1-iredmail-openldap.conf
│ └── 1-iredmail-phpfpm.conf
├── sogo
│ ├── sogo.conf
│ ├── sogo.cron
│ └── sql
│ │ └── create_view.pgsql
├── spamassassin
│ ├── local.cf
│ └── razor.conf
├── systemd
│ ├── clamd.service.d
│ │ └── override.conf
│ ├── mariadb.service.d
│ │ └── override.conf
│ └── slapd.service.d
│ │ └── override.conf
└── yum
│ ├── CentOS-Linux-AppStream.repo
│ ├── CentOS-Linux-PowerTools.repo
│ ├── CentOS-Stream-AppStream.repo
│ ├── CentOS-Stream-PowerTools.repo
│ └── symas-openldap.repo
├── tools
├── add_enabled_service.py
├── backup_mysql.sh
├── backup_openldap.sh
├── backup_pgsql.sh
├── backup_sogo.sh
├── create_mail_user_OpenLDAP.py
├── create_mail_user_OpenLDAP.sh
├── create_mail_user_SQL.sh
├── enable_postscreen.sh
├── fail2ban_unban_ip.sh
├── find_sasl_login_ip.sh
├── find_top_sasl_usernames.sh
├── generate_ssl_keys.sh
├── kill_high_cpu_sogo_process.sh
├── ldap_assign_user_to_groups.py
├── ldap_move_members_to_another_group.py
└── migrate_sql_alias_table.py
└── update
├── 0.9.8
├── amavisd.mysql
├── amavisd.pgsql
├── iredmail.mysql
└── iredmail.pgsql
├── 0.9.9
├── iredmail.mysql
└── iredmail.pgsql
├── 1.0
├── iredmail.mysql
└── iredmail.pgsql
├── 1.2
└── last_login.mysql
├── 1.4.0
├── iredmail.mysql
└── iredmail.pgsql
├── 1.4.1
├── iredmail.mysql
├── iredmail.pgsql
├── sogo.mysql
├── sogo.pgsql
└── update-ldap.py
├── 1.4.2
├── iredmail.mysql
├── iredmail.pgsql
└── sogo.pgsql
├── 1.6.0
└── sogo_view.pgsql
├── 1.6.3
└── iredmail.mysql
├── 1.7.0
├── fail2ban.mysql
└── fail2ban.pgsql
├── 1.7.1
└── amavisd.mysql
├── 1.7.2
└── vmail.mysql
├── 1.7.3
├── deleted_mailboxes.mysql
├── iredadmin.mysql
├── vmail.mysql
└── vmail.pgsql
├── README.md
└── ldap
├── README.md
└── update-ldap-dovecot-2.3.py
/.github/ISSUE_TEMPLATE/issue-or-bug-report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Issue or bug report
3 | about: Issue or bug report
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER:
11 |
12 | - iRedMail version (check /etc/iredmail-release):
13 | - Deployed with iRedMail Easy or the downloadable installer?
14 | - Linux/BSD distribution name and version:
15 | - Store mail accounts in which backend (LDAP/MySQL/PGSQL):
16 | - Web server (Apache or Nginx):
17 | - Manage mail accounts with iRedAdmin-Pro?
18 | - [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
19 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 |
--------------------------------------------------------------------------------
/Documentations:
--------------------------------------------------------------------------------
1 | * iRedMail web site: https://www.iredmail.org/
2 | * Documentations: https://docs.iredmail.org/
3 | * Support Forum: https://forum.iredmail.org/
4 | * iRedMail upgrade tutorials: https://docs.iredmail.org/iredmail.releases.html
5 | * iRedAdmin upgrade tutorials: https://docs.iredmail.org/migrate.or.upgrade.iredadmin.html
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | iRedMail is a full-featured mail server solution: https://www.iredmail.org/
2 |
3 | > Don't forget to check out our lightweight email archiving software: https://spiderd.io/
4 |
5 | It supports few mainstream Linux/BSD distributions:
6 |
7 | - CentOS Steam 9, 10.
8 | - Rocky Linux 9
9 | - AlmaLinux 9
10 | - Debian 12
11 | - Ubuntu 22.04, 24.04 (Recommend)
12 | - FreeBSD 14.x
13 | - OpenBSD 7.7
14 |
15 | More info:
16 |
17 | - License: GPL v3
18 | - Authors: Zhang Huangbin (zhb _at_ iredmail.org)
19 | - Check and download the latest stable release from [website](https://www.iredmail.org/download.html)
20 | - Install iRedMail by following our installation guides strictly:
21 | [Installation Guides](https://docs.iredmail.org/#install)
22 | - Community, bug report, feature requests:
23 | [online support forum](https://forum.iredmail.org/)
24 | - We offer [paid support services](https://www.iredmail.org/support.html)
25 | - Source packages patched or modified for RHEL/CentOS can be found
26 | [here](https://dl.iredmail.org/yum/srpms/), other RPM packages are all
27 | installed from official yum repository and
28 | [EPEL](http://fedoraproject.org/wiki/EPEL).
29 |
30 | We recommend to deploy iRedMail server with the [iRedMail Easy platform](https://www.iredmail.org/easy.html),
31 | it offers easy deployment, one-click upgrade, and tech support via the ticket
32 | system. Check our [website](https://www.iredmail.org/easy.html) for more details.
33 |
34 | There's also an all-in-one Docker edition here: [iredmail/dockerized](https://github.com/iredmail/dockerized).
35 |
--------------------------------------------------------------------------------
/conf/clamav:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Author: Zhang Huangbin (zhb _at_ iredmail.org)
4 |
5 | #---------------------------------------------------------------------
6 | # This file is part of iRedMail, which is an open source mail server
7 | # solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
8 | #
9 | # iRedMail is free software: you can redistribute it and/or modify
10 | # it under the terms of the GNU General Public License as published by
11 | # the Free Software Foundation, either version 3 of the License, or
12 | # (at your option) any later version.
13 | #
14 | # iRedMail is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU General Public License
20 | # along with iRedMail. If not, see .
21 | #---------------------------------------------------------------------
22 |
23 | export SYS_USER_CLAMAV='clamav'
24 | export SYS_GROUP_CLAMAV='clamav'
25 | export CLAMAV_CLAMD_SERVICE_NAME='clamd'
26 | export CLAMAV_FRESHCLAMD_RC_SCRIPT_NAME='freshclamd'
27 |
28 | export CLAMD_LOG_DIR='/var/log/clamav'
29 | export CLAMD_LOGFILE="${CLAMD_LOG_DIR}/clamd.log"
30 | # CLAMD_BIND_HOST is configured in conf/global
31 | export CLAMD_LOCAL_SOCKET='/tmp/clamd.socket'
32 |
33 | export FRESHCLAM_CONF='/etc/freshclam.conf'
34 | export FRESHCLAM_LOGFILE="${CLAMD_LOG_DIR}/freshclam.log"
35 | export FRESHCLAM_PID_FILE='/var/run/clamav/freshclam.pid'
36 |
37 | # Update database immediately
38 | export FRESHCLAM_UPDATE_IMMEDIATELY="${FRESHCLAM_UPDATE_IMMEDIATELY:=YES}"
39 |
40 | # Clamav.
41 | if [ X"${DISTRO}" == X'RHEL' ]; then
42 | export SYS_USER_CLAMAV='amavis'
43 | export SYS_GROUP_CLAMAV='amavis'
44 |
45 | export CLAMD_CONF='/etc/clamd.d/amavisd.conf'
46 | export CLAMD_LOCAL_SOCKET='/var/run/clamd.amavisd/clamd.socket'
47 |
48 | export CLAMAV_CLAMD_SERVICE_NAME='clamd@amavisd'
49 |
50 | elif [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
51 | export CLAMAV_CLAMD_SERVICE_NAME='clamav-daemon'
52 | export CLAMAV_FRESHCLAMD_RC_SCRIPT_NAME='clamav-freshclam'
53 |
54 | export CLAMD_CONF='/etc/clamav/clamd.conf'
55 | export FRESHCLAM_CONF='/etc/clamav/freshclam.conf'
56 |
57 | export CLAMD_LOCAL_SOCKET='/var/run/clamav/clamd.ctl'
58 |
59 | elif [ X"${DISTRO}" == X'FREEBSD' ]; then
60 | export CLAMD_CONF='/usr/local/etc/clamd.conf'
61 | export FRESHCLAM_CONF='/usr/local/etc/freshclam.conf'
62 | export CLAMD_LOCAL_SOCKET='/var/run/clamav/clamd.sock'
63 |
64 | elif [ X"${DISTRO}" == X'OPENBSD' ]; then
65 | export CLAMD_CONF='/etc/clamd.conf'
66 | export SYS_USER_CLAMAV='_clamav'
67 | export SYS_GROUP_CLAMAV='_clamav'
68 | export CLAMAV_FRESHCLAMD_RC_SCRIPT_NAME='freshclam'
69 |
70 | export FRESHCLAM_PID_FILE='/var/run/freshclam.pid'
71 | fi
72 |
--------------------------------------------------------------------------------
/conf/fail2ban:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Author: Zhang Huangbin (zhb _at_ iredmail.org)
4 |
5 | #---------------------------------------------------------------------
6 | # This file is part of iRedMail, which is an open source mail server
7 | # solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
8 | #
9 | # iRedMail is free software: you can redistribute it and/or modify
10 | # it under the terms of the GNU General Public License as published by
11 | # the Free Software Foundation, either version 3 of the License, or
12 | # (at your option) any later version.
13 | #
14 | # iRedMail is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU General Public License
20 | # along with iRedMail. If not, see .
21 | #---------------------------------------------------------------------
22 |
23 | # Variables for Fail2ban and related.
24 |
25 | export FAIL2BAN_CONF_ROOT='/etc/fail2ban'
26 |
27 | # Version number in source tarball. Used on OpenBSD.
28 | export FAIL2BAN_VERSION="1.1.0"
29 |
30 | if [ X"${DISTRO}" == X"FREEBSD" ]; then
31 | export FAIL2BAN_CONF_ROOT='/usr/local/etc/fail2ban'
32 | export FAIL2BAN_SOCKET='/var/run/fail2ban.sock'
33 | fi
34 |
35 | export FAIL2BAN_MAIN_CONF="${FAIL2BAN_CONF_ROOT}/fail2ban.local"
36 | export FAIL2BAN_JAIL_CONF="${FAIL2BAN_CONF_ROOT}/jail.conf"
37 | export FAIL2BAN_JAIL_LOCAL_CONF="${FAIL2BAN_CONF_ROOT}/jail.local"
38 | export FAIL2BAN_JAIL_CONF_DIR="${FAIL2BAN_CONF_ROOT}/jail.d"
39 | export FAIL2BAN_FILTER_DIR="${FAIL2BAN_CONF_ROOT}/filter.d"
40 | export FAIL2BAN_ACTION_DIR="${FAIL2BAN_CONF_ROOT}/action.d"
41 |
42 | export FAIL2BAN_FILTER_POSTFIX="postfix.iredmail"
43 | export FAIL2BAN_FILTER_ROUNDCUBE="roundcube.iredmail"
44 | export FAIL2BAN_FILTER_DOVECOT="dovecot.iredmail"
45 |
46 | export FAIL2BAN_DISABLED_SERVICES="${PORT_HTTP},${HTTPS_PORT},25,587,465,110,995,143,993,${MANAGESIEVE_PORT}"
47 |
48 | export FAIL2BAN_LOG_FILE='/var/log/fail2ban.log'
49 | export FAIL2BAN_SYSLOG_FACILITY='daemon'
50 |
51 | # Firewall command (fail2ban/action.d/[NAME].conf)
52 | if [ X"${KERNEL_NAME}" == X'LINUX' ]; then
53 | export FAIL2BAN_ACTION='iptables-multiport'
54 |
55 | if [ X"${USE_NFTABLES}" == X'YES' ]; then
56 | export FAIL2BAN_ACTION='nftables-multiport'
57 | fi
58 | elif [ X"${KERNEL_NAME}" == X'FREEBSD' ]; then
59 | # Use ipfw by default
60 | export FAIL2BAN_ACTION='ipfw'
61 |
62 | # Use pf if it's loaded.
63 | if grep '^pf_load=.YES' /boot/defaults/loader.conf >/dev/null; then
64 | export FAIL2BAN_ACTION='pf'
65 | fi
66 | elif [ X"${KERNEL_NAME}" == X'OPENBSD' ]; then
67 | export FAIL2BAN_ACTION='pf'
68 | fi
69 |
70 | # SQL db.
71 | export FAIL2BAN_DB_NAME='fail2ban'
72 | export FAIL2BAN_DB_USER='fail2ban'
73 |
--------------------------------------------------------------------------------
/conf/iredadmin:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Author: Zhang Huangbin (zhb _at_ iredmail.org)
4 |
5 | #---------------------------------------------------------------------
6 | # This file is part of iRedMail, which is an open source mail server
7 | # solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
8 | #
9 | # iRedMail is free software: you can redistribute it and/or modify
10 | # it under the terms of the GNU General Public License as published by
11 | # the Free Software Foundation, either version 3 of the License, or
12 | # (at your option) any later version.
13 | #
14 | # iRedMail is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU General Public License
20 | # along with iRedMail. If not, see .
21 | #---------------------------------------------------------------------
22 |
23 | export IREDADMIN_VERSION='2.6'
24 | export IREDADMIN_TARBALL="iRedAdmin-${IREDADMIN_VERSION}.tar.gz"
25 | export IREDADMIN_HTTPD_ROOT="${HTTPD_SERVERROOT}/iRedAdmin-${IREDADMIN_VERSION}"
26 | export IREDADMIN_HTTPD_ROOT_SYMBOL_LINK="${HTTPD_SERVERROOT}/iredadmin"
27 |
28 | export IREDADMIN_HOME_DIR='/home/iredadmin'
29 | export SYS_USER_IREDADMIN='iredadmin'
30 | export SYS_GROUP_IREDADMIN="${SYS_USER_IREDADMIN}"
31 |
32 | # MySQL database name, username and password.
33 | export IREDADMIN_DB_NAME="${SYS_USER_IREDADMIN}"
34 | export IREDADMIN_DB_USER="${SYS_USER_IREDADMIN}"
35 |
36 | export IREDADMIN_BIND_ADDRESS='127.0.0.1'
37 | export IREDADMIN_LISTEN_PORT='7791'
38 |
--------------------------------------------------------------------------------
/conf/iredapd:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Author: Zhang Huangbin (zhb _at_ iredmail.org)
4 |
5 | #---------------------------------------------------------------------
6 | # This file is part of iRedMail, which is an open source mail server
7 | # solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
8 | #
9 | # iRedMail is free software: you can redistribute it and/or modify
10 | # it under the terms of the GNU General Public License as published by
11 | # the Free Software Foundation, either version 3 of the License, or
12 | # (at your option) any later version.
13 | #
14 | # iRedMail is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU General Public License
20 | # along with iRedMail. If not, see .
21 | #---------------------------------------------------------------------
22 |
23 | export IREDAPD_VERSION='5.9.1'
24 | export SYS_USER_IREDAPD='iredapd'
25 | export SYS_GROUP_IREDAPD='iredapd'
26 |
27 | export IREDAPD_TARBALL="iRedAPD-${IREDAPD_VERSION}.tar.gz"
28 | export IREDAPD_PARENT_DIR='/opt'
29 | export IREDAPD_ROOT_DIR="${IREDAPD_PARENT_DIR}/iRedAPD-${IREDAPD_VERSION}"
30 | export IREDAPD_ROOT_DIR_SYMBOL_LINK="${IREDAPD_PARENT_DIR}/iredapd"
31 | export IREDAPD_CONF="${IREDAPD_ROOT_DIR_SYMBOL_LINK}/settings.py"
32 |
33 | # IREDAPD_BIND_HOST is configured in conf/global
34 | export IREDAPD_LISTEN_PORT='7777'
35 | export IREDAPD_SRS_FORWARD_PORT='7778'
36 | export IREDAPD_SRS_REVERSE_PORT='7779'
37 | export IREDAPD_SRS_SECRET="$(${RANDOM_STRING})"
38 |
39 | export IREDAPD_PID_FILE='/var/run/iredapd.pid'
40 | export IREDAPD_LOG_DIR='/var/log/iredapd'
41 | export IREDAPD_LOG_FILE="${IREDAPD_LOG_DIR}/iredapd.log"
42 | export IREDAPD_LOGROTATE_FILE="${LOGROTATE_DIR}/iredapd"
43 |
44 | # Database
45 | # IREDAPD_DB_PASSWD is generated in dialog/optional_components.sh.
46 | export IREDAPD_DB_NAME='iredapd'
47 | export IREDAPD_DB_USER='iredapd'
48 |
49 |
50 | if [ X"${DISTRO}" == X'FREEBSD' ]; then
51 | export IREDAPD_LOGROTATE_FILE="${LOGROTATE_DIR}/iredapd.conf"
52 | fi
53 |
--------------------------------------------------------------------------------
/conf/logwatch:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Author: Zhang Huangbin (zhb _at_ iredmail.org)
4 |
5 | #---------------------------------------------------------------------
6 | # This file is part of iRedMail, which is an open source mail server
7 | # solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
8 | #
9 | # iRedMail is free software: you can redistribute it and/or modify
10 | # it under the terms of the GNU General Public License as published by
11 | # the Free Software Foundation, either version 3 of the License, or
12 | # (at your option) any later version.
13 | #
14 | # iRedMail is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU General Public License
20 | # along with iRedMail. If not, see .
21 | #---------------------------------------------------------------------
22 |
23 | # OpenBSD doesn't have logwatch.
24 | if [ X"${KERNEL_NAME}" == X'LINUX' ]; then
25 | export LOGWATCH_SERVICES_DIR='/etc/logwatch/conf/services'
26 | elif [ X"${KERNEL_NAME}" == X'FREEBSD' ]; then
27 | export LOGWATCH_SERVICES_DIR='/usr/local/etc/logwatch/services'
28 | fi
29 |
--------------------------------------------------------------------------------
/conf/memcached:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Author: Zhang Huangbin (zhb _at_ iredmail.org)
4 |
5 | #---------------------------------------------------------------------
6 | # This file is part of iRedMail, which is an open source mail server
7 | # solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
8 | #
9 | # iRedMail is free software: you can redistribute it and/or modify
10 | # it under the terms of the GNU General Public License as published by
11 | # the Free Software Foundation, either version 3 of the License, or
12 | # (at your option) any later version.
13 | #
14 | # iRedMail is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU General Public License
20 | # along with iRedMail. If not, see .
21 | #---------------------------------------------------------------------
22 |
23 | # Memcached
24 | export MEMCACHED_BIND_ADDRESS="${MEMCACHED_BIND_ADDRESS:=${LOCAL_ADDRESS}}"
25 |
26 | export MEMCACHED_RC_SCRIPT_NAME='memcached'
27 |
28 | if [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
29 | export MEMCACHED_CONF='/etc/memcached.conf'
30 | elif [ X"${DISTRO}" == X'OPENBSD' ]; then
31 | export MEMCACHED_DAEMIN_USER='_memcached'
32 | fi
33 |
--------------------------------------------------------------------------------
/conf/mlmmj:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Author: Zhang Huangbin (zhb _at_ iredmail.org)
4 |
5 | #---------------------------------------------------------------------
6 | # This file is part of iRedMail, which is an open source mail server
7 | # solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
8 | #
9 | # iRedMail is free software: you can redistribute it and/or modify
10 | # it under the terms of the GNU General Public License as published by
11 | # the Free Software Foundation, either version 3 of the License, or
12 | # (at your option) any later version.
13 | #
14 | # iRedMail is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU General Public License
20 | # along with iRedMail. If not, see .
21 | #---------------------------------------------------------------------
22 |
23 | # mlmmj user/group name
24 | export SYS_USER_MLMMJ='mlmmj'
25 | export SYS_GROUP_MLMMJ='mlmmj'
26 |
27 | # Directory used to store mailing list accounts and archive of in/out mails
28 | export MLMMJ_SPOOL_DIR="${STORAGE_BASE_DIR}/mlmmj"
29 | export MLMMJ_HOME_DIR="${MLMMJ_SPOOL_DIR}"
30 | # Directory used to store archived mailing list accounts and data.
31 | export MLMMJ_ARCHIVE_DIR="${STORAGE_BASE_DIR}/mlmmj-archive"
32 | # Directory which stores skel files (templates in different languages)
33 | export MLMMJ_SKEL_DIR='/usr/share/mlmmj/text.skel'
34 |
35 | export CMD_MLMMJ_RECEIVE='/usr/bin/mlmmj-receive'
36 | export CMD_MLMMJ_MAINTD='/usr/bin/mlmmj-maintd'
37 | export CMD_MLMMJ_AMIME_RECEIVE='/usr/bin/mlmmj-amime-receive'
38 |
39 | export CRON_FILE_MLMMJ="${CRON_SPOOL_DIR}/${SYS_USER_MLMMJ}"
40 |
41 | if [ X"${DISTRO}" == X'FREEBSD' -o X"${DISTRO}" == X'OPENBSD' ]; then
42 | export CMD_MLMMJ_RECEIVE='/usr/local/bin/mlmmj-receive'
43 | export CMD_MLMMJ_MAINTD='/usr/local/bin/mlmmj-maintd'
44 | export CMD_MLMMJ_AMIME_RECEIVE='/usr/local/bin/mlmmj-amime-receive'
45 | export MLMMJ_SKEL_DIR='/usr/local/share/mlmmj/text.skel'
46 | fi
47 |
48 | #
49 | # mlmmjadmin: RESTful API server used to manage mlmmj mailing lists
50 | #
51 | export MLMMJADMIN_RC_SCRIPT_NAME='mlmmjadmin'
52 | export MLMMJADMIN_RC_SCRIPT_PATH="${DIR_RC_SCRIPTS}/${MLMMJADMIN_RC_SCRIPT_NAME}"
53 |
54 | export MLMMJADMIN_LISTEN_PORT='7790'
55 | export MLMMJADMIN_PID_FILE='/var/run/mlmmjadmin/mlmmjadmin.pid'
56 |
57 | export MLMMJADMIN_VERSION='3.4.0'
58 | export MLMMJADMIN_TARBALL="mlmmjadmin-${MLMMJADMIN_VERSION}.tar.gz"
59 |
60 | export MLMMJADMIN_PARENT_DIR='/opt'
61 | export MLMMJADMIN_ROOT_DIR="${MLMMJADMIN_PARENT_DIR}/mlmmjadmin-${MLMMJADMIN_VERSION}"
62 | export MLMMJADMIN_ROOT_DIR_SYMBOL_LINK="${MLMMJADMIN_PARENT_DIR}/mlmmjadmin"
63 | export MLMMJADMIN_CONF="${MLMMJADMIN_ROOT_DIR_SYMBOL_LINK}/settings.py"
64 |
65 | export MLMMJADMIN_LOG_DIR='/var/log/mlmmjadmin'
66 | export MLMMJADMIN_LOG_FILE="${MLMMJADMIN_LOG_DIR}/mlmmjadmin.log"
67 | export MLMMJADMIN_LOGROTATE_FILE="${LOGROTATE_DIR}/mlmmjadmin"
68 |
69 | if [ X"${DISTRO}" == X'FREEBSD' ]; then
70 | export MLMMJADMIN_LOGROTATE_FILE="${LOGROTATE_DIR}/mlmmjadmin.conf"
71 | fi
72 |
--------------------------------------------------------------------------------
/conf/netdata:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Author: Zhang Huangbin (zhb _at_ iredmail.org)
4 |
5 | #---------------------------------------------------------------------
6 | # This file is part of iRedMail, which is an open source mail server
7 | # solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
8 | #
9 | # iRedMail is free software: you can redistribute it and/or modify
10 | # it under the terms of the GNU General Public License as published by
11 | # the Free Software Foundation, either version 3 of the License, or
12 | # (at your option) any later version.
13 | #
14 | # iRedMail is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU General Public License
20 | # along with iRedMail. If not, see .
21 | #---------------------------------------------------------------------
22 |
23 | #
24 | # netdata: https://my-netdata.io
25 | #
26 | export NETDATA_VERSION='2.5.2'
27 | export NETDATA_PKG_NAME="netdata-v${NETDATA_VERSION}.gz.run"
28 |
29 | # iRedMail install netdata with the '.bin' package on Linux, it installs
30 | # netdata application files under '/opt/netdata' by default.
31 | # Directory contains all config files
32 | export NETDATA_CONF_DIR="/opt/netdata/etc/netdata"
33 |
34 | # Log directory
35 | export NETDATA_LOG_DIR="/opt/netdata/var/log/netdata"
36 |
37 | if [ X"${KERNEL_NAME}" == X'FREEBSD' ]; then
38 | export NETDATA_CONF_DIR='/usr/local/etc/netdata'
39 | export NETDATA_LOG_DIR='/var/log/netdata'
40 | fi
41 |
42 | export NETDATA_PORT='19999'
43 | export NETDATA_RC_SCRIPT_NAME='netdata'
44 |
45 | # Main config file.
46 | export NETDATA_CONF="${NETDATA_CONF_DIR}/netdata.conf"
47 | export NETDATA_HEALTH_ALARM_NOTIFY_CONF="${NETDATA_CONF_DIR}/health_alarm_notify.conf"
48 | export NETDATA_PYTHON_D_CONF="${NETDATA_CONF_DIR}/python.d.conf"
49 | export NETDATA_GO_D_CONF="${NETDATA_CONF_DIR}/go.d.conf"
50 |
51 | # web auth file
52 | export NETDATA_HTTPD_AUTH_FILE="${HTTPD_CONF_ROOT}/netdata.users"
53 |
54 | # .my.cnf used to access MySQL db.
55 | export NETDATA_DOT_MY_CNF="${NETDATA_CONF_DIR}/my.cnf"
56 |
57 | # Modular config files.
58 | export NETDATA_CONF_HEALTH_ALARM_NOTIFY="${NETDATA_CONF_DIR}/health_alarm_notify.conf"
59 |
60 | export NETDATA_GO_D_CONF_DIR="${NETDATA_CONF_DIR}/go.d"
61 | export NETDATA_GO_D_CONF_PHPFPM="${NETDATA_GO_D_CONF_DIR}/phpfpm.conf"
62 | export NETDATA_GO_D_CONF_NGINX="${NETDATA_GO_D_CONF_DIR}/nginx.conf"
63 | export NETDATA_GO_D_CONF_MYSQL="${NETDATA_GO_D_CONF_DIR}/mysql.conf"
64 | export NETDATA_GO_D_CONF_OPENLDAP="${NETDATA_GO_D_CONF_DIR}/openldap.conf"
65 | export NETDATA_GO_D_CONF_PGSQL="${NETDATA_GO_D_CONF_DIR}/postgres.conf"
66 |
67 | # Database
68 | # NETDATA_DB_PASSWD is generated in dialog/optional_components.sh.
69 | export NETDATA_DB_USER='netdata'
70 |
--------------------------------------------------------------------------------
/conf/nginx:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Author: Zhang Huangbin (zhb _at_ iredmail.org)
4 |
5 | #---------------------------------------------------------------------
6 | # This file is part of iRedMail, which is an open source mail server
7 | # solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
8 | #
9 | # iRedMail is free software: you can redistribute it and/or modify
10 | # it under the terms of the GNU General Public License as published by
11 | # the Free Software Foundation, either version 3 of the License, or
12 | # (at your option) any later version.
13 | #
14 | # iRedMail is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU General Public License
20 | # along with iRedMail. If not, see .
21 | #---------------------------------------------------------------------
22 |
23 | # RC scripts
24 | export NGINX_RC_SCRIPT_NAME='nginx'
25 |
26 | # Configuration files
27 | export HTTPD_CONF_ROOT='/etc/nginx'
28 |
29 | # Log directory.
30 | export NGINX_LOG_DIR='/var/log/nginx'
31 |
32 | # PID file
33 | export NGINX_PID='/var/run/nginx.pid'
34 |
35 | # Directory for storing temporary files holding client request bodies.
36 | export NGINX_CLIENT_BODY_TEMP_PATH='/var/lib/nginx_tmp_client_body'
37 |
38 | if [ X"${DISTRO}" == X'RHEL' ]; then
39 | # Daemon user.
40 | export HTTPD_USER='nginx'
41 | export HTTPD_GROUP='nginx'
42 |
43 | elif [ X"${DISTRO}" == X'FREEBSD' ]; then
44 | export HTTPD_CONF_ROOT="/usr/local/etc/nginx"
45 |
46 | elif [ X"${DISTRO}" == X'OPENBSD' ]; then
47 | export NGINX_LOG_DIR='/var/www/logs'
48 |
49 | fi
50 |
51 | # Log files.
52 | export NGINX_LOG_ACCESSLOG="${NGINX_LOG_DIR}/access.log"
53 | export NGINX_LOG_ERRORLOG="${NGINX_LOG_DIR}/error.log"
54 |
55 | export HTTPD_CONF_DIR_AVAILABLE_CONF="${HTTPD_CONF_ROOT}/conf-available"
56 | export HTTPD_CONF_DIR_ENABLED_CONF="${HTTPD_CONF_ROOT}/conf-enabled"
57 |
58 | # Directory used to store all sites. Note: not loaded by default.
59 | export HTTPD_CONF_DIR_AVAILABLE_SITES="${HTTPD_CONF_ROOT}/sites-available"
60 | # Directory used to store site config files which will be loaded by default.
61 | # Usually we just create a symbol link to file under ${HTTPD_CONF_DIR_AVAILABLE_SITES}
62 | export HTTPD_CONF_DIR_ENABLED_SITES="${HTTPD_CONF_ROOT}/sites-enabled"
63 |
64 | export NGINX_CONF="${HTTPD_CONF_ROOT}/nginx.conf"
65 | export NGINX_CONF_SITE_DEFAULT="${HTTPD_CONF_DIR_AVAILABLE_SITES}/00-default.conf"
66 | export NGINX_CONF_SITE_DEFAULT_SSL="${HTTPD_CONF_DIR_AVAILABLE_SITES}/00-default-ssl.conf"
67 | export NGINX_CONF_TMPL_DIR="${HTTPD_CONF_ROOT}/templates"
68 |
69 | export NGINX_MIME_TYPES="${HTTPD_CONF_ROOT}/mime.types"
70 |
--------------------------------------------------------------------------------
/conf/roundcube:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Author: Zhang Huangbin (zhb _at_ iredmail.org)
4 |
5 | #---------------------------------------------------------------------
6 | # This file is part of iRedMail, which is an open source mail server
7 | # solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
8 | #
9 | # iRedMail is free software: you can redistribute it and/or modify
10 | # it under the terms of the GNU General Public License as published by
11 | # the Free Software Foundation, either version 3 of the License, or
12 | # (at your option) any later version.
13 | #
14 | # iRedMail is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU General Public License
20 | # along with iRedMail. If not, see .
21 | #---------------------------------------------------------------------
22 |
23 | # ---------------------------------------
24 | # RoundcubeMail. http://roundcube.net
25 | # ---------------------------------------
26 | export RCM_VERSION='1.6.11'
27 | export RCM_TARBALL="roundcubemail-${RCM_VERSION}-complete.tar.gz"
28 | export RCM_USE_SOURCE='YES'
29 |
30 | if [ X"${DISTRO}" == X'FREEBSD' ]; then
31 | # Install via ports tree
32 | export RCM_USE_SOURCE='NO'
33 | fi
34 |
35 | if [ X"${RCM_USE_SOURCE}" == X'YES' ]; then
36 | export RCM_HTTPD_ROOT="${HTTPD_SERVERROOT}/roundcubemail-${RCM_VERSION}"
37 | export RCM_HTTPD_ROOT_SYMBOL_LINK="${HTTPD_SERVERROOT}/roundcubemail"
38 | else
39 | if [ X"${DISTRO}" == X'FREEBSD' ]; then
40 | export RCM_HTTPD_ROOT="${HTTPD_SERVERROOT}/roundcube"
41 | export RCM_HTTPD_ROOT_SYMBOL_LINK="${RCM_HTTPD_ROOT}"
42 | fi
43 | fi
44 |
45 | export RCM_CONF_DIR="${RCM_HTTPD_ROOT}/config"
46 | export RCM_CONF="${RCM_CONF_DIR}/config.inc.php"
47 |
48 | # Syslog log file.
49 | export RCM_LOGFILE="${MAILLOG}"
50 |
51 | # Database setting.
52 | export RCM_DB_NAME="roundcubemail"
53 | export RCM_DB_USER="roundcube"
54 |
55 | # this key is used to encrypt the users imap password which is stored
56 | # in the session record (and the client cookie if remember password is enabled).
57 | # please provide a string of exactly 24 chars.
58 | export tmp_rcm_des_key="$(${RANDOM_STRING} | cut -c-24)"
59 | export RCM_DES_KEY="${tmp_rcm_des_key}"
60 |
61 | # Directory used to store PGP keys generated with Roundcube plugin `enigma`
62 | export RCM_PLUGIN_ENIGMA_PGP_HOMEDIR="${RCM_PLUGIN_ENIGMA_PGP_HOMEDIR:=${STORAGE_BASE_DIR}/pgp-keys}"
63 |
--------------------------------------------------------------------------------
/conf/spamassassin:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Author: Zhang Huangbin (zhb _at_ iredmail.org)
4 |
5 | #---------------------------------------------------------------------
6 | # This file is part of iRedMail, which is an open source mail server
7 | # solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
8 | #
9 | # iRedMail is free software: you can redistribute it and/or modify
10 | # it under the terms of the GNU General Public License as published by
11 | # the Free Software Foundation, either version 3 of the License, or
12 | # (at your option) any later version.
13 | #
14 | # iRedMail is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU General Public License
20 | # along with iRedMail. If not, see .
21 | #---------------------------------------------------------------------
22 |
23 | # For SpamAssassin.
24 |
25 | export SA_CONF_DIR='/etc/mail/spamassassin'
26 | export SA_RULES_DIR='/usr/share/spamassassin'
27 | export BIN_SA_UPDATE='sa-update'
28 | export BIN_SA_COMPILE='sa-compile'
29 |
30 | if [ X"${DISTRO}" == X'FREEBSD' ]; then
31 | export SA_CONF_DIR='/usr/local/etc/mail/spamassassin'
32 | export SA_RULES_DIR='/usr/local/share/spamassassin'
33 | export BIN_SA_UPDATE='/usr/local/bin/sa-update'
34 | export BIN_SA_COMPILE='/usr/local/bin/sa-compile'
35 | fi
36 |
37 | export SA_INIT_PRE="${SA_CONF_DIR}/init.pre"
38 | export SA_LOCAL_CF="${SA_CONF_DIR}/local.cf"
39 | export SA_PLUGIN_RAZOR_CONF="${SA_CONF_DIR}/razor.conf"
40 |
--------------------------------------------------------------------------------
/conf/web_server:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Author: Zhang Huangbin (zhb _at_ iredmail.org)
4 |
5 | #---------------------------------------------------------------------
6 | # This file is part of iRedMail, which is an open source mail server
7 | # solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
8 | #
9 | # iRedMail is free software: you can redistribute it and/or modify
10 | # it under the terms of the GNU General Public License as published by
11 | # the Free Software Foundation, either version 3 of the License, or
12 | # (at your option) any later version.
13 | #
14 | # iRedMail is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU General Public License
20 | # along with iRedMail. If not, see .
21 | #---------------------------------------------------------------------
22 |
23 | # web servers and PHP
24 | export PORT_HTTP="${PORT_HTTP:=80}"
25 | export HTTPS_PORT="${HTTPS_PORT:=443}"
26 |
27 | # store extra web applications
28 | export HTTPD_SERVERROOT='/opt/www'
29 |
30 | if [ X"${DISTRO}" == X'RHEL' ]; then
31 | # Web data.
32 | export HTTPD_DOCUMENTROOT='/var/www/html'
33 |
34 | elif [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
35 | # Web data.
36 | export HTTPD_DOCUMENTROOT='/var/www/html'
37 |
38 | # Daemon user.
39 | export HTTPD_USER='www-data'
40 | export HTTPD_GROUP='www-data'
41 |
42 | elif [ X"${DISTRO}" == X'FREEBSD' ]; then
43 | # Daemon user.
44 | export HTTPD_USER='www'
45 | export HTTPD_GROUP='www'
46 |
47 | # Web data.
48 | export HTTPD_SERVERROOT='/usr/local/www'
49 | export HTTPD_DOCUMENTROOT='/usr/local/www/htdocs'
50 |
51 | elif [ X"${DISTRO}" == X'OPENBSD' ]; then
52 | # Daemon user.
53 | export HTTPD_USER='www'
54 | export HTTPD_GROUP='www'
55 |
56 | # Web data.
57 | export HTTPD_DOCUMENTROOT="/var/www/htdocs"
58 |
59 | fi
60 |
61 | export HTTPD_WELL_KNOWN_DIR="${HTTPD_SERVERROOT}/well_known"
62 |
63 | [ X"${WEB_SERVER}" == X'NGINX' ] && . ${CONF_DIR}/nginx
64 |
65 | . ${CONF_DIR}/php
66 |
--------------------------------------------------------------------------------
/dialog/ldap_config.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Author: Zhang Huangbin
4 |
5 | #---------------------------------------------------------------------
6 | # This file is part of iRedMail, which is an open source mail server
7 | # solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
8 | #
9 | # iRedMail is free software: you can redistribute it and/or modify
10 | # it under the terms of the GNU General Public License as published by
11 | # the Free Software Foundation, either version 3 of the License, or
12 | # (at your option) any later version.
13 | #
14 | # iRedMail is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU General Public License
20 | # along with iRedMail. If not, see .
21 | #---------------------------------------------------------------------
22 |
23 | # --------------------------------------------------
24 | # --------------------- LDAP -----------------------
25 | # --------------------------------------------------
26 |
27 | # LDAP suffix.
28 | while : ; do
29 | ${DIALOG} \
30 | --title "LDAP suffix (root dn)" \
31 | --inputbox "\
32 | Please specify your LDAP suffix (root dn):
33 |
34 | EXAMPLE:
35 |
36 | * Domain 'example.com': dc=example,dc=com
37 | * Domain 'test.com.cn': dc=test,dc=com,dc=cn
38 |
39 | Note: Password for LDAP rootdn (cn=Manager,dc=xx,dc=xx) will be
40 | generated randomly.
41 | " 20 76 "dc=example,dc=com" 2>${RUNTIME_DIR}/.ldap_suffix
42 |
43 | LDAP_SUFFIX="$(cat ${RUNTIME_DIR}/.ldap_suffix)"
44 | [ X"${LDAP_SUFFIX}" != X"" ] && break
45 | done
46 |
47 | rm -f ${RUNTIME_DIR}/.ldap_suffix
48 |
49 | export LDAP_SUFFIX="${LDAP_SUFFIX}"
50 | echo "export LDAP_SUFFIX='${LDAP_SUFFIX}'" >> ${IREDMAIL_CONFIG_FILE}
51 |
52 | # LDAP bind dn, passwords.
53 | export LDAP_BINDPW="$(${RANDOM_STRING})"
54 | export LDAP_ADMIN_PW="$(${RANDOM_STRING})"
55 | export LDAP_ROOTPW="$(${RANDOM_STRING})"
56 | echo "export LDAP_BINDPW='${LDAP_BINDPW}'" >> ${IREDMAIL_CONFIG_FILE}
57 | echo "export LDAP_ADMIN_PW='${LDAP_ADMIN_PW}'" >> ${IREDMAIL_CONFIG_FILE}
58 | echo "export LDAP_ROOTPW='${LDAP_ROOTPW}'" >> ${IREDMAIL_CONFIG_FILE}
59 |
--------------------------------------------------------------------------------
/dialog/mysql_config.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Author: Zhang Huangbin
4 |
5 | #---------------------------------------------------------------------
6 | # This file is part of iRedMail, which is an open source mail server
7 | # solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
8 | #
9 | # iRedMail is free software: you can redistribute it and/or modify
10 | # it under the terms of the GNU General Public License as published by
11 | # the Free Software Foundation, either version 3 of the License, or
12 | # (at your option) any later version.
13 | #
14 | # iRedMail is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU General Public License
20 | # along with iRedMail. If not, see .
21 | #---------------------------------------------------------------------
22 |
23 | # --------------------------------------------------
24 | # --------------------- MySQL ----------------------
25 | # --------------------------------------------------
26 |
27 | . ${CONF_DIR}/mysql
28 |
29 | if [ -z "${MYSQL_ROOT_PASSWD}" ]; then
30 | # set a new MySQL root password.
31 | while : ; do
32 | ${DIALOG} \
33 | --title "Password for MySQL administrator: ${MYSQL_ROOT_USER}" \
34 | --passwordbox "\
35 | Please specify password for MySQL administrator ${MYSQL_ROOT_USER} on server
36 | ${MYSQL_SERVER_ADDRESS}.
37 |
38 | WARNING:
39 |
40 | * Do *NOT* use double quote (\") in password.
41 | * EMPTY password is *NOT* permitted.
42 | * Sample password: $(${RANDOM_STRING})
43 | " 20 76 2>${RUNTIME_DIR}/.mysql_rootpw
44 |
45 | MYSQL_ROOT_PASSWD="$(cat ${RUNTIME_DIR}/.mysql_rootpw)"
46 |
47 | [ X"${MYSQL_ROOT_PASSWD}" != X'' ] && break
48 | done
49 |
50 | export MYSQL_ROOT_PASSWD="${MYSQL_ROOT_PASSWD}"
51 | fi
52 |
53 | echo "export MYSQL_ROOT_PASSWD='${MYSQL_ROOT_PASSWD}'" >>${IREDMAIL_CONFIG_FILE}
54 | rm -f ${RUNTIME_DIR}/.mysql_rootpw &>/dev/null
55 |
--------------------------------------------------------------------------------
/dialog/pgsql_config.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Author: Zhang Huangbin
4 |
5 | #---------------------------------------------------------------------
6 | # This file is part of iRedMail, which is an open source mail server
7 | # solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
8 | #
9 | # iRedMail is free software: you can redistribute it and/or modify
10 | # it under the terms of the GNU General Public License as published by
11 | # the Free Software Foundation, either version 3 of the License, or
12 | # (at your option) any later version.
13 | #
14 | # iRedMail is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU General Public License
20 | # along with iRedMail. If not, see .
21 | #---------------------------------------------------------------------
22 |
23 | # --------------------------------------------------
24 | # --------------------- MySQL ----------------------
25 | # --------------------------------------------------
26 |
27 | . ${CONF_DIR}/postgresql
28 |
29 | # Root password.
30 | while : ; do
31 | ${DIALOG} \
32 | --title "Password for PostgreSQL administrator: ${PGSQL_ROOT_USER}" \
33 | --passwordbox "\
34 | Please specify password for PostgreSQL administrator: ${PGSQL_ROOT_USER}
35 |
36 | WARNING:
37 |
38 | * Do *NOT* use special characters in password right now. e.g. $, #, @, space.
39 | * EMPTY password is *NOT* permitted.
40 | * Sample password: $(${RANDOM_STRING})
41 | " 20 76 2>${RUNTIME_DIR}/.pgsql_rootpw
42 |
43 | PGSQL_ROOT_PASSWD="$(cat ${RUNTIME_DIR}/.pgsql_rootpw)"
44 |
45 | # Check $, #, space
46 | echo ${PGSQL_ROOT_PASSWD} | grep '[\$\#\ ]' &>/dev/null
47 | [ X"$?" != X'0' -a X"${PGSQL_ROOT_PASSWD}" != X'' ] && break
48 | done
49 |
50 | export PGSQL_ROOT_PASSWD="${PGSQL_ROOT_PASSWD}"
51 | echo "export PGSQL_ROOT_PASSWD='${PGSQL_ROOT_PASSWD}'" >>${IREDMAIL_CONFIG_FILE}
52 | rm -f ${RUNTIME_DIR}/.pgsql_rootpw
53 |
--------------------------------------------------------------------------------
/dialog/web_applications.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Author: Zhang Huangbin
4 |
5 | #---------------------------------------------------------------------
6 | # This file is part of iRedMail, which is an open source mail server
7 | # solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
8 | #
9 | # iRedMail is free software: you can redistribute it and/or modify
10 | # it under the terms of the GNU General Public License as published by
11 | # the Free Software Foundation, either version 3 of the License, or
12 | # (at your option) any later version.
13 | #
14 | # iRedMail is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU General Public License
20 | # along with iRedMail. If not, see .
21 | #---------------------------------------------------------------------
22 |
23 | # ---------------------------------------------------------------
24 | # Optional web applications
25 | # ---------------------------------------------------------------
26 | if [ X"${DISABLE_WEB_SERVER}" != X'YES' ]; then
27 | export DIALOG_SELECTABLE_ROUNDCUBE='YES'
28 | export DIALOG_SELECTABLE_NETDATA='YES'
29 | export DIALOG_SELECTABLE_SOGO='YES'
30 |
31 | # SOGo team doesn't offer binary packages for arm platform.
32 | if [[ X"${OS_ARCH}" != X'i386' ]] && [[ X"${OS_ARCH}" != X'x86_64' ]]; then
33 | export DIALOG_SELECTABLE_SOGO='NO'
34 | fi
35 |
36 | if [[ X"${DISTRO}" == X'RHEL' ]] && [[ X"${DISTRO_VERSION}" == X'10' ]]; then
37 | # SOGo team doesn't offer binary packages for RHEL 10 yet.
38 | export DIALOG_SELECTABLE_SOGO='NO'
39 | elif [ X"${DISTRO}" == X'OPENBSD' ]; then
40 | # OpenBSD doesn't have 'libuuid' which required by netdata
41 | export DIALOG_SELECTABLE_NETDATA='NO'
42 | fi
43 | fi
44 |
45 | # iRedAdmin
46 | if [ X"${DIALOG_SELECTABLE_IREDADMIN}" == X'YES' ]; then
47 | LIST_OF_OPTIONAL_COMPONENTS="${LIST_OF_OPTIONAL_COMPONENTS} iRedAdmin Official_web-based_Admin_Panel on"
48 | fi
49 |
50 | # Roundcube
51 | if [ X"${DIALOG_SELECTABLE_ROUNDCUBE}" == X'YES' ]; then
52 | LIST_OF_OPTIONAL_COMPONENTS="${LIST_OF_OPTIONAL_COMPONENTS} Roundcubemail Fast_and_lightweight_webmail on"
53 | fi
54 |
55 | # SOGo
56 | if [ X"${DIALOG_SELECTABLE_SOGO}" == X'YES' ]; then
57 | LIST_OF_OPTIONAL_COMPONENTS="${LIST_OF_OPTIONAL_COMPONENTS} SOGo Webmail,_Calendar,_Address_book,_ActiveSync off"
58 | fi
59 |
60 | # netdata
61 | if [ X"${DIALOG_SELECTABLE_NETDATA}" == X'YES' ]; then
62 | LIST_OF_OPTIONAL_COMPONENTS="${LIST_OF_OPTIONAL_COMPONENTS} netdata Awesome_system_monitor on"
63 | fi
64 |
--------------------------------------------------------------------------------
/functions/optional_components.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Author: Zhang Huangbin
4 |
5 | # -------------------------------------------
6 | # Install all optional components.
7 | # -------------------------------------------
8 | optional_components()
9 | {
10 | # iRedAPD.
11 | check_status_before_run iredapd_setup
12 |
13 | # iRedAdmin.
14 | [ X"${USE_IREDADMIN}" == X'YES' ] && \
15 | check_status_before_run iredadmin_setup
16 |
17 | # Roundcubemail.
18 | [ X"${USE_ROUNDCUBE}" == X'YES' ] && \
19 | check_status_before_run rcm_setup
20 |
21 | # SOGo
22 | [ X"${USE_SOGO}" == X'YES' ] && \
23 | check_status_before_run sogo_setup
24 |
25 | # Fail2ban.
26 | [ X"${USE_FAIL2BAN}" == X'YES' -a X"${DISTRO}" != X'FREEBSD' ] && \
27 | check_status_before_run fail2ban_setup
28 |
29 | # netdata.
30 | [ X"${USE_NETDATA}" == X'YES' ] && \
31 | check_status_before_run netdata_setup
32 | }
33 |
--------------------------------------------------------------------------------
/functions/spamassassin.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Author: Zhang Huangbin
4 |
5 | # ---------------------------------------------------------
6 | # SpamAssassin.
7 | # ---------------------------------------------------------
8 | sa_config()
9 | {
10 | ECHO_INFO "Configure SpamAssassin (content-based spam filter)."
11 |
12 | backup_file ${SA_LOCAL_CF}
13 |
14 | ECHO_DEBUG "Copy sample SpamAssassin config file: ${SAMPLE_DIR}/spamassassin/local.cf -> ${SA_LOCAL_CF}."
15 | cp -f ${SAMPLE_DIR}/spamassassin/local.cf ${SA_LOCAL_CF}
16 | cp -f ${SAMPLE_DIR}/spamassassin/razor.conf ${SA_PLUGIN_RAZOR_CONF}
17 |
18 | perl -pi -e 's#PH_SA_PLUGIN_RAZOR_CONF#$ENV{SA_PLUGIN_RAZOR_CONF}#g' ${SA_LOCAL_CF}
19 |
20 | ECHO_DEBUG "Enable crontabs for SpamAssassin update."
21 | if [ X"${DISTRO}" == X'RHEL' ]; then
22 | if [ -f ${ETC_SYSCONFIG_DIR}/sa-update ]; then
23 | perl -pi -e 's/^#(SAUPDATE=yes)/${1}/' ${ETC_SYSCONFIG_DIR}/sa-update
24 | fi
25 |
26 | # Enable daily cron job to update rules.
27 | if [[ ! -x /etc/cron.daily/sa-update ]]; then
28 | ln -sf /usr/share/spamassassin/sa-update.cron /etc/cron.daily/sa-update
29 | fi
30 | elif [ X"${DISTRO}" == X'UBUNTU' -o X"${DISTRO}" == X'DEBIAN' ]; then
31 | [[ -f /etc/default/spamassassin ]] && \
32 | perl -pi -e 's#^(CRON=)0#${1}1#' /etc/default/spamassassin
33 | fi
34 |
35 | if [ X"${DISTRO}" == X'FREEBSD' ]; then
36 | ECHO_DEBUG "Compile SpamAssassin ruleset into native code."
37 | sa-compile >> ${INSTALL_LOG} 2>&1
38 | fi
39 |
40 | cat >> ${TIP_FILE} <> ${STATUS_FILE}
49 | }
50 |
--------------------------------------------------------------------------------
/functions/web_server.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Author: Zhang Huangbin (zhb _at_ iredmail.org)
4 |
5 | #---------------------------------------------------------------------
6 | # This file is part of iRedMail, which is an open source mail server
7 | # solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
8 | #
9 | # iRedMail is free software: you can redistribute it and/or modify
10 | # it under the terms of the GNU General Public License as published by
11 | # the Free Software Foundation, either version 3 of the License, or
12 | # (at your option) any later version.
13 | #
14 | # iRedMail is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU General Public License
20 | # along with iRedMail. If not, see .
21 | #---------------------------------------------------------------------
22 |
23 | web_server_extra()
24 | {
25 | # Create robots.txt.
26 | if [ ! -e ${HTTPD_DOCUMENTROOT}/robots.txt ]; then
27 | cat >> ${HTTPD_DOCUMENTROOT}/robots.txt <