Hi all
As part of migration procedure from Exchange to Zimbra, we set up Zimbra test server for domain i.e. company.com
Real Exchange mail server for domain company.com is on other address, MX record is not yet transferred.
I would like to deliver mails sent from test Zimbra locally, in other words, when I send mail from Zimbra test server to domain company.com I want it delivered to test Zimbra server, not public Exchange.
Logical step would be to change lmtp_host_lookup = native in Postfix main.cf, but I can't find main.cf in config directory.
If I change that parameter in /opt/zimbra/common/conf/main.cf it is owerwritten when Zimbra restarts.
So, my question is: how can I force Zimbra messages for it's domain to be delivered locally?
Second question: where are Postifx config files in Zimbra?
Thanks, regards
Ivica
[SOLVED] Zimbra test server - keep messages locally
-
- Posts: 9
- Joined: Tue Oct 09, 2018 3:06 pm
- DualBoot
- Elite member
- Posts: 1326
- Joined: Mon Apr 18, 2016 8:18 pm
- Location: France - Earth
- ZCS/ZD Version: ZCS FLOSS - 8.8.15 Mutli servers
- Contact:
Re: Zimbra test server - keep messages locally
Hello,
I do not understand, because it is the normal behavior for Zimbra to deliver locally when the domain exists on Zimbra server.
Regards,
I do not understand, because it is the normal behavior for Zimbra to deliver locally when the domain exists on Zimbra server.
Regards,
- L. Mark Stone
- Ambassador
- Posts: 2802
- Joined: Wed Oct 09, 2013 11:35 am
- Location: Portland, Maine, US
- ZCS/ZD Version: 10.0.7 Network Edition
- Contact:
Re: Zimbra test server - keep messages locally
When an email domain is provisioned in Zimbra, Zimbra ignores DNS for delivery and delivers all mail for the domain locally.
So you should have no problem doing this test without having to make any changes to Zimbra.
As you plan your migration, you may want to take a look at the Split Domain wiki article (https://wiki.zimbra.com/wiki/Split_Domain), and see how you can leverage the zimbraMailTransport attribute for each mailbox to control where email is delivered.
Hope that helps,
Mark
So you should have no problem doing this test without having to make any changes to Zimbra.
As you plan your migration, you may want to take a look at the Split Domain wiki article (https://wiki.zimbra.com/wiki/Split_Domain), and see how you can leverage the zimbraMailTransport attribute for each mailbox to control where email is delivered.
Hope that helps,
Mark
___________________________________
L. Mark Stone
Mission Critical Email - Zimbra VAR/BSP/Training Partner https://www.missioncriticalemail.com/
AWS Certified Solutions Architect-Associate
L. Mark Stone
Mission Critical Email - Zimbra VAR/BSP/Training Partner https://www.missioncriticalemail.com/
AWS Certified Solutions Architect-Associate
-
- Posts: 9
- Joined: Tue Oct 09, 2018 3:06 pm
Re: Zimbra test server - keep messages locally
Thanks for the answers, but in my case, Zimbra sends messages to server that has MX record pointing on it, does not deliver them locally for domain company.com. In Zimbra, service host name is mail.company.com
On system level, everything should be set up correctly - hosts file shows local server address for mail.company.com, nsswitch.conf: hosts: files dns myhostname, host.conf: order hosts,bind, ping gets reply from local IP address.
Split domain may be an option when migration starts, but for now, I would like all mails to be delivered locally.
Is it possible?
On system level, everything should be set up correctly - hosts file shows local server address for mail.company.com, nsswitch.conf: hosts: files dns myhostname, host.conf: order hosts,bind, ping gets reply from local IP address.
Split domain may be an option when migration starts, but for now, I would like all mails to be delivered locally.
Is it possible?
- L. Mark Stone
- Ambassador
- Posts: 2802
- Joined: Wed Oct 09, 2013 11:35 am
- Location: Portland, Maine, US
- ZCS/ZD Version: 10.0.7 Network Edition
- Contact:
Re: Zimbra test server - keep messages locally
Sure. That's the deafult configuration.ivica.glavocic wrote:Thanks for the answers, but in my case, Zimbra sends messages to server that has MX record pointing on it, does not deliver them locally for domain company.com. In Zimbra, service host name is mail.company.com
On system level, everything should be set up correctly - hosts file shows local server address for mail.company.com, nsswitch.conf: hosts: files dns myhostname, host.conf: order hosts,bind, ping gets reply from local IP address.
Split domain may be an option when migration starts, but for now, I would like all mails to be delivered locally.
Is it possible?
So, let's say your new server is mail.company.com, and mailboxes are user1@company.com, user2@company.com etc.
If you do on the new server "zmprov ga user!@company.com! zimbraMailTransport" you'll get "lmtp:mail.company.com:7025". That means the new server's Postfix is using local mail transport protocol to deliver user1's email to the Zimbra mailbox server mail.company.com, using port 7025.
From a commandline on the new server, if you run "host mail.company.com", you should get the IP address of the new server (this should match the second line of /etc/hosts as well).
Given the above, if user1 on the new server sends an email to user2, that email will be delivered to user2's mailbox on the new server.
Easier to say definitively if you posted your actual /etc/hosts, /etc/resolv.conf, /etc/hostname, and ifconfig from the new server.
Hope that helps,
Mark
___________________________________
L. Mark Stone
Mission Critical Email - Zimbra VAR/BSP/Training Partner https://www.missioncriticalemail.com/
AWS Certified Solutions Architect-Associate
L. Mark Stone
Mission Critical Email - Zimbra VAR/BSP/Training Partner https://www.missioncriticalemail.com/
AWS Certified Solutions Architect-Associate
-
- Posts: 9
- Joined: Tue Oct 09, 2018 3:06 pm
Re: Zimbra test server - keep messages locally
My point exactly. One important sidenote - on Linux host command always resolves name using DNS query, it does not rely on local /etc/hostname resolve order, behaviour by design, so it returns IP address of Exchange live server that MX record points to. Like I wrote before - ping reads /etc/hostname and returns local IP, host looks up DNS record returns Exchange IP. Postfix has to be told how to work - by default it checks DNS record, that's why mail goes out on Exchange server. That is the reason why I wanted to reconfigure Zimbra Postfix to force local resolving first, but I have trouble finding information how to do it, since main.cf does not exist on server filesystem.L. Mark Stone wrote: Sure. That's the deafult configuration.
So, let's say your new server is mail.company.com, and mailboxes are user1@company.com, user2@company.com etc.
If you do on the new server "zmprov ga user!@company.com!!!!!!!!!!!!!!!!!!!! zimbraMailTransport" you'll get "lmtp:mail.company.com:7025". That means the new server's Postfix is using local mail transport protocol to deliver user1's email to the Zimbra mailbox server mail.company.com, using port 7025.
From a commandline on the new server, if you run "host mail.company.com", you should get the IP address of the new server (this should match the second line of /etc/hosts as well).
Given the above, if user1 on the new server sends an email to user2, that email will be delivered to user2's mailbox on the new server.
Easier to say definitively if you posted your actual /etc/hosts, /etc/resolv.conf, /etc/hostname, and ifconfig from the new server.
Hope that helps,
Mark
To cut long story short - I solved problem by changing Postfix parameter lmtp_host_lookup to native
su - zimbra
postconf lmtp_host_lookup ---> lmtp_host_lookup = dns
postconf -e lmtp_host_lookup=native
postconf lmtp_host_lookup ---> lmtp_host_lookup = native
Make change permanent:
su - zimbra
zmprov ms `zmhostname` zimbraMtaLmtpHostLookup native
zmcontrol restart
Mails are now delivered locally.
Thank you all for help. With regards
Ivica
- L. Mark Stone
- Ambassador
- Posts: 2802
- Joined: Wed Oct 09, 2013 11:35 am
- Location: Portland, Maine, US
- ZCS/ZD Version: 10.0.7 Network Edition
- Contact:
Re: Zimbra test server - keep messages locally
Glad you got it sorted.
FWIW, I typically recommend deploying dnscache on Zimbra servers for exactly this reason. It enables one to do proof-of-concept testing and then move to production with no changes whatsoever.
I have a blog post about this; in your case you could have used your AD servers with DNS roles as the upstream nameservers.
https://www.missioncriticalemail.com/20 ... ion-guide/
All the best,
Mark
FWIW, I typically recommend deploying dnscache on Zimbra servers for exactly this reason. It enables one to do proof-of-concept testing and then move to production with no changes whatsoever.
I have a blog post about this; in your case you could have used your AD servers with DNS roles as the upstream nameservers.
https://www.missioncriticalemail.com/20 ... ion-guide/
All the best,
Mark
___________________________________
L. Mark Stone
Mission Critical Email - Zimbra VAR/BSP/Training Partner https://www.missioncriticalemail.com/
AWS Certified Solutions Architect-Associate
L. Mark Stone
Mission Critical Email - Zimbra VAR/BSP/Training Partner https://www.missioncriticalemail.com/
AWS Certified Solutions Architect-Associate