Posts Tagged ‘Zimbra’

Zimbra using Gmail Mail Relay

May 10th, 2011

Setting up gmail as a mail relay

You won’t be able to send or receive mail yet as you don’t have a mail relay set up. You can specify your ISPs mail server here or do what I do and use googles gmail servers.su – zimbra

zmprov ms mail.soundlinuxtraining.com zimbraMtaRelayHost smtp.gmail.com:587
echo smtp.gmail.com username:password > /opt/zimbra/conf/relay_password
postmap hash:/opt/zimbra/conf/relay_password
postconf -e smtp_sasl_password_maps=hash:/opt/zimbra/conf/relay_password
postconf -e smtp_sasl_auth_enable=yes
postconf -e smtp_cname_overrides_servername=no
postfix reload

Here I’m setting the relay host for mail.soundlinuxtraining.com to smtp.gmail.com port number 587. You may or may not need to port number if you use a different relay. Check with the relay provider for more info. Of course change username:password your gmail username and password. I batteled the Zimbra install for quite a while and gmail relaying for quite a while and the answer ended up being to just do it over and over and over until you get it right. If you have any errors during installing Zimbra then just install it again. I thought I was having a problem with relaying through gmail because when I sent mail it wasn’t ending up at the destination. I finally gave up and went to work only to find the mail in my inbox when I go there. Seems it was taking 5 minutes to send it. I’m not sure yet why this is and the logs show that Gmail is not accepting my certificate but ultimately sending the mail anyway. I’ll check into it more when I get some time.

Domain Catchall in Zimbra Mail Server

December 29th, 2010

Here i have set up an account “pawan@onaxer.com” to catch all any mail not delivered to existing users in the domain “onaxer.com”, you can configure the account as a domain catchall.

If the users “admin@onaxer.com”, “webmaster@onaxer.com”, and “nobody@onaxer.com” don’t exist, and mail arrives for them, it will be delivered to the catchall account “pawan@onaxer.com”. This will increase the amount of spam delivered, and can lead to being blacklisted.

[root@map007]# su – zimbra
[zimbra@map007]$ zmprov modifyAccount pawan@onaxer.com zimbraMailCatchAllAddress @onaxer.com

To remove the catchall from an email account, unset the catchall address:

[root@map007]# su – zimbra

[zimbra@map007]$ zmprov modifyAccount pawan@onaxer.com zimbraMailCatchallAddress “”

Adding Zimlets in Zimbra Collaboration Suite

December 3rd, 2010

Zimlets are a framework for integrating Zimbra’s web email and collaboration experience with third party data sources to create new “mash-up” user interfaces or brand new application Tabs. They save end users time by condensing common tasks, which typically force them to open multiple applications, into simple contextual ones within Zimbra.

here i will deploy the tasksreminder zimlet , which will be used for automatically sharing of tasks.

#su – zimbra
$cd /opt/zimbra/zimlets-extra
$ls
It will show all the list of zimlets avilable on the server
Now for eg. i will install com_zimbra_tasksreminder.zip.
The first thing which will be needed is to rename the file ,because it will not deploy with the default naming convention.
$cp -p com_zimbra_tasksreminder.zip tasksreminder.zip
$zmzimletctl deploy tasksreminder.zip

To check if installed
$zmzimletctl listZimlets

Zimbra migration from 5.0.8 to 6.0.8, Accounts,Zimlets,Passwords

May 29th, 2010

Zimbra Migration Document

Source Server# Zimbra colloboration Suite (ZCS) version 5.0.8 — Hostname: mail ,Domain: abc.com
Destination Server # Zimbra colloboration Suite (ZCS)version 6.0.6—-Hostname: mail ,Domain: xyz.com

In this migration i will migrate all userdata base ,password ,zimlet setting ,ldap settings

a. Dump LDAP database on the source Zimbra i.e. mail.abc.com

Go to the primary mail server and become zimbra user. Then, in the /opt/zimbra directory, run the following command:

$ ./openldap/sbin/slapcat -f /opt/zimbra/conf/slapd.conf -l /root/ldap.ldif
The first database does not allow slapcat; using the first available one (2)

