[SOLVED]Use remote SMTP-transport despite virtual user(s) exists

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Twissell
Posts: 2
Joined: Sat Jul 17, 2021 5:55 am

[SOLVED]Use remote SMTP-transport despite virtual user(s) exists

Postby Twissell » Sat Jul 17, 2021 9:54 am

Hello!

Currently we are migrating from GSuite to on-premise solution on Hetzner GmBH.
Configuration conditons are written below:

1) Old mailserver on GSuite, domain mydomain.tld served by that MXs (gsuite)
2) New mailserver on Hetzner (KVM machine) with 2 domains on it
a) example.com
b) mydomain.tld (migration in progress using imapsync)

The problem:
I must tell Zimbra's postfix to use external SMTP transport while sending mail from example.com to mydomain.tld .
I've found the solution for this case
****************************************************
But, nevertheless if a user already exists on new server, mail delivers locally instead of using SMTP-transport described in postfix configuration :-(
How to overcome this, is it ever possible to implement?
Last edited by Twissell on Sat Jul 24, 2021 10:40 am, edited 1 time in total.


User avatar
L. Mark Stone
Elite member
Elite member
Posts: 2249
Joined: Wed Oct 09, 2013 11:35 am
Location: Portland, Maine, US
ZCS/ZD Version: 8.8.15 Network Edition
Contact:

Re: Use remote SMTP-transport despite virtual user(s) exists

Postby L. Mark Stone » Tue Jul 20, 2021 12:11 pm

Better in my experience to deal with this at the account level.

For each account in Zimbra that is yet to be migrated, just do:

Code: Select all

zmprov ma user@mydomain.tld zimbraMailTransport smtp:smtp.gmail.com:25


Zimbra's Postfix looks at this attribute to figure out where to deliver email for this account, normally via LMTP on port 7025 to the fqdn of the Zimbra mailbox server where the account resides. So making the above change tells Zimbra to deliver the email to Gmail using the SMTP protocol on Port 25.

As users are migrated to Zimbra, just change zimbraMailTransport back to the default:

Code: Select all

zmprov ma user@mydomain.tld zimbraMailTransport lmtp:<fqdn of zimbra mailbox server where mailbox resides>:7025


Easy to bulk provision these changes too. Just create a file like "mailboxes_on_gmail.zmp" containing lines like so:

Code: Select all

ma user1@mydomain.tld zimbraMailTransport smtp:smtp.gmail.com:25
ma user2@mydomain.tld zimbraMailTransport smtp:smtp.gmail.com:25
ma user3@mydomain.tld zimbraMailTransport smtp:smtp.gmail.com:25
ma user4@mydomain.tld zimbraMailTransport smtp:smtp.gmail.com:25
ma user5@mydomain.tld zimbraMailTransport smtp:smtp.gmail.com:25
ma user6@mydomain.tld zimbraMailTransport smtp:smtp.gmail.com:25
ma user7@mydomain.tld zimbraMailTransport smtp:smtp.gmail.com:25
ma user8@mydomain.tld zimbraMailTransport smtp:smtp.gmail.com:25


You can then do:

Code: Select all

zmprov -f /tmp/mailboxes_on_gmail.zmp


Straightforward to make the change to direct Zimbra's Postfix to deliver email to a Zimbra mailbox server, instead of to Gmail.

Hope that helps,
Mark
___________________________________
L. Mark Stone
Mission Critical Email - Zimbra VAR/BSP/Training Partner https://www.missioncriticalemail.com/
Zeta Alliance http://www.zetalliance.org/
Twissell
Posts: 2
Joined: Sat Jul 17, 2021 5:55 am

Re: Use remote SMTP-transport despite virtual user(s) exists

Postby Twissell » Wed Jul 21, 2021 7:44 pm

Thanks for meaningful reply, I hope it helps me in the future.
I've migration almost finished for now, but anyway I'm greatly appreciate your help on topic.

Return to “Administrators”

Who is online

Users browsing this forum: No registered users and 23 guests