Upgrade/iRedMail/0.6.1-0.7.0

From iRedMail

(Difference between revisions)
Jump to: navigation, search
(General Update, all backends should apply these changes)
(Support mail list of alias domain)
Line 17: Line 17:
= OpenLDAP backend only =
= OpenLDAP backend only =
-
== Support mail list of alias domain ==
+
== Support alias domain in mail list/alias ==
* Edit /etc/postfix/ldap_virtual_group_maps.cf, remove "domainName=%d" in '''search_base''':
* Edit /etc/postfix/ldap_virtual_group_maps.cf, remove "domainName=%d" in '''search_base''':
{{cfg|/etc/postfix/ldap_virtual_group_maps.cf|<pre>
{{cfg|/etc/postfix/ldap_virtual_group_maps.cf|<pre>
Line 25: Line 25:
# NEW SETTING
# NEW SETTING
search_base    = o=domains,dc=XXX
search_base    = o=domains,dc=XXX
 +
</pre>}}
 +
 +
* Edit /etc/postfix/ldap_catchall_maps.cf, set '''query_filter''' to:
 +
{{cfg|/etc/postfix/ldap_catchall_maps.cf|<pre>
 +
# NEW SETTING
 +
query_filter    = (&(objectClass=mailUser)(accountStatus=active)(|(mail=@%d)(shadowAddress=@%d)))
</pre>}}
</pre>}}

Revision as of 08:48, 9 March 2011

Contents




To be continued, do NOT apply below steps.


General Update, all backends should apply these changes

OpenLDAP backend only

Support alias domain in mail list/alias

  • Edit /etc/postfix/ldap_virtual_group_maps.cf, remove "domainName=%d" in search_base:
File: /etc/postfix/ldap_virtual_group_maps.cf
# OLD SETTING
search_base     = domainName=%d,o=domains,dc=XXX

# NEW SETTING
search_base     = o=domains,dc=XXX
  • Edit /etc/postfix/ldap_catchall_maps.cf, set query_filter to:
File: /etc/postfix/ldap_catchall_maps.cf
# NEW SETTING
query_filter     = (&(objectClass=mailUser)(accountStatus=active)(|(mail=@%d)(shadowAddress=@%d)))

Add missing value for mail users

iRedMail-0.7.0 requires enabledService=smtpsecured for sending mail via SMTP over SSL in Postfix. so we should add it if users doesn't have it.

Steps:

  • Download python script used to adding missing values.
Terminal:
# cd /root/
# wget http://iredmail.googlecode.com/hg/extra/update/updateLDAPValues_061_to_070.py
  • Open updateLDAPValues_061_to_070.py, config below parameters in file head:
File: updateLDAPValues_061_to_070.py
uri = 'ldap://127.0.0.1:389'
basedn = 'o=domains,dc=iredmail,dc=org'
bind_dn = 'cn=vmailadmin,dc=iredmail,dc=org'
bind_pw = 'passwd'

Tip:

    • You can find them in iRedAdmin config file or iRedMail.tips file under your iRedMail installation directory.
    • Use 'cn=Manager' instead of 'cn=vmailadmin' here is ok too.
  • Execute this script, it will add missing values for mail accounts:
Terminal:
# python updateLDAPValues_061_to_070.py

MySQL backend only

Improve backup mx support

  • Edit /etc/postfix/mysql_virtual_alias_maps.cf, change query = to below new setting:
File: /etc/postfix/mysql_virtual_alias_maps.cf
query       = SELECT goto FROM alias,domain WHERE (alias.address='%s' OR alias.address='@%d') AND alias.active='1' AND domain.backupmx='0'
  • Edit /etc/postfix/mysql_domain_alias_maps.cf, change query = to below new setting:
File: /etc/postfix/mysql_domain_alias_maps.cf
query       = SELECT goto FROM alias,alias_domain,domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('%u', '@', alias_domain.target_domain) AND alias.active = 1 AND alias_domain.active='1' AND domain.backupmx='0'

Check domain status in virtual_mailbox_maps, virtual_alias_maps

  • Edit /etc/postfix/mysql_virtual_mailbox_maps.cf, change query = to below new setting:
File: mysql_virtual_mailbox_maps.cf
query       = SELECT CONCAT(mailbox.storagenode, '/', mailbox.maildir) FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.active='1' AND mailbox.enabledeliver='1' AND domain.domain = mailbox.domain AND domain.active='1'
  • Edit /etc/postfix/mysql_virtual_alias_maps.cf, change query = to below new setting:
File: mysql_virtual_alias_maps.cf
query       = SELECT alias.goto FROM alias,domain WHERE (alias.address='%s' OR alias.address='@%    d') AND alias.active='1' AND domain.backupmx='0' AND domain.active='1'                          

It will now check domain status, so if this domain is disabled, all users and aliases will be disabled too.

Update SQL structure of vmail database

Add more columns and create indexes.

Terminal:
$ mysql -uroot -p
USE vmail;

-- enablesmtpsecured: Used for SMTP over SSL support in Postfix + Dovecot.
ALTER TABLE mailbox ADD COLUMN enablesmtpsecured TINYINT(1) NOT NULL DEFAULT '1';

-- name: Used to store common name of admin and alias account.
ALTER TABLE admin ADD COLUMN name VARCHAR(255) DEFAULT '' COLLATE utf8_general_ci;
ALTER TABLE alias ADD COLUMN name VARCHAR(255) DEFAULT '' COLLATE utf8_general_ci;

-- local_part: Used for PostfixAdmin compatible.
ALTER TABLE mailbox ADD COLUMN local_part VARCHAR(255) NOT NULL DEFAULT '';

-- defaultuseraliases: Assign new user to these aliases
ALTER TABLE domain ADD COLUMN defaultuseraliases TEXT NOT NULL DEFAULT '';

-- defaultpasswordscheme: Per-domain password scheme support.
ALTER TABLE domain ADD COLUMN defaultpasswordscheme VARCHAR(10) NOT NULL DEFAULT '';
Personal tools