Difference between revisions of "Irfan-Notes"

Line 75: Line 75:
 
==Manually Copying ldap data from Master to Replica==
 
==Manually Copying ldap data from Master to Replica==
  
After converting the master ldap server to be a replica from the wiki http://wiki.zimbra.com/index.php?title=Promoting_Replica_to_LDAP_Master  the replica server may take time to sync entire data with the master server. You can follow these steps to manually copy the data from master server to the replica server. This is also useful if you have huge amount of ldap data on master and you don't wish to sync the entire data through the network.
+
After converting the master ldap server to be a replica from the wiki http://wiki.zimbra.com/index.php?title=Promoting_Replica_to_LDAP_Master  the replica server may take time to sync entire ldap data from the master server. These steps will guide you to manually copy the data from master server to the replica server. This is also useful if you have huge amount of ldap data on master and don't wish to sync the entire data through the network.
  
 
'''Steps to followed on the Master server:'''
 
'''Steps to followed on the Master server:'''

Revision as of 16:20, 16 November 2008



Local mail delivery problem

If you don't want to configure split dns, you can use this. By default postfix performs a lookup against dns for a local (lmtp) delivery. If want to avoid configuring split dns, you can set postfix_lmtp_host_lookup to native mode. Then postfix will lookup in /etc/hosts file to deliver a local email rather than doing a dns query.

su - zimbra
zmlocalconfig -e postfix_lmtp_host_lookup=native

You may need to restart zmcontrol to update the setting.


Using zimbra server only as a Store with a non-zimbra MTA

Delivering emails from an non-zimbra postfix server to Zimbra on lmtp (7025) port. This is an example for domain abc.com. Zimbra server address is server.zimbra.com

1. Make sure mx for abc.com pointed to postfix sever. And it can receive emails for abc.com 2. Create abc.com domain in zimbra. 3. Add "mailbox_transport" parameter to main.cf to deliver emails to zimbra server.

mailbox_transport = lmtp:<zimbra_hostname>:7025

Save and reload postfix.

Important: User account must be created on zimbra server whom mails are sent.

That should be enough to deliver all emails to zimbra server.


Holding the Postfix Queue at time of server migration/maintenance

Holding the postfix queue at the time of migration. Specifically at the time when you need mailboxd to be running so that imapsync can inject emails.

Hold the queue:

 postsuper -h ALL

Release the hold queue:

 postsuper -r ALL

To delete the mails from the queue:

 'cat /tmp/deletelist | /opt/zimbra/postfix/sbin/postsuper -d -'
  • Other way it to create a file and define the user's whose emails you want to hold.

1.Create a stub file called /opt/zimbra/conf/migration-hold that will be used by Postfix to HOLD messages and then "postmap" this file to create the .db hash file.

2. Modify /opt/zimbra/conf/postfix_recipient_restrictions.cf to include the line in bold below.

     reject_non_fqdn_recipient
     permit_sasl_authenticated
     permit_mynetworks
     reject_unlisted_recipient
     check_recipient_access hash:/opt/zimbra/conf/migration-hold
     permit
 

3. Execute "postfix reload" as the zimbra user. main.cf will now reference the new migration-hold file

4. The migration-hold file will contain the full list of email addresses that will be migrated during the impending migration in the following format:

 address1@domain.com              HOLD migration in progress
 address2@domain.com              HOLD migration in progress

Now the MTA will accept the message, but place it in the HOLD queue as shown below:

postfix/smtpd[5584]: NOQUEUE: hold: RCPT from unknown[xx.xx.xx.xx]: <sender@domain>: Recipient address migration in progress; from=<sender@domain.org> to=<recepient@domain>

5. Finally, the "postsuper -H ALL" command should be executed on each Zimbra MTA to allow all held mail to be moved back into the active queue for delivery.

6. After migration has been completed, all empty migration-hold file will be removed and postfix_recipient_restrictions.cf will have the check_recipient_access line deleted.


Manually Copying ldap data from Master to Replica

After converting the master ldap server to be a replica from the wiki http://wiki.zimbra.com/index.php?title=Promoting_Replica_to_LDAP_Master the replica server may take time to sync entire ldap data from the master server. These steps will guide you to manually copy the data from master server to the replica server. This is also useful if you have huge amount of ldap data on master and don't wish to sync the entire data through the network.

Steps to followed on the Master server:

1. Create a backup directory and take a dump of ldap data.

 mkdir /backup
 chown zimbra:zimbra /backup
 /opt/zimbra/libexec/zmslapcat /backup

Steps to follow on the Replica server:

1. Create a directory on replica server and copy the ldap dump in it.

 mkdir /backup
 chown zimbra:zimbra /backup
 Copy the ldap.bak from the master server's /backup directory and place it in /backup directory of this server.

2. Removing and recreating the openldap data.

 cp /opt/zimbra/openldap-data/DB_CONFIG /tmp
 rm -rf /opt/zimbra/openldap-data/*
 cp /tmp/DB_CONFIG /opt/zimbra/openldap-data/
 mkdir -p /opt/zimbra/openldap-data/logs /opt/zimbra/openldap-data/accesslog/db /opt/zimbra/openldap-data/accesslog/logs
 chown -R zimbra:zimbra /opt/zimbra/openldap-data

3. Restoring the ldap data.

 /opt/zimbra/openldap/sbin/slapadd -q -b "" -f /opt/zimbra/conf/slapd.conf -cv -l /backup/ldap.bak

You may need to restart zmcontrol on the replica. Also make sure if replica is syncing with the master server by looking at /var/log/zimbra.log file.


Replacing organiser of a meeting

1. zmmailbox -z -m user@domain.com gru /Calendar > /tmp/resourceA.ics

2. modify resourceA.ics (i.e. change the organizer from user to the new person) and rename it to, say, resourceA_updated.ics

3. zmmailbox -z -m resourceA@laika.com pru /Calendar /tmp/resourceA_updated.ics

Jump to: navigation, search