2014-12-03 08:11:32 -06:00
< html >
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" / >
< title > Upgrade iRedMail from 0.8.7 to 0.9.0< / title >
2015-07-31 23:14:52 -05:00
< link rel = "stylesheet" type = "text/css" href = "./css/markdown.css" / >
2014-12-03 08:11:32 -06:00
< / head >
< body >
< div id = "navigation" >
2016-03-15 08:23:02 -06:00
< a href = "/index.html" target = "_blank" > < img alt = "iRedMail web site" src = "images/logo-iredmail.png" style = "vertical-align: middle; height: 30px;" / > < span > iRedMail< / span > < / a >
2016-02-29 02:15:19 -06:00
// < a href = "./index.html" > Document Index< / a > < / div > < h1 id = "upgrade-iredmail-from-087-to-090" > Upgrade iRedMail from 0.8.7 to 0.9.0< / h1 >
2014-12-03 08:11:32 -06:00
< div class = "toc" >
< ul >
< li > < a href = "#upgrade-iredmail-from-087-to-090" > Upgrade iRedMail from 0.8.7 to 0.9.0< / a > < ul >
< li > < a href = "#changelog" > ChangeLog< / a > < / li >
< li > < a href = "#general-all-backends-should-apply-these-steps" > General (All backends should apply these steps)< / a > < ul >
< li > < a href = "#update-etciredmail-release-with-iredmail-version-number" > Update /etc/iredmail-release with iRedMail version number< / a > < / li >
< li > < a href = "#upgrade-roundcube-webmail-to-the-latest-stable-release" > Upgrade Roundcube webmail to the latest stable release< / a > < / li >
2014-12-03 08:42:40 -06:00
< li > < a href = "#upgrade-iredapd-postfix-policy-server-to-the-latest-144" > Upgrade iRedAPD (Postfix policy server) to the latest 1.4.4< / a > < / li >
2014-12-03 08:51:42 -06:00
< li > < a href = "#upgrade-iredadmin-open-source-edition-to-the-latest-stable-release" > Upgrade iRedAdmin (open source edition) to the latest stable release< / a > < / li >
2014-12-04 07:23:01 -06:00
< li > < a href = "#disable-sslv3-support" > Disable SSLv3 support< / a > < ul >
< li > < a href = "#disable-sslv3-in-apache" > Disable SSLv3 in Apache< / a > < / li >
< li > < a href = "#disable-sslv3-in-postfix" > Disable SSLv3 in Postfix< / a > < / li >
< li > < a href = "#disable-sslv3-in-dovecot" > Disable SSLv3 in Dovecot< / a > < / li >
< / ul >
< / li >
2014-12-03 08:11:32 -06:00
< li > < a href = "#fix-improper-postfix-setting-in-both-maincf-and-mastercf" > Fix improper Postfix setting in both main.cf and master.cf< / a > < / li >
< li > < a href = "#fix-improper-file-permission-of-amavisd-config-file" > Fix improper file permission of Amavisd config file< / a > < / li >
< li > < a href = "#fix-incorrect-setting-to-enable-daily-cron-job-to-update-spamassassin-rules" > Fix incorrect setting to enable daily cron job to update SpamAssassin rules< / a > < / li >
2015-01-05 00:45:05 -06:00
< li > < a href = "#optional-enable-global-sieve-script-in-dovecot-to-move-spam-to-junk-folder-by-default" > [OPTIONAL] Enable global sieve script in Dovecot to move spam to Junk folder by default< / a > < / li >
2014-12-03 08:11:32 -06:00
< / ul >
< / li >
< li > < a href = "#openldap-backend-special" > OpenLDAP backend special< / a > < ul >
< li > < a href = "#fix-improper-ldap-query-command-in-domain-transport-query-file" > Fix improper LDAP query command in domain transport query file< / a > < / li >
< li > < a href = "#add-new-ldap-values-for-existing-mail-users" > Add new LDAP values for existing mail users< / a > < / li >
< li > < a href = "#add-index-for-sql-column-in-amavisd-database" > Add index for SQL column in amavisd database< / a > < / li >
< / ul >
< / li >
< li > < a href = "#mysql-backend-special" > MySQL backend special< / a > < ul >
< li > < a href = "#fix-improper-sql-query-command-in-domain-transport-query-file" > Fix improper SQL query command in domain transport query file< / a > < / li >
< li > < a href = "#add-and-remove-sql-columns-in-vmail-and-amavisd-databases" > Add and remove SQL columns in vmail and amavisd databases< / a > < / li >
< / ul >
< / li >
< li > < a href = "#postgresql-backend-special" > PostgreSQL backend special< / a > < ul >
< li > < a href = "#fix-improper-sql-query-command-in-domain-transport-query-file_1" > Fix improper SQL query command in domain transport query file< / a > < / li >
< li > < a href = "#add-and-remove-sql-columns-in-vmail-and-amavisd-databases_1" > Add and remove SQL columns in vmail and amavisd databases< / a > < / li >
< / ul >
< / li >
< / ul >
< / li >
< / ul >
< / div >
2016-03-30 04:57:49 -06:00
< div class = "admonition note" >
< p class = "admonition-title" > Paid Remote Upgrade Support< / p >
< p > We offer remote upgrade support if you don't want to get your hands dirty,
check < a href = "../support.html" > the details< / a > and < a href = "../contact.html" > contact us< / a > .< / p >
< / div >
2014-12-03 08:11:32 -06:00
< h2 id = "changelog" > ChangeLog< / h2 >
< ul >
2015-08-19 09:08:33 -05:00
< li > 2015-08-19: [All backends] If < code > @lookup_sql_dsn< / code > is disabled in Amavisd, you
can use SQL username/password defined in < code > @storage_sql_dsn< / code >
instead.< / li >
< li > 2015-01-05: [All backends] [OPTIONAL] Enable global sieve script in Dovecot
to move spam to Junk folder by default.< / li >
2015-01-05 00:45:05 -06:00
< / ul >
< hr / >
< ul >
2014-12-24 08:25:29 -06:00
< li > 2014-12-24: [All backends] Modify type of SQL column < code > policy.policy_name< / code > to VARCHAR(255).< / li >
2014-12-04 07:23:01 -06:00
< li > 2014-12-04: [All backends] Disable SSL v3 in Apache, Postfix, Dovecot.< / li >
2014-12-03 08:11:32 -06:00
< li > 2014-11-13: [All backends] Add index for SQL column < code > msgs.spam_level< / code > in < code > amavisd< / code > database.< / li >
2015-01-08 10:32:15 -06:00
< li > 2014-11-06: < strike > [All backends] Fix improper SQL query command in domain transport query file.< / strike > < / li >
2014-12-03 08:11:32 -06:00
< li > 2014-09-09: [All backends] Fix incorrect setting to enable daily cron job to update SpamAssassin rules.< / li >
< li > 2014-09-09: [All backends] Fix improper permission of Amavisd config file.< / li >
2015-01-08 10:32:15 -06:00
< li > 2014-07-15: < strike > [All backends] Fix improper Postfix setting in both main.cf and master.cf.< / strike > < / li >
2014-12-03 08:11:32 -06:00
< li > 2014-06-19: [All backends] Add index for SQL column < code > policy.policy_name< / code > in < code > amavisd< / code > database.< / li >
< li > 2014-06-07:< ul >
< li > [OpenLDAP] Add new value for existing mail users: enabledService=indexer-worker.< / li >
< li > [MySQL/PostgreSQL] New SQL column in < code > vmail< / code > database: mailbox.enableindexer-worker.< / li >
< / ul >
< / li >
< / ul >
< h2 id = "general-all-backends-should-apply-these-steps" > General (All backends should apply these steps)< / h2 >
< h3 id = "update-etciredmail-release-with-iredmail-version-number" > Update /etc/iredmail-release with iRedMail version number< / h3 >
< p > iRedMail stores the release version in < code > /etc/iredmail-release< / code > 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:< / p >
< pre > < code > # File: /etc/iredmail-release
2014-12-03 08:42:40 -06:00
2014-12-03 08:11:32 -06:00
0.9.0
< / code > < / pre >
< h3 id = "upgrade-roundcube-webmail-to-the-latest-stable-release" > Upgrade Roundcube webmail to the latest stable release< / h3 >
< p > Please follow Roundcube official tutorial to upgrade Roundcube webmail to the
latest stable release immediately: < a href = "http://trac.roundcube.net/wiki/Howto_Upgrade" > How to upgrade Roundcube< / a > < / p >
2014-12-03 08:42:40 -06:00
< h3 id = "upgrade-iredapd-postfix-policy-server-to-the-latest-144" > Upgrade iRedAPD (Postfix policy server) to the latest 1.4.4< / h3 >
2014-12-31 20:38:57 -06:00
< p > Please follow below tutorial to upgrade iRedAPD to the latest stable release:
2015-09-20 20:22:31 -05:00
< a href = "./upgrade.iredapd.html" > Upgrade iRedAPD to the latest stable release< / a > < / p >
2016-02-29 07:18:38 -06:00
< div class = "admonition note" >
< p class = "admonition-title" > Important Notes< / p >
2015-01-04 00:35:42 -06:00
< ul >
2016-02-29 07:18:38 -06:00
< li > in iRedMail-0.9.0 and future iRedMail releases, we will use
white/blacklists stored in Amavisd database in Amavisd (after-queue) and
iRedAPD (before-queue), so you must enable iRedAPD plugin < code > amavisd_wblist< / code > .< / li >
2015-01-07 07:35:53 -06:00
< li > it's strongly recommended to enable plugin < code > reject_null_sender< / code > (as first
plugin listed in iRedAPD parameter < code > plugins =< / code > ) to prevent spam.< / li >
2015-01-04 00:35:42 -06:00
< / ul >
2016-02-29 07:18:38 -06:00
< / div >
2014-12-22 02:29:10 -06:00
< p > iRedAPD-1.4.4 fixes several issues and brings some new features:< / p >
< ul >
< li >
2014-12-31 20:33:55 -06:00
< p > iRedAPD now works with Postfix parameter < code > smtpd_end_of_data_restrictions< / code >
(smtp protocol state < code > END-OF-MESSAGE< / code > ).< / p >
< / li >
< li >
2014-12-22 02:29:10 -06:00
< p > New plugins:< / p >
< ul >
2015-01-07 07:35:53 -06:00
< li >
< p > < code > reject_null_sender< / code > : prevent authenticated user to send spam as null
sender (< code > from=< > < / code > in Postfix log file).< / p >
< / li >
2014-12-22 02:29:10 -06:00
< li >
< p > < code > amavisd_wblist< / code > : it uses per-recipient white/blacklists stored in
Amavisd SQL database to reject emails sent from blacklisted senders and
bypass whitelisted senders.< / p >
< p > White/blacklist could be global (server-wide) setting, per-domain setting,
or per-user setting. Priority: per-user > per-domain > global.< / p >
< / li >
< li >
< p > < code > amavisd_message_size_limit< / code > : limit size of single incoming mail.< / p >
< p > Message size limit could be global (server-wide) setting, per-domain setting,
or per-user setting. Priority: per-user > per-domain > global.< / p >
< / li >
< / ul >
< / li >
< li >
2014-12-31 20:33:55 -06:00
< p > Plugin < code > reject_sender_login_mismatch< / code > now will allow user to send as their
own alias addresses by default. You can still set
2015-01-04 00:35:42 -06:00
< code > ALLOWED_LOGIN_MISMATCH_STRICTLY = False< / code > in iRedAPD config file
(< code > /opt/iredapd/settings.py< / code > ) to allow user to send as any sender if you want.< / p >
2015-01-07 07:35:53 -06:00
< p > It's recommended to enable this plugin right after plugin < code > reject_null_sender< / code > .< / p >
2014-12-22 02:29:10 -06:00
< / li >
< / ul >
2015-01-15 20:51:04 -06:00
< p > Suggested order of above 3 plugins are (if you enabled them):< / p >
< pre > < code > plugins = ['reject_null_sender', 'reject_sender_login_mismatch', 'amavisd_wblist', ...]
< / code > < / pre >
2016-02-29 07:18:38 -06:00
< div class = "admonition note" >
< p class = "admonition-title" > Important Notes< / p >
2015-01-23 07:00:27 -06:00
< ul >
< li >
< p > If you want to manage white/blacklists with the latest iRedAdmin-Pro, you
have to enable plugin < code > amavisd_wblist< / code > .< / p >
< / li >
< li >
< p > Plugin < code > amavisd_wblist< / code > and < code > amavisd_message_size_limit< / code > requires additional
database related settings in iRedAPD config file, please set correct values
for them. You can find SQL database settings in Amavisd config file,
2015-08-19 09:08:33 -05:00
in parameter < code > @lookup_sql_dsn =< / code > , if < code > @lookup_sql_dsn< / code > is disabled, you can
find them in < code > @storage_sql_dsn =< / code > .< / p >
2015-01-23 07:00:27 -06:00
< / li >
< / ul >
2016-02-29 07:18:38 -06:00
< / div >
2015-01-23 07:00:27 -06:00
< pre > < code > amavisd_db_server = '127.0.0.1'
amavisd_db_port = 3306
amavisd_db_name = 'amavisd'
amavisd_db_user = 'amavisd'
amavisd_db_password = 'password'
< / code > < / pre >
2014-12-03 08:51:42 -06:00
< h3 id = "upgrade-iredadmin-open-source-edition-to-the-latest-stable-release" > Upgrade iRedAdmin (open source edition) to the latest stable release< / h3 >
< p > Please follow this tutorial to upgrade iRedAdmin open source edition to the
latest stable release: < a href = "./migrate.or.upgrade.iredadmin.html" > Upgrade iRedAdmin to the latest stable release< / a > < / p >
2014-12-04 07:23:01 -06:00
< h3 id = "disable-sslv3-support" > Disable SSLv3 support< / h3 >
< p > I believe you already heard about the < code > POODLE< / code > issue of SSL protocol v3.
POODLE stands for Padding Oracle On Downgraded Legacy Encryption. This
vulnerability allows a man-in-the-middle attacker to decrypt ciphertext using
a padding oracle side-channel attack. More details are available in the
upstream OpenSSL advisory: < a href = "http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-3566" > Vulnerability Summary for CVE-2014-3566< / a > .< / p >
< p > The safest short-term response is to disable SSLv3 support.< / p >
< h4 id = "disable-sslv3-in-apache" > Disable SSLv3 in Apache< / h4 >
< p > Please add or update < code > SSLProtocol< / code > setting in Apache config file like below:< / p >
< ul >
2014-12-31 20:41:30 -06:00
< li > on RHEL/CentOS, it's < code > /etc/httpd/conf.d/ssl.conf< / code > .< / li >
2014-12-04 07:23:01 -06:00
< li > on Debian/Ubuntu, it's < code > /etc/apache2/apache2.conf< / code > .< / li >
< li > on FreeBSD, it's < code > /usr/local/etc/apache2[X]/httpd.conf< / code > . Please replace
< code > apache2[X]< / code > by the real Apache version number here.< / li >
< / ul >
< pre > < code > SSLProtocol ALL -SSLv2 -SSLv3
< / code > < / pre >
< p > Restarting Apache service is required.< / p >
< h4 id = "disable-sslv3-in-postfix" > Disable SSLv3 in Postfix< / h4 >
2016-02-25 10:02:13 -06:00
< p > Please execute commands below to disable SSLv3 in Postfix:< / p >
< pre > < code > postconf -e smtpd_tls_protocols='!SSLv2 !SSLv3'
postconf -e smtp_tls_protocols='!SSLv2 !SSLv3'
postconf -e lmtp_tls_protocols='!SSLv2 !SSLv3'
postconf -e smtpd_tls_mandatory_protocols='!SSLv2 !SSLv3'
postconf -e smtp_tls_mandatory_protocols='!SSLv2 !SSLv3'
postconf -e lmtp_tls_mandatory_protocols='!SSLv2 !SSLv3'
2014-12-04 07:23:01 -06:00
< / code > < / pre >
< p > Restarting Postfix service is required.< / p >
< h4 id = "disable-sslv3-in-dovecot" > Disable SSLv3 in Dovecot< / h4 >
< p > Please add below setting in Dovecot main config file < code > /etc/dovecot/dovecot.conf< / code >
(on Linux/OpenBSD) or < code > /usr/local/etc/dovecot/dovecot.conf< / code > (on FreeBSD).< / p >
< pre > < code > ssl_protocols = !SSLv2 !SSLv3
< / code > < / pre >
< p > Restarting Dovecot service is required.< / p >
2014-12-03 08:11:32 -06:00
< h3 id = "fix-improper-postfix-setting-in-both-maincf-and-mastercf" > Fix improper Postfix setting in both main.cf and master.cf< / h3 >
2015-01-08 10:32:15 -06:00
< p > NOTE: This step is wrong, please do not apply it. If you already applied it,
please revert your changes.< / p >
< p > if you send email to user < code > user@domain.com< / code > and mail list/alias < code > list@domain.com< / code > ,
and < code > user@< / code > is member of < code > list@< / code > , then < code > user@< / code > will receive duplicate email.< / p >
< p > < strike >
Currently, we don't have Postfix parameter < code > receive_override_options=< / code > set in
2014-12-03 08:11:32 -06:00
< code > /etc/postfix/main.cf< / code > , instead, we have it in transport < code > 127.0.0.1:10025< / code >
(Amavisd) like this:< / p >
< pre > < code > # 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
< / code > < / pre >
< p > Without < code > receive_override_options=no_address_mappings< / code > in < code > main.cf< / code > :< / p >
< ul >
< li >
< p > Postfix will enable canonical address mapping, virtual alias map expansion,
address masquerading, and automatic BCC (blind carbon-copy) recipients
< strong > BEFORE< / strong > 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 < code > receive_override_options=no_address_mappings< / code > , Postfix
won't expand original recipient to 3 addresses, and Amavisd gets only 1 email
for scanning. It slightly improves mail server performance.< / p >
< / li >
< li >
< p > 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.< / p >
< / li >
< / ul >
< p > Please apply below steps to fix above issues:< / p >
< ul >
< li > Add < code > receive_override_options< / code > in Postfix with below shell command:< / li >
< / ul >
< pre > < code > # postconf -e receive_override_options='no_address_mappings'
< / code > < / pre >
< ul >
< li > Open file < code > /etc/postfix/master.cf< / code > (On Linux/OpenBSD) or
< code > /usr/local/etc/postfix/master.cf< / code > (on FreeBSD), find setting for transport
< code > 127.0.0.1:10025< / code > , remove < code > no_address_mappings< / code > for its
< code > receive_override_options< / code > option:< / li >
< / ul >
< pre > < code > # 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
< / code > < / pre >
< ul >
< li > Restart Postfix service.< / li >
< / ul >
2016-02-29 07:18:38 -06:00
< div class = "admonition note" >
< p class = "admonition-title" > Note< / p >
< p > If you want to disable < code > content_filter=< / code > in Postfix, please
2014-12-03 08:11:32 -06:00
comment out < code > receive_override_options=< / code > in Postfix config file < code > main.cf< / code > too,
otherwise canonical address mapping, virtual alias map expansion, address
2016-02-29 07:18:38 -06:00
masquerading, and automatic BCC (blind carbon-copy) recipients will not work.< / p >
< / div >
< p > < / strike > < / p >
2014-12-03 08:11:32 -06:00
< h3 id = "fix-improper-file-permission-of-amavisd-config-file" > Fix improper file permission of Amavisd config file< / h3 >
< p > < strong > NOTE< / strong > : This step is applicable to only Red Hat/CentOS 6.< / p >
< p > Amavisd config file < code > /etc/amavisd/amavisd.conf< / code > must be owned by group < code > amavis< / code > ,
otherwise after you upgraded to Red Hat/CentOS 7, Amavisd service cannot start.< / p >
< pre > < code > # chgrp amavis /etc/amavisd/amavisd.conf
< / code > < / pre >
< h3 id = "fix-incorrect-setting-to-enable-daily-cron-job-to-update-spamassassin-rules" > Fix incorrect setting to enable daily cron job to update SpamAssassin rules< / h3 >
< p > < strong > NOTE< / strong > : This step is applicable to only Debian and Ubuntu.< / p >
< p > Please update file < code > /etc/default/spamassassin< / code > to set < code > CRON=1< / code > , so that
SpamAssassin daily cron job will update SpamAssassin rules automatically.< / p >
< pre > < code > # Part of file: /etc/default/spamassassin
CRON=1
< / code > < / pre >
2015-01-05 00:45:05 -06:00
< h3 id = "optional-enable-global-sieve-script-in-dovecot-to-move-spam-to-junk-folder-by-default" > [OPTIONAL] Enable global sieve script in Dovecot to move spam to Junk folder by default< / h3 >
< p > Note: this is an optional step.< / p >
2015-01-06 19:55:25 -06:00
< p > Please follow our separate tutorial < a href = "./move.detected.spam.to.junk.folder.html" > here< / a > .< / p >
2014-12-03 08:11:32 -06:00
< h2 id = "openldap-backend-special" > OpenLDAP backend special< / h2 >
< h3 id = "fix-improper-ldap-query-command-in-domain-transport-query-file" > Fix improper LDAP query command in domain transport query file< / h3 >
2015-01-08 10:32:15 -06:00
< p > NOTE: This step is wrong, please do not apply it. If you already applied it,
please revert your changes.< / p >
< p > < strike >
Please open file < code > /etc/postfix/ldap/transport_maps_domain.cf< / code > (on Linux/OpenBSD)
2014-12-03 08:11:32 -06:00
or < code > /usr/local/etc/postfix/ldap/transport_maps_domain.cf< / code > (on FreeBSD), add
2015-01-05 00:45:05 -06:00
additional LDAP filter < code > (!(domainBackupMX=yes))< / code > in < code > query =< / code > parameter:< / p >
2014-12-03 08:11:32 -06:00
< pre > < code > # 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)))
< / code > < / pre >
2015-01-08 10:32:15 -06:00
< p > Restarting Postfix service is required.
< / strike > < / p >
2014-12-03 08:11:32 -06:00
< h3 id = "add-new-ldap-values-for-existing-mail-users" > Add new LDAP values for existing mail users< / h3 >
< p > We will add new LDAP attribute/value pair for existing mail users:
< code > enabledService=indexer-worker< / code > . It's used by Dovecot.< / p >
< ul >
< li > Download below python script to adding new values for existing mail users.< / li >
< / ul >
< pre > < code > # cd /root/
# wget https://bitbucket.org/zhb/iredmail/raw/default/extra/update/updateLDAPValues_087_to_090.py
< / code > < / pre >
< ul >
< li > Open downloaded file < code > updateLDAPValues_087_to_090.py< / code > , set LDAP server related
settings in this file. For example:< / li >
< / ul >
< pre > < code > # 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'
< / code > < / pre >
< p > You can find required LDAP credential in iRedAdmin config file or < code > iRedMail.tips< / code >
file under your iRedMail installation directory. Using either
< code > cn=Manager,dc=xx,dc=xx< / code > or < code > cn=vmailadmin,dc=xx,dc=xx< / code > as bind dn is ok.< / p >
< ul >
2014-12-03 08:42:40 -06:00
< li > Execute this script, it will add required data:< / li >
2014-12-03 08:11:32 -06:00
< / ul >
< pre > < code > # python updateLDAPValues_087_to_090.py
< / code > < / pre >
< p > That's all.< / p >
< h3 id = "add-index-for-sql-column-in-amavisd-database" > Add index for SQL column in < code > amavisd< / code > database< / h3 >
< p > We need indexes for some SQL columns in < code > amavisd< / code > database:
< code > policy.policy_name< / code > , < code > msgs.spam_level< / code > . Both are used by iRedAdmin-Pro.< / p >
< p > Now connect to SQL server as MySQL root user, create new columns, add required INDEX:< / p >
< pre > < code > $ mysql -uroot -p
mysql> USE amavisd;
2014-12-24 08:25:29 -06:00
mysql> ALTER TABLE policy MODIFY COLUMN policy_name VARCHAR(255) NOT NULL DEFAULT '';
2014-12-03 08:11:32 -06:00
mysql> CREATE UNIQUE INDEX policy_idx_policy_name ON policy (policy_name);
mysql> CREATE INDEX msgs_idx_spam_level ON msgs (spam_level);
< / code > < / pre >
< h2 id = "mysql-backend-special" > MySQL backend special< / h2 >
< h3 id = "fix-improper-sql-query-command-in-domain-transport-query-file" > Fix improper SQL query command in domain transport query file< / h3 >
2015-01-08 10:32:15 -06:00
< p > NOTE: This step is wrong, please do not apply it. If you already applied it,
please revert your changes.< / p >
< p > < strike >
Please open file < code > /etc/postfix/mysql/transport_maps_domain.cf< / code > (on Linux/OpenBSD)
2014-12-03 08:11:32 -06:00
or < code > /usr/local/etc/postfix/mysql/transport_maps_domain.cf< / code > (on FreeBSD), add
2015-01-05 00:45:05 -06:00
additional SQL statement < code > AND backupmx=0< / code > in < code > query =< / code > parameter:< / p >
2014-12-03 08:11:32 -06:00
< pre > < code > # 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
< / code > < / pre >
2015-01-08 10:32:15 -06:00
< p > Restarting Postfix service is required.
< / strike > < / p >
2014-12-03 08:11:32 -06:00
< h3 id = "add-and-remove-sql-columns-in-vmail-and-amavisd-databases" > Add and remove SQL columns in < code > vmail< / code > and < code > amavisd< / code > databases< / h3 >
< ul >
< li >
< p > We need new SQL columns in < code > vmail< / code > database: < code > mailbox.enableindexer-worker< / code > ,
it's used by Dovecot.< / p >
< / li >
< li >
< p > We need new indexes for some 2 columns in < code > amavisd< / code > database:
< code > policy.policy_name< / code > , < code > msgs.spam_level< / code > . Both are used by iRedAdmin-Pro.< / p >
< / li >
< / ul >
< p > Now connect to SQL server as MySQL root user, create new columns, add required
indexes:< / p >
< pre > < code > $ 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;
2014-12-24 08:25:29 -06:00
mysql> ALTER TABLE policy MODIFY COLUMN policy_name VARCHAR(255) NOT NULL DEFAULT '';
2014-12-03 08:11:32 -06:00
mysql> CREATE UNIQUE INDEX policy_idx_policy_name ON policy (policy_name);
mysql> CREATE INDEX msgs_idx_spam_level ON msgs (spam_level);
< / code > < / pre >
< h2 id = "postgresql-backend-special" > PostgreSQL backend special< / h2 >
< h3 id = "fix-improper-sql-query-command-in-domain-transport-query-file_1" > Fix improper SQL query command in domain transport query file< / h3 >
2015-01-08 10:32:15 -06:00
< p > NOTE: This step is wrong, please do not apply it. If you already applied it,
please revert your changes.< / p >
< p > < strike >
Please open file < code > /etc/postfix/pgsql/transport_maps_domain.cf< / code > (on Linux/OpenBSD)
2014-12-03 08:11:32 -06:00
or < code > /usr/local/etc/postfix/pgsql/transport_maps_domain.cf< / code > (on FreeBSD), add
2015-01-05 00:45:05 -06:00
additional SQL statement < code > AND backupmx=0< / code > in < code > query =< / code > parameter:< / p >
2014-12-03 08:11:32 -06:00
< pre > < code > # 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
< / code > < / pre >
2015-01-08 10:32:15 -06:00
< p > Restarting Postfix service is required.
< / strike > < / p >
2014-12-03 08:11:32 -06:00
< h3 id = "add-and-remove-sql-columns-in-vmail-and-amavisd-databases_1" > Add and remove SQL columns in < code > vmail< / code > and < code > amavisd< / code > databases< / h3 >
< ul >
< li >
< p > We need new SQL columns in < code > vmail< / code > database: < code > mailbox.enableindexer-worker< / code > ,
it's used by Dovecot.< / p >
< / li >
< li >
< p > We need new indexes for some 2 columns in < code > amavisd< / code > database:
< code > policy.policy_name< / code > , < code > msgs.spam_level< / code > . Both are used by iRedAdmin-Pro.< / p >
< / li >
< / ul >
< p > Now connect to SQL server as PostgreSQL admin user, create new columns, add
required indexes:< / p >
< pre > < code > # su - postgres
$ psql -d vmail
2014-12-31 20:51:24 -06:00
sql> ALTER TABLE mailbox ADD COLUMN " enableindexer-worker" INT2 NOT NULL DEFAULT 1;
sql> CREATE INDEX idx_mailbox_enableindexer_worker ON mailbox (" enableindexer-worker" );
2014-12-03 08:11:32 -06:00
sql> \c amavisd;
2014-12-24 08:25:29 -06:00
sql> ALTER TABLE policy ALTER COLUMN policy_name TYPE varchar(255);
2014-12-03 08:11:32 -06:00
sql> CREATE UNIQUE INDEX policy_idx_policy_name ON policy (policy_name);
sql> CREATE INDEX msgs_idx_spam_level ON msgs (spam_level);
2015-12-13 23:04:21 -06:00
< / code > < / pre > < p style = "text-align: center; color: grey;" > All documents are available in < a href = "https://bitbucket.org/zhb/iredmail-docs/src" > BitBucket repository< / a > , and published under < a href = "http://creativecommons.org/licenses/by-nd/3.0/us/" target = "_blank" > Creative Commons< / a > license. If you found something wrong, please do < a href = "http://www.iredmail.org/contact.html" > contact us< / a > to fix it.< script >
2015-02-05 07:02:53 -06:00
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-3293801-21', 'auto');
ga('send', 'pageview');
2014-12-03 08:11:32 -06:00
< / script >
< / body > < / html >