After this, you’ll have a file ldap.ldif in your /home directory which contains all the information about your users.Copy this file to mail.xyz.com server before making any changes.

b. Modify domain names

You should modify domain and host names in LDIF, otherwise Zimbra won’t work.

$sed ‘s/dmz.domain.local/dr.domain.local/g’ ldap.ldif > ldap.ldif.mail

Note that it might become more complex that this because of the way Zimbra stores aliases into LDAP. For example,there is a separate tree in LDAP, dc=mail,dc=abc,dc=com which won’t be affected by the grep command and you’ll have to either write script to handle this or manually edit the ldif file.
So better if you change all entries manually.

c. Stop the target Zimbra on mail.xyz.com

$ zmcontrol stop

Just in case, check if LDAP is running. If so kill it using the kill command

d. Clean /opt/zimbra/data/ldap/hdb/db directory. DO NOT remove logs and DB_CONFIG file!

e. Import ldif database on mail.xyz.com

$ cd /opt/zimbra
$ ./openldap/sbin/slapadd -F /opt/zimbra/data/ldap/config -l /tmp/ldap.ldif.mail
The first database does not allow slapadd; using the first available one (2)

The warning you see is the only one you should see and I think you can safely ignore it.
f. Get LDAP passwords from source Zimbra(mail.abc.com) using:

$ zmlocalconfig -s ldap_amavis_password ldap_postfix_password ldap_replication_password ldap_root_password zimbra_ldap_password
ldap_amavis_password = password
ldap_postfix_password = password
ldap_replication_password = password
ldap_root_password = password
zimbra_ldap_password = password

All the passwords are same.

g. You should start Zimbra on DR mail server now because otherwise it is not possible to change password. Note that there will be errors but we ignore them:

$ zmcontrol start
Host mail.xyz.com
Starting ldap…Done.
Unable to determine enabled services from ldap.
Unable to determine enabled services. Cache is out of date or doesn’t exist.

h. Now modify all the passwords:

$ zmldappasswd
Updating local config and directory
$ zmldappasswd -l
Updating local config and directory
$ zmldappasswd -p
Updating local config and directory
$ zmldappasswd -a
Updating local config and directory
$ zmldappasswd -r
Updating local config and directory
Updating slapd.conf

i. Now stop and start Zimbra again and it should work normally. Here is how netstat -ltn output should look:

$ netstat -ltn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 192.168.1.218:389 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:10024 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:10025 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:7306 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:7307 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3310 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN
tcp 0 0 192.168.1.218:53 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN
tcp 0 0 :::7072 :::* LISTEN
tcp 0 0 :::7777 :::* LISTEN
tcp 0 0 :::993 :::* LISTEN
tcp 0 0 :::995 :::* LISTEN
tcp 0 0 :::7780 :::* LISTEN
tcp 0 0 :::5222 :::* LISTEN
tcp 0 0 :::5223 :::* LISTEN
tcp 0 0 :::7335 :::* LISTEN
tcp 0 0 :::110 :::* LISTEN
tcp 0 0 :::143 :::* LISTEN
tcp 0 0 :::80 :::* LISTEN
tcp 0 0 :::7025 :::* LISTEN
tcp 0 0 :::5269 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 0 ::1:953 :::* LISTEN
tcp 0 0 :::443 :::* LISTEN
tcp 0 0 :::7071 :::* LISTEN

Few notes to be aware of:

1. You should be aware that by copying LDAP you also copied SSH keys and possibly other configuration data which you might prefer to be different. For SSH keys use zmsshkeygen.
2. During migration process you probably removed default domain, so you have to log in to administration console using admin@xyz.com username and set default domain to either mail.xyz.com or xyz.com.

After user migration, in order for the mail routing to work properly, you should add to each user an alias of the form username@xyz.com. You can use the following simple script to do that for each user:

#!/bin/bash

USERS=`zmprov -l gaa olddomain`

# First, add new domain
zmprov cd xyz.com

# Then, for each user add new alias
for i in $USERS
do
echo “Processing user $i”
zmprov aaa $i ${i/olddomain/xyz.com}
done

In order to set up routing I suggest you first modify only several users to test the installation, and when it’s proven to work correctly then modify all the users using a simple shell script.

Thanks
Manoj