From 1e952d490d1aa6d73cc480ce1cfc0e638a0310cc Mon Sep 17 00:00:00 2001 From: Zhang Huangbin Date: Fri, 21 Jun 2019 13:49:56 +0800 Subject: [PATCH] Sync migrate.to.iredmail.easy.html. --- .../2-iredmail-easy.best.practice.md | 23 +++++- .../8-migrate.to.iredmail.easy.md | 79 +++++++++++++------ html/iredmail-easy.best.practice.html | 18 ++++- html/migrate.to.iredmail.easy.html | 78 +++++++++++++----- 4 files changed, 150 insertions(+), 48 deletions(-) diff --git a/en_US/iredmail-easy/2-iredmail-easy.best.practice.md b/en_US/iredmail-easy/2-iredmail-easy.best.practice.md index 84297eca..8f8ee02c 100644 --- a/en_US/iredmail-easy/2-iredmail-easy.best.practice.md +++ b/en_US/iredmail-easy/2-iredmail-easy.best.practice.md @@ -218,15 +218,30 @@ Postfix doesn't support loading settings from multiple files. - `/opt/iredmail/custom/postfix/master.cf`: If this file exists, `/etc/postfix/master.cf` will be a symbol link to this file. - `/opt/iredmail/custom/postfix/helo_access.pcre` - `/opt/iredmail/custom/postfix/postscreen_access.cidr` -- `/opt/iredmail/custom/postfix/custom.sh`: a bash shell script for advanced customization. +- `/opt/iredmail/custom/postfix/custom.sh`: a bash shell script for advanced customization. It will be ran while iRedMail Easy deployment or upgrade. For example, to change setting `enable_original_recipient` to `yes` (defaults to `no` set in `/etc/postfix/main.cf`), you can write one shell command in `/opt/iredmail/custom/postfix/custom.sh` like below: - ``` - postconf -e enable_original_recipient=yes - ``` +``` +postconf -e enable_original_recipient=yes +``` + +To update settings in `master.cf`, you can run `postconf -M` and +`postconf -P`. For example, create new transport `submission`: + +``` +postconf -M submission/inet="submission inet n - n - - smtpd" +postconf -P "submission/inet/syslog_name=postfix/submission" +postconf -P "submission/inet/smtpd_tls_security_level=encrypt" +postconf -P "submission/inet/smtpd_sasl_auth_enable=yes" +postconf -P "submission/inet/smtpd_client_restrictions=permit_sasl_authenticated,reject" +postconf -P "submission/inet/content_filter=smtp-amavis:[127.0.0.1]:10026 +``` + +For more details about `postconf` command, please check its manual page: +[postconf(1)](http://www.postfix.org/postconf.1.html). ### Dovecot diff --git a/en_US/iredmail-easy/8-migrate.to.iredmail.easy.md b/en_US/iredmail-easy/8-migrate.to.iredmail.easy.md index 69fea5fa..3bc436bf 100644 --- a/en_US/iredmail-easy/8-migrate.to.iredmail.easy.md +++ b/en_US/iredmail-easy/8-migrate.to.iredmail.easy.md @@ -97,29 +97,64 @@ correct files names, * `/opt/iredmail/ssl/cert.pem`: certificate * `/opt/iredmail/ssl/combined.pem`: full chain +## Split custom settings + +iRedMail Easy maintains the core config files, and each time you perform +full deployment or upgrade, these core config files will be re-generated, all +your custom config files will be lost. So it's very important to not touch +these core config files and just store your custom settings in pre-defined +files under `/opt/iredmail/custom//`. + +### Postfix + +* Files under `/etc/postfix/`: + * `body_checks.pcre` + * `command_filter.pcre` + * `header_checks.pcre` + * `helo_access.pcre` + * `postscreen_access.cidr` + * `postscreen_dnsbl_reply.texthash` + * `rdns_access.pcre` + * `sender_access.pcre` + * `smtp_tls_policy` + * `transport` + + Please copy your custom settings from above files to the files with same + names under `/opt/iredmail/custom/postfix/`. For example: + + - From `/etc/postfix/body_checks.pcre` to `/opt/iredmail/custom/postfix/body_checks.pcre`. + - From `/etc/postfix/command_filter.pcre` to `/opt/iredmail/custom/postfix/command_filter.pcre`. + + You need to create directory `/opt/iredmail/custom/postfix/` and the files + if they don't exist, iRedMail Easy will set correct owner/group and + permission for them while deployment. + + If you're lasy and don't want to check files one by one, it's ok to simply + copy these files from `/etc/postfix/` to `/opt/iredmail/custom/postfix/` + directly, and (optionally) remove non-custom settings later. + +* `/etc/postfix/main.cf` and `/etc/postfix/master.cf` + + Postfix doesn't support `include` directive to load extra config files, + so if you have custom settings in these 2 files, you have to create shell + script file `/opt/iredmail/custom/postfix/custom.sh` to update them with + `postconf` command during iRedMail Easy deployment or upgrade. For more + details, please check our + [Best Practice](./iredmail-easy.best.practice.html#postfix) tutorial. + +### Roundcube Webmail + +Copy custom settings from `/opt/www/roundcubemail/config/config.inc.php` to `/opt/iredmail/custom/roundcubemail/config/custom.inc.php`. + +### iRedAPD + +Copy custom settings from `/opt/iredapd/settings.py` to `/opt/iredmail/custom/iredapd/settings.py`. + +### iRedAdmin(-Pro) + +Copy custom settings from `/opt/www/iredadmin/settings.py` to `/opt/iredmail/custom/iredadmin/settings.py`. + ## Run the full deployment with iRedMail Easy platform Please follow our tutorial [Getting start with iRedMail Easy](./iredmail-easy.getting.start.html) to sign up, and add your mail server info, then perform the full deployment. - -## Post-installation setup - -iRedMail Easy will re-generate most config files, custom settings will be -loaded from files under `/opt/iredmail/custom/`, so if you have any -customizations, you may need to copy your custom settings to files under -`/opt/iredmail/custom/`. - -### Postfix config files - -iRedMail Easy will rewrite config files under `/etc/postfix/`, most importantly -`main.cf` and `master.cf`. If you have any changes in these 2 files, please -read the `[Best Practice](./iredmail-easy.best.practice.html)` document to -understand how to customize them with shell script -`/opt/iredmail/custom/postfix/custom.sh`. - -For customizations you made in other files under `/etc/postfix/`, you must -move the customizations to files under `/opt/iredmail/custom/postfix/` which -have same file names. - -For example, if you added some rules in `/etc/postfix/helo_access.pcre`, you -should copy these rules to file `/opt/iredmail/custom/postfix/helo_access.pcre`. diff --git a/html/iredmail-easy.best.practice.html b/html/iredmail-easy.best.practice.html index 9da648c6..58e15634 100644 --- a/html/iredmail-easy.best.practice.html +++ b/html/iredmail-easy.best.practice.html @@ -232,13 +232,27 @@ max_connections = 1024
  • /opt/iredmail/custom/postfix/helo_access.pcre
  • /opt/iredmail/custom/postfix/postscreen_access.cidr
  • -

    /opt/iredmail/custom/postfix/custom.sh: a bash shell script for advanced customization.

    +

    /opt/iredmail/custom/postfix/custom.sh: a bash shell script for advanced customization. It will be ran while iRedMail Easy deployment or upgrade.

    For example, to change setting enable_original_recipient to yes (defaults to no set in /etc/postfix/main.cf), you can write one shell command in /opt/iredmail/custom/postfix/custom.sh like below:

    -

    postconf -e enable_original_recipient=yes

  • +
    postconf -e enable_original_recipient=yes
    +
    + +

    To update settings in master.cf, you can run postconf -M and +postconf -P. For example, create new transport submission:

    +
    postconf -M submission/inet="submission inet n - n - - smtpd"
    +postconf -P "submission/inet/syslog_name=postfix/submission"
    +postconf -P "submission/inet/smtpd_tls_security_level=encrypt"
    +postconf -P "submission/inet/smtpd_sasl_auth_enable=yes"
    +postconf -P "submission/inet/smtpd_client_restrictions=permit_sasl_authenticated,reject"
    +postconf -P "submission/inet/content_filter=smtp-amavis:[127.0.0.1]:10026
    +
    + +

    For more details about postconf command, please check its manual page: +postconf(1).

    Dovecot

    Dovecot supports loading from mulitple config files, and settings will be overrode by the last one.

    diff --git a/html/migrate.to.iredmail.easy.html b/html/migrate.to.iredmail.easy.html index 409dca69..91817b7c 100644 --- a/html/migrate.to.iredmail.easy.html +++ b/html/migrate.to.iredmail.easy.html @@ -24,11 +24,14 @@
  • Backup first
  • Create required files used by iRedMail Easy
  • Copy files to new locations
  • -
  • Run the full deployment with iRedMail Easy platform
  • -
  • Post-installation setup
  • @@ -125,25 +128,60 @@ correct files names,

  • /opt/iredmail/ssl/cert.pem: certificate
  • /opt/iredmail/ssl/combined.pem: full chain
  • +

    Split custom settings

    +

    iRedMail Easy maintains the core config files, and each time you perform +full deployment or upgrade, these core config files will be re-generated, all +your custom config files will be lost. So it's very important to not touch +these core config files and just store your custom settings in pre-defined +files under /opt/iredmail/custom/<software>/.

    +

    Postfix

    + +

    Roundcube Webmail

    +

    Copy custom settings from /opt/www/roundcubemail/config/config.inc.php to /opt/iredmail/custom/roundcubemail/config/custom.inc.php.

    +

    iRedAPD

    +

    Copy custom settings from /opt/iredapd/settings.py to /opt/iredmail/custom/iredapd/settings.py.

    +

    iRedAdmin(-Pro)

    +

    Copy custom settings from /opt/www/iredadmin/settings.py to /opt/iredmail/custom/iredadmin/settings.py.

    Run the full deployment with iRedMail Easy platform

    Please follow our tutorial Getting start with iRedMail Easy -to sign up, and add your mail server info, then perform the full deployment.

    -

    Post-installation setup

    -

    iRedMail Easy will re-generate most config files, custom settings will be -loaded from files under /opt/iredmail/custom/, so if you have any -customizations, you may need to copy your custom settings to files under -/opt/iredmail/custom/.

    -

    Postfix config files

    -

    iRedMail Easy will rewrite config files under /etc/postfix/, most importantly -main.cf and master.cf. If you have any changes in these 2 files, please -read the [Best Practice](./iredmail-easy.best.practice.html) document to -understand how to customize them with shell script -/opt/iredmail/custom/postfix/custom.sh.

    -

    For customizations you made in other files under /etc/postfix/, you must -move the customizations to files under /opt/iredmail/custom/postfix/ which -have same file names.

    -

    For example, if you added some rules in /etc/postfix/helo_access.pcre, you -should copy these rules to file /opt/iredmail/custom/postfix/helo_access.pcre.