diff --git a/README.md b/README.md index 6bc6d446..645c5743 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ We're migrating [old wiki documents](http://www.iredmail.org/wiki) to Markdown f * [Install iRedMail on FreeBSD](https://bitbucket.org/zhb/docs.iredmail.org/src/default/installation/2-install.iredmail.on.freebsd.md) * [Install iRedMail on FreeBSD inside Jail (with ezjail)](https://bitbucket.org/zhb/docs.iredmail.org/src/default/installation/3-install.iredmail.on.freebsd.with.jail.md) * [Install iRedMail on OpenBSD](https://bitbucket.org/zhb/docs.iredmail.org/src/default/installation/4-install.iredmail.on.openbsd.md) +* [Release notes and upgrade tutorials](https://bitbucket.org/zhb/docs.iredmail.org/src/default/installation/releases.md) * [Setup DNS records for your iRedMail server](https://bitbucket.org/zhb/docs.iredmail.org/src/default/installation/setup.dns.md) * [Perform silent/unattended iRedMail installation](https://bitbucket.org/zhb/docs.iredmail.org/src/default/installation/unattended.iredmail.installation.md) # Configure mail client applications diff --git a/TODO.md b/TODO.md index c1ab219b..db86d51d 100644 --- a/TODO.md +++ b/TODO.md @@ -2,7 +2,6 @@ # New -* http://www.iredmail.org/wiki/index.php?title=Install/iRedMail/FreeBSD.Jail * iRedMail upgrade tutorials * Upgrade iRedAPD: http://www.iredmail.org/wiki/index.php?title=IRedMail/FAQ/Upgrade.iRedAPD * How to enable SSHA512/BCRYPT in Dovecot + Roundcubemail. @@ -41,6 +40,7 @@ * ~~http://www.iredmail.org/install_iredmail_on_debian.html~~ * ~~http://www.iredmail.org/install_iredmail_on_ubuntu.html~~ * ~~http://www.iredmail.org/install_iredmail_on_freebsd.html~~ +* ~~ http://www.iredmail.org/wiki/index.php?title=Install/iRedMail/FreeBSD.Jail ~~ * ~~http://www.iredmail.org/install_iredmail_on_openbsd.html~~ * ~~ http://www.iredmail.org/install_iredmail_on_rhel.html ~~ * ~~ https://code.google.com/p/iredmail/wiki/DNS_DKIM ~~ diff --git a/convert.sh b/convert.sh index cf7db26b..6c67362f 100644 --- a/convert.sh +++ b/convert.sh @@ -34,6 +34,7 @@ strip_name_prefix() # Chapter directories in specified order all_chapter_dirs="installation \ + upgrade \ mua \ howto \ integrations \ @@ -52,6 +53,10 @@ for chapter_dir in ${all_chapter_dirs}; do # Get articles all_chapter_articles="$(find ${chapter_dir} -depth 1 -type f -iname '[0-9a-z]*.md')" + # Don't show chapter title and articles in index page. + hide_in_index='NO' + [ -f ${chapter_dir}/_hide_in_index ] && hide_in_index='YES' + # Output directory. # Remove prefix '[number]-' in chapter directory name. #chapter_dir_in_article="$(strip_name_prefix ${chapter_dir})" @@ -61,16 +66,18 @@ for chapter_dir in ${all_chapter_dirs}; do _title_md="${chapter_dir}/_title.md" _summary_md="${chapter_dir}/_summary.md" - if [ -f ${_title_md} ]; then - # generate index info of chapter - _chapter_title="$(cat ${_title_md})" - echo -e "### ${_chapter_title}" >> ${INDEX_MD} - echo -e "# ${_chapter_title}" >> ${README_MD} + if [ X"${hide_in_index}" != X'YES' ]; then + if [ -f ${_title_md} ]; then + # generate index info of chapter + _chapter_title="$(cat ${_title_md})" + echo -e "### ${_chapter_title}" >> ${INDEX_MD} + echo -e "# ${_chapter_title}" >> ${README_MD} - if [ -f ${_summary_md} ]; then - _chapter_summary="$(cat ${_summary_md})" - echo -e "${_chapter_summary}" >> ${INDEX_MD} - echo -e "${_chapter_summary}" >> ${README_MD} + if [ -f ${_summary_md} ]; then + _chapter_summary="$(cat ${_summary_md})" + echo -e "${_chapter_summary}" >> ${INDEX_MD} + echo -e "${_chapter_summary}" >> ${README_MD} + fi fi fi @@ -90,10 +97,12 @@ for chapter_dir in ${all_chapter_dirs}; do #_article_title="$(head -1 ${article_file} | awk -F'Title: ' '{print $2}')" #echo "article title: ${_article_title}" #echo "* [${_article_title}](${chapter_dir_in_article}/${article_html_file})" >> ${INDEX_MD} - echo "* [${_article_title}](${article_html_file})" >> ${INDEX_MD} + if [ X"${hide_in_index}" != X'YES' ]; then + echo "* [${_article_title}](${article_html_file})" >> ${INDEX_MD} - # 'src/default/' is path to view source file on bitbucket.org - echo "* [${_article_title}](https://bitbucket.org/zhb/docs.iredmail.org/src/default/${article_file_without_prefix_path})" >> ${README_MD} + # 'src/default/' is path to view source file on bitbucket.org + echo "* [${_article_title}](https://bitbucket.org/zhb/docs.iredmail.org/src/default/${article_file_without_prefix_path})" >> ${README_MD} + fi # Convert file if it was modified echo ${CHANGED_FILES} | grep ${article_file} > /dev/null @@ -113,13 +122,14 @@ for chapter_dir in ${all_chapter_dirs}; do done # Append addition links at the chapter bottom on index page. - _links_md="${chapter_dir}/_links.md" + if [ X"${hide_in_index}" != X'YES' ]; then + _links_md="${chapter_dir}/_links.md" - if [ -f ${_links_md} ]; then - cat ${_links_md} >> ${INDEX_MD} - cat ${_links_md} >> ${README_MD} + if [ -f ${_links_md} ]; then + cat ${_links_md} >> ${INDEX_MD} + cat ${_links_md} >> ${README_MD} + fi fi - done #cd ${OUTPUT_DIR} diff --git a/html/index.html b/html/index.html index 727199af..9892b45a 100644 --- a/html/index.html +++ b/html/index.html @@ -16,6 +16,7 @@
  • Install iRedMail on FreeBSD
  • Install iRedMail on FreeBSD inside Jail (with ezjail)
  • Install iRedMail on OpenBSD
  • +
  • Release notes and upgrade tutorials
  • Setup DNS records for your iRedMail server
  • Perform silent/unattended iRedMail installation
  • diff --git a/html/releases.html b/html/releases.html new file mode 100644 index 00000000..77ac91ca --- /dev/null +++ b/html/releases.html @@ -0,0 +1,53 @@ + + + + Release notes and upgrade tutorials + + + + +

    Release notes and upgrade tutorials

    +

    iRedMail

    +

    If you found something wrong +in this document, please do +contact us to fix it.

    This tutorial is published under a CC BY-ND 3.0 license. + + + \ No newline at end of file diff --git a/html/upgrade.iredmail.0.8.7-0.9.0.html b/html/upgrade.iredmail.0.8.7-0.9.0.html new file mode 100644 index 00000000..4f7210ea --- /dev/null +++ b/html/upgrade.iredmail.0.8.7-0.9.0.html @@ -0,0 +1,292 @@ + + + + Upgrade iRedMail from 0.8.7 to 0.9.0 + + + + +

    Upgrade iRedMail from 0.8.7 to 0.9.0

    +
    + +
    +

    STILL WORKING IN PROGRESS, DO NOT APPLY IT.

    +

    ChangeLog

    + +

    General (All backends should apply these steps)

    +

    Update /etc/iredmail-release with iRedMail version number

    +

    iRedMail stores the release version in /etc/iredmail-release after +installation, it's recommended to update this file after you upgraded iRedMail, +so that you can know which version of iRedMail you're running. For example:

    +
    # File: /etc/iredmail-release
    +0.9.0
    +
    + +

    Upgrade Roundcube webmail to the latest stable release

    +

    Please follow Roundcube official tutorial to upgrade Roundcube webmail to the +latest stable release immediately: How to upgrade Roundcube

    +

    Fix improper Postfix setting in both main.cf and master.cf

    +

    Currently, we don't have Postfix parameter receive_override_options= set in +/etc/postfix/main.cf, instead, we have it in transport 127.0.0.1:10025 +(Amavisd) like this:

    +
    # Part of file: /etc/postfix/master.cf
    +
    +127.0.0.1:10025 inet n  -   -   -   -  smtpd
    +    ...
    +    -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_address_mappings
    +
    + +

    Without receive_override_options=no_address_mappings in main.cf:

    + +

    Please apply below steps to fix above issues:

    + +
    # postconf -e receive_override_options='no_address_mappings'
    +
    + + +
    # Part of file: /etc/postfix/master.cf
    +
    +# ORIGINAL setting
    +#    -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_address_mappings
    +
    +# MODIFIED setting
    +    -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks
    +
    + + +

    IMPORTANT NOTE: If you want to disable content_filter= in Postfix, please +comment out receive_override_options= in Postfix config file main.cf too, +otherwise canonical address mapping, virtual alias map expansion, address +masquerading, and automatic BCC (blind carbon-copy) recipients will not work.

    +

    Fix improper file permission of Amavisd config file

    +

    NOTE: This step is applicable to only Red Hat/CentOS 6.

    +

    Amavisd config file /etc/amavisd/amavisd.conf must be owned by group amavis, +otherwise after you upgraded to Red Hat/CentOS 7, Amavisd service cannot start.

    +
    # chgrp amavis /etc/amavisd/amavisd.conf
    +
    + +

    Fix incorrect setting to enable daily cron job to update SpamAssassin rules

    +

    NOTE: This step is applicable to only Debian and Ubuntu.

    +

    Please update file /etc/default/spamassassin to set CRON=1, so that +SpamAssassin daily cron job will update SpamAssassin rules automatically.

    +
    # Part of file: /etc/default/spamassassin
    +
    +CRON=1
    +
    + +

    OpenLDAP backend special

    +

    Fix improper LDAP query command in domain transport query file

    +

    Please open file /etc/postfix/ldap/transport_maps_domain.cf (on Linux/OpenBSD) +or /usr/local/etc/postfix/ldap/transport_maps_domain.cf (on FreeBSD), add +addition LDAP filter (!(domainBackupMX=yes)) in query = parameter:

    +
    # Part of file: /etc/postfix/ldap/transport_maps_domain.cf
    +
    +# OLD setting
    +#query_filter    = (&(objectClass=mailDomain)(accountStatus=active)(enabledService=mail)(|(domainName=%s)(domainAliasName=%s)))
    +
    +# NEW setting
    +query_filter    = (&(objectClass=mailDomain)(accountStatus=active)(enabledService=mail)(|(domainName=%s)(domainAliasName=%s))(!(domainBackupMX=yes)))
    +
    + +

    Restarting Postfix service is required.

    +

    Add new LDAP values for existing mail users

    +

    We will add new LDAP attribute/value pair for existing mail users: +enabledService=indexer-worker. It's used by Dovecot.

    + +
    # cd /root/
    +# wget https://bitbucket.org/zhb/iredmail/raw/default/extra/update/updateLDAPValues_087_to_090.py
    +
    + + +
    # Part of file: updateLDAPValues_087_to_090.py
    +
    +uri = 'ldap://127.0.0.1:389'
    +basedn = 'o=domains,dc=example,dc=com'
    +bind_dn = 'cn=vmailadmin,dc=example,dc=com'
    +bind_pw = 'passwd'
    +
    + +

    You can find required LDAP credential in iRedAdmin config file or iRedMail.tips +file under your iRedMail installation directory. Using either +cn=Manager,dc=xx,dc=xx or cn=vmailadmin,dc=xx,dc=xx as bind dn is ok.

    + +
    # python updateLDAPValues_087_to_090.py
    +
    + +

    That's all.

    +

    Add index for SQL column in amavisd database

    +

    We need indexes for some SQL columns in amavisd database: +policy.policy_name, msgs.spam_level. Both are used by iRedAdmin-Pro.

    +

    Now connect to SQL server as MySQL root user, create new columns, add required INDEX:

    +
    $ mysql -uroot -p
    +mysql> USE amavisd;
    +mysql> CREATE UNIQUE INDEX policy_idx_policy_name ON policy (policy_name);
    +mysql> CREATE INDEX msgs_idx_spam_level ON msgs (spam_level);
    +
    + +

    MySQL backend special

    +

    Fix improper SQL query command in domain transport query file

    +

    Please open file /etc/postfix/mysql/transport_maps_domain.cf (on Linux/OpenBSD) +or /usr/local/etc/postfix/mysql/transport_maps_domain.cf (on FreeBSD), add +addition SQL statement AND backupmx=0 in query = parameter:

    +
    # Part of file: /etc/postfix/mysql/transport_maps_domain.cf
    +
    +# OLD setting
    +#query       = SELECT transport FROM domain WHERE domain='%s' AND active=1
    +
    +# NEW setting
    +query       = SELECT transport FROM domain WHERE domain='%s' AND active=1 AND backupmx=0
    +
    + +

    Restarting Postfix service is required.

    +

    Add and remove SQL columns in vmail and amavisd databases

    + +

    Now connect to SQL server as MySQL root user, create new columns, add required +indexes:

    +
    $ mysql -uroot -p
    +mysql> USE vmail;
    +mysql> ALTER TABLE mailbox ADD COLUMN `enableindexer-worker` TINYINT(1) NOT NULL DEFAULT 1;
    +mysql> ALTER TABLE mailbox ADD INDEX (`enableindexer-worker`);
    +
    +mysql> USE amavisd;
    +mysql> CREATE UNIQUE INDEX policy_idx_policy_name ON policy (policy_name);
    +mysql> CREATE INDEX msgs_idx_spam_level ON msgs (spam_level);
    +
    + +

    PostgreSQL backend special

    +

    Fix improper SQL query command in domain transport query file

    +

    Please open file /etc/postfix/pgsql/transport_maps_domain.cf (on Linux/OpenBSD) +or /usr/local/etc/postfix/pgsql/transport_maps_domain.cf (on FreeBSD), add +addition SQL statement AND backupmx=0 in query = parameter:

    +
    # Part of file: /etc/postfix/pgsql/transport_maps_domain.cf
    +
    +# OLD setting
    +#query       = SELECT transport FROM domain WHERE domain='%s' AND active=1
    +
    +# NEW setting
    +query       = SELECT transport FROM domain WHERE domain='%s' AND active=1 AND backupmx=0
    +
    + +

    Restarting Postfix service is required.

    +

    Add and remove SQL columns in vmail and amavisd databases

    + +

    Now connect to SQL server as PostgreSQL admin user, create new columns, add +required indexes:

    +
    # su - postgres
    +$ psql -d vmail
    +sql> ALTER TABLE mailbox ADD COLUMN enableindexer-worker INT2 NOT NULL DEFAULT 1;
    +sql> CREATE INDEX idx_mailbox_enableindexer_worker ON mailbox (enableindexer-worker);
    +
    +sql> \c amavisd;
    +sql> CREATE UNIQUE INDEX policy_idx_policy_name ON policy (policy_name);
    +sql> CREATE INDEX msgs_idx_spam_level ON msgs (spam_level);
    +

    If you found something wrong +in this document, please do +contact us to fix it.

    This tutorial is published under a CC BY-ND 3.0 license. + + + \ No newline at end of file diff --git a/installation/releases.md b/installation/releases.md new file mode 100644 index 00000000..0b43d183 --- /dev/null +++ b/installation/releases.md @@ -0,0 +1,28 @@ +# Release notes and upgrade tutorials + +## iRedMail + +* __0.9.0__, released on Dec ??, 2014. [Release notes](), [Upgrade from iRedMail-0.8.7](./upgrade.iredmail.0.8.7-0.9.0.html) +* __0.8.7__, released on May 13, 2014. [Release notes](http://www.iredmail.org/forum/topic6872-news-announcements-bug-fixes-iredmail087-has-been-released.html), [Upgrade from iRedMail-0.8.6](http://www.iredmail.org/wiki/index.php?title=Upgrade/iRedMail/0.8.6-0.8.7) +* __0.8.6__, released on Dec 16, 2013. [Release notes](http://www.iredmail.org/forum/topic5831-iredmail086-has-been-released.html), [Upgrade from iRedMail-0.8.5](http://www.iredmail.org/wiki/index.php?title=Upgrade/iRedMail/0.8.5-0.8.6) +* __0.8.5__, released on Jul 16, 2013. [Release notes](http://www.iredmail.org/forum/topic5167-news-announcements-bug-fixes-iredmail085-has-been-released.html), [Upgrade from iRedMail-0.8.4](http://www.iredmail.org/wiki/index.php?title=Upgrade/iRedMail/0.8.4-0.8.5) +* __0.8.4__, released on Mar 26, 2013. [Release notes](http://www.iredmail.org/forum/topic4646-news-announcements-bug-fixes-iredmail084-has-been-released.html), [Upgrade from iRedMail-0.8.3](http://www.iredmail.org/wiki/index.php?title=Upgrade/iRedMail/0.8.3-0.8.4) +* __0.8.3__, released on Oct 13, 2012. [Release notes](http://www.iredmail.org/forum/topic4016-news-announcements-bug-fixes-iredmail083-has-been-released.html), [Upgrade from iRedMail-0.8.2](http://www.iredmail.org/wiki/index.php?title=Upgrade/iRedMail/0.8.2-0.8.3) +* __0.8.2__, released on Sep 19, 2012. [Release notes](http://www.iredmail.org/forum/topic3913-news-announcements-bug-fixes-iredmail082-has-been-released.html), [Upgrade from iRedMail-0.8.1](http://www.iredmail.org/wiki/index.php?title=Upgrade/iRedMail/0.8.1-0.8.2) +* __0.8.1__, released on Jun 8, 2012. [Release notes](http://www.iredmail.org/forum/topic3499-news-announcements-bug-fixes-iredmail081-has-been-released.html), [Upgrade from iRedMail-0.8.0](http://www.iredmail.org/wiki/index.php?title=Upgrade/iRedMail/0.8.0-0.8.1) +* __0.8.0__, released on May 10, 2012. [Release notes](http://www.iredmail.org/forum/topic3345.html), [Upgrade from iRedMail-0.7.4](http://www.iredmail.org/wiki/index.php?title=Upgrade/iRedMail/0.7.4-0.8.0) +* __0.7.4__, released on Jan 9, 2012. [Release notes](http://www.iredmail.org/forum/topic2816-iredmail074-has-been-released.html), [Upgrade from iRedMail-0.7.3](http://www.iredmail.org/wiki/index.php?title=Upgrade/iRedMail/0.7.3-0.7.4) +* __0.7.3__, released on Aug 17, 2011. [Release notes](http://www.iredmail.org/wiki/index.php?title=Release.Notes/iRedMail/0.7.3), [Upgrade from iRedMail-0.7.2](http://www.iredmail.org/wiki/index.php?title=Upgrade/iRedMail/0.7.2-0.7.3) +* __0.7.2__, released on Jun 10, 2011. [Release notes](http://www.iredmail.org/wiki/index.php?title=Release.Notes/iRedMail/0.7.2), [Upgrade from iRedMail-0.7.1](http://www.iredmail.org/wiki/index.php?title=Upgrade/iRedMail/0.7.1-0.7.2) +* __0.7.1__, released on May 1, 2011. [Release notes](http://www.iredmail.org/wiki/index.php?title=Release.Notes/iRedMail/0.7.1), [Upgrade from iRedMail-0.7.0](http://www.iredmail.org/wiki/index.php?title=Upgrade/iRedMail/0.7.0-0.7.1) +* __0.7.0__, released on Apr 1, 2011. [Release notes](http://www.iredmail.org/wiki/index.php?title=Release.Notes/iRedMail/0.7.0), [Upgrade from iRedMail-0.6.1](http://www.iredmail.org/wiki/index.php?title=Upgrade/iRedMail/0.6.1-0.7.0) +* 0.6.1, released on Aug 14, 2010. [Upgrade from iRedMail-0.6.0](http://www.iredmail.org/wiki/index.php?title=Upgrade/iRedMail/0.6.0-0.6.1) +* 0.6.0, released on May 31, 2010. [Upgrade from iRedMail-0.5.1](http://www.iredmail.org/wiki/index.php?title=Upgrade/iRedMail/0.5.1-0.6.0) +* 0.5.1, released on Oct 31, 2009. [Upgrade from iRedMail-0.5.1](http://www.iredmail.org/upgrade_050_051.html) +* 0.5.0, released on Aug 16, 2009. [Upgrade from iRedMail-0.5.1](http://code.google.com/p/iredmail/wiki/Upgrade_040_050) +* 0.4.0, released on Mar 10, 2009. [Upgrade from iRedMail-0.3.2](http://code.google.com/p/iredmail/wiki/Upgrade_032_040) +* 0.3.2, released on Dec 11, 2008. +* 0.3.1, released on Oct 21, 2008. +* 0.3.0, released on Sep 22, 2008. +* 0.2, released on Aug 20, 2008. +* 0.1, released on Jun 28, 2008. diff --git a/upgrade/_hide_in_index b/upgrade/_hide_in_index new file mode 100644 index 00000000..e69de29b diff --git a/upgrade/upgrade.iredmail.0.8.7-0.9.0.md b/upgrade/upgrade.iredmail.0.8.7-0.9.0.md new file mode 100644 index 00000000..3dee6fce --- /dev/null +++ b/upgrade/upgrade.iredmail.0.8.7-0.9.0.md @@ -0,0 +1,275 @@ +# Upgrade iRedMail from 0.8.7 to 0.9.0 + +[TOC] + + +__STILL WORKING IN PROGRESS, DO NOT APPLY IT.__ + + +## ChangeLog + +* 2014-11-13: [All backends] Add index for SQL column `msgs.spam_level` in `amavisd` database. +* 2014-11-06: [All backends] Fix improper SQL query command in domain transport query file. +* 2014-09-09: [All backends] Fix incorrect setting to enable daily cron job to update SpamAssassin rules. +* 2014-09-09: [All backends] Fix improper permission of Amavisd config file. +* 2014-07-15: [All backends] Fix improper Postfix setting in both main.cf and master.cf. +* 2014-06-19: [All backends] Add index for SQL column `policy.policy_name` in `amavisd` database. +* 2014-06-07: + * [OpenLDAP] Add new value for existing mail users: enabledService=indexer-worker. + * [MySQL/PostgreSQL] New SQL column in `vmail` database: mailbox.enableindexer-worker. + +## General (All backends should apply these steps) + +### Update /etc/iredmail-release with iRedMail version number + +iRedMail stores the release version in `/etc/iredmail-release` after +installation, it's recommended to update this file after you upgraded iRedMail, +so that you can know which version of iRedMail you're running. For example: + +``` +# File: /etc/iredmail-release +0.9.0 +``` + +### Upgrade Roundcube webmail to the latest stable release + +Please follow Roundcube official tutorial to upgrade Roundcube webmail to the +latest stable release immediately: [How to upgrade Roundcube](http://trac.roundcube.net/wiki/Howto_Upgrade) + +### Fix improper Postfix setting in both main.cf and master.cf + +Currently, we don't have Postfix parameter `receive_override_options=` set in +`/etc/postfix/main.cf`, instead, we have it in transport `127.0.0.1:10025` +(Amavisd) like this: + +``` +# Part of file: /etc/postfix/master.cf + +127.0.0.1:10025 inet n - - - - smtpd + ... + -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_address_mappings +``` + +Without `receive_override_options=no_address_mappings` in `main.cf`: + +* Postfix will enable canonical address mapping, virtual alias map expansion, + address masquerading, and automatic BCC (blind carbon-copy) recipients + __BEFORE__ injecting emails to content filter (Amavisd, in our case). For + example, if you forward email to 3 email addresses, Postfix will expand the + original recipient to 3 recipients, then Amavisd will get 3 emails for + scanning. But with `receive_override_options=no_address_mappings`, Postfix + won't expand original recipient to 3 addresses, and Amavisd gets only 1 email + for scanning. It slightly improves mail server performance. + +* If a blacklisted sender (stored in Amavisd SQL database, not in + Policyd/Cluebringer) sends email to user who forwards email to other + addresses, Amavisd will quarantine the one sent to original recipient, but + bypass emails sent to forwarded addresses. + +Please apply below steps to fix above issues: + +* Add `receive_override_options` in Postfix with below shell command: + +``` +# postconf -e receive_override_options='no_address_mappings' +``` + +* Open file `/etc/postfix/master.cf` (On Linux/OpenBSD) or + `/usr/local/etc/postfix/master.cf` (on FreeBSD), find setting for transport + `127.0.0.1:10025`, remove `no_address_mappings` for its + `receive_override_options` option: + +``` +# Part of file: /etc/postfix/master.cf + +# ORIGINAL setting +# -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_address_mappings + +# MODIFIED setting + -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks +``` + +* Restart Postfix service. + +__IMPORTANT NOTE__: If you want to disable `content_filter=` in Postfix, please +comment out `receive_override_options=` in Postfix config file `main.cf` too, +otherwise canonical address mapping, virtual alias map expansion, address +masquerading, and automatic BCC (blind carbon-copy) recipients will not work. + +### Fix improper file permission of Amavisd config file + +__NOTE__: This step is applicable to only Red Hat/CentOS 6. + +Amavisd config file `/etc/amavisd/amavisd.conf` must be owned by group `amavis`, +otherwise after you upgraded to Red Hat/CentOS 7, Amavisd service cannot start. + +``` +# chgrp amavis /etc/amavisd/amavisd.conf +``` + +### Fix incorrect setting to enable daily cron job to update SpamAssassin rules + +__NOTE__: This step is applicable to only Debian and Ubuntu. + +Please update file `/etc/default/spamassassin` to set `CRON=1`, so that +SpamAssassin daily cron job will update SpamAssassin rules automatically. + +``` +# Part of file: /etc/default/spamassassin + +CRON=1 +``` + +## OpenLDAP backend special + +### Fix improper LDAP query command in domain transport query file + +Please open file `/etc/postfix/ldap/transport_maps_domain.cf` (on Linux/OpenBSD) +or `/usr/local/etc/postfix/ldap/transport_maps_domain.cf` (on FreeBSD), add +addition LDAP filter `(!(domainBackupMX=yes))` in `query =` parameter: + +``` +# Part of file: /etc/postfix/ldap/transport_maps_domain.cf + +# OLD setting +#query_filter = (&(objectClass=mailDomain)(accountStatus=active)(enabledService=mail)(|(domainName=%s)(domainAliasName=%s))) + +# NEW setting +query_filter = (&(objectClass=mailDomain)(accountStatus=active)(enabledService=mail)(|(domainName=%s)(domainAliasName=%s))(!(domainBackupMX=yes))) +``` + +Restarting Postfix service is required. + +### Add new LDAP values for existing mail users + +We will add new LDAP attribute/value pair for existing mail users: +`enabledService=indexer-worker`. It's used by Dovecot. + +* Download below python script to adding new values for existing mail users. + +``` +# cd /root/ +# wget https://bitbucket.org/zhb/iredmail/raw/default/extra/update/updateLDAPValues_087_to_090.py +``` + +* Open downloaded file `updateLDAPValues_087_to_090.py`, set LDAP server related +settings in this file. For example: + +``` +# Part of file: updateLDAPValues_087_to_090.py + +uri = 'ldap://127.0.0.1:389' +basedn = 'o=domains,dc=example,dc=com' +bind_dn = 'cn=vmailadmin,dc=example,dc=com' +bind_pw = 'passwd' +``` + +You can find required LDAP credential in iRedAdmin config file or `iRedMail.tips` +file under your iRedMail installation directory. Using either +`cn=Manager,dc=xx,dc=xx` or `cn=vmailadmin,dc=xx,dc=xx` as bind dn is ok. + +* Execute this script, it will fix incorrect values and add correct ones: + +``` +# python updateLDAPValues_087_to_090.py +``` + +That's all. + +### Add index for SQL column in `amavisd` database + +We need indexes for some SQL columns in `amavisd` database: +`policy.policy_name`, `msgs.spam_level`. Both are used by iRedAdmin-Pro. + +Now connect to SQL server as MySQL root user, create new columns, add required INDEX: + +``` +$ mysql -uroot -p +mysql> USE amavisd; +mysql> CREATE UNIQUE INDEX policy_idx_policy_name ON policy (policy_name); +mysql> CREATE INDEX msgs_idx_spam_level ON msgs (spam_level); +``` + +## MySQL backend special + +### Fix improper SQL query command in domain transport query file + +Please open file `/etc/postfix/mysql/transport_maps_domain.cf` (on Linux/OpenBSD) +or `/usr/local/etc/postfix/mysql/transport_maps_domain.cf` (on FreeBSD), add +addition SQL statement `AND backupmx=0` in `query =` parameter: + +``` +# Part of file: /etc/postfix/mysql/transport_maps_domain.cf + +# OLD setting +#query = SELECT transport FROM domain WHERE domain='%s' AND active=1 + +# NEW setting +query = SELECT transport FROM domain WHERE domain='%s' AND active=1 AND backupmx=0 +``` + +Restarting Postfix service is required. + +### Add and remove SQL columns in `vmail` and `amavisd` databases + +* We need new SQL columns in `vmail` database: `mailbox.enableindexer-worker`, + it's used by Dovecot. + +* We need new indexes for some 2 columns in `amavisd` database: + `policy.policy_name`, `msgs.spam_level`. Both are used by iRedAdmin-Pro. + +Now connect to SQL server as MySQL root user, create new columns, add required +indexes: + +``` +$ mysql -uroot -p +mysql> USE vmail; +mysql> ALTER TABLE mailbox ADD COLUMN `enableindexer-worker` TINYINT(1) NOT NULL DEFAULT 1; +mysql> ALTER TABLE mailbox ADD INDEX (`enableindexer-worker`); + +mysql> USE amavisd; +mysql> CREATE UNIQUE INDEX policy_idx_policy_name ON policy (policy_name); +mysql> CREATE INDEX msgs_idx_spam_level ON msgs (spam_level); +``` + +## PostgreSQL backend special + +### Fix improper SQL query command in domain transport query file + +Please open file `/etc/postfix/pgsql/transport_maps_domain.cf` (on Linux/OpenBSD) +or `/usr/local/etc/postfix/pgsql/transport_maps_domain.cf` (on FreeBSD), add +addition SQL statement `AND backupmx=0` in `query =` parameter: + +``` +# Part of file: /etc/postfix/pgsql/transport_maps_domain.cf + +# OLD setting +#query = SELECT transport FROM domain WHERE domain='%s' AND active=1 + +# NEW setting +query = SELECT transport FROM domain WHERE domain='%s' AND active=1 AND backupmx=0 +``` + +Restarting Postfix service is required. + +### Add and remove SQL columns in `vmail` and `amavisd` databases + +* We need new SQL columns in `vmail` database: `mailbox.enableindexer-worker`, + it's used by Dovecot. + +* We need new indexes for some 2 columns in `amavisd` database: + `policy.policy_name`, `msgs.spam_level`. Both are used by iRedAdmin-Pro. + +Now connect to SQL server as PostgreSQL admin user, create new columns, add +required indexes: + +``` +# su - postgres +$ psql -d vmail +sql> ALTER TABLE mailbox ADD COLUMN enableindexer-worker INT2 NOT NULL DEFAULT 1; +sql> CREATE INDEX idx_mailbox_enableindexer_worker ON mailbox (enableindexer-worker); + +sql> \c amavisd; +sql> CREATE UNIQUE INDEX policy_idx_policy_name ON policy (policy_name); +sql> CREATE INDEX msgs_idx_spam_level ON msgs (spam_level); +```