Sender Based Relay

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
info@vteamtech.in
Posts: 6
Joined: Mon Aug 01, 2016 11:32 am

Sender Based Relay

Postby info@vteamtech.in » Mon Nov 07, 2016 8:32 am

Zimbra Version : Release 8.5.0_GA_3042.RHEL6_64_20140828192005 RHEL6_64 FOSS edition.

I have a free google apps with 5 accounts. my mx pointed to google apps. so every new email in gmail. i installed the zimbra with same domain name which is in google apps in my laptop and configure the external pop3 access in zimbra. i can get the new mail. but i need to sent mail from zimbra using gmail smtp authentication with individual gmail authentication.
so i used
sender_dependent_relayhost_map

zmprov ms `zmhostname` zimbraMtaSmtpSaslAuthEnable yes
zmprov ms `zmhostname` zimbraMtaSmtpSaslPasswordMaps lmdb:/opt/zimbra/conf/relay_password
zmprov ms `zmhostname` zimbraMtaSmtpSaslSecurityOptions noanonymous
zmprov ms `zmhostname` zimbraMtaSmtpCnameOverridesServername no
zmprov ms `zmhostname` zimbraMtaSmtpTlsSecurityLevel may

in main.cf
sender_dependent_relayhost_maps = lmdb:/opt/zimbra/conf/relay_host

in relay_host
relay_host
info@vteamtech.in [smtp.gmail.com]:587
accounts@vteamtech.in [smtp.gmail.com]:587

in relay_password
info@vteamtech.in info@vteamtech.in:info_Password
accounts@vteamtech.in accounts@vteamtech.in:accounts_password

postmap /opt/zimbra/conf/relay_password
postmap /opt/zimbra/conf/relay_host

also done some changes in gmail settings
less secure app : turn on
disable captcha

then zmcontrol restart

In my /var.log/maillog file

Nov 7 13:59:31 mail postfix/smtp[8747]: DF34E262BEB: to=<purchase@axistech.in>, relay=smtp.gmail.com[74.125.130.108]:587, delay=2.3, delays=0.08/0.03/1.9/0.23, dsn=5.5.1, status=bounced (host smtp.gmail.com[74.125.130.108] said: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 https://support.google.com/mail/?p=WantAuthError l11sm31483413pfb.28 - gsmtp (in reply to MAIL FROM command))

Help Me , Thanks in Advance


User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 533
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 8.8.15_P16 RHEL6 Network Edition
Contact:

Re: Sender Based Relay

Postby JDunphy » Mon Nov 07, 2016 8:43 pm

Suggestion: You might try adding additional logging to main.cf

debug_peer_list=smtp.gmail.com
debug_peer_level=3

postfix reload

I have been meaning to give this a try so your post is a good starting point for me.
info@vteamtech.in
Posts: 6
Joined: Mon Aug 01, 2016 11:32 am

Re: Sender Based Relay

Postby info@vteamtech.in » Fri Nov 11, 2016 6:41 pm

I added the following file in main.cf file

smtp_sender_dependent_authentication = yes

Now working and thanks.
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 533
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 8.8.15_P16 RHEL6 Network Edition
Contact:

Re: Sender Based Relay

Postby JDunphy » Fri Nov 11, 2016 6:57 pm

Nice work!

I think this will be a powerful option to have in the toolbox. I had been using transport maps which were based on recipients addresses to my own mail relays for some edge cases so I am happy to know this method too.

Jim
bjones2011
Posts: 5
Joined: Sat Sep 13, 2014 2:03 am

Re: Sender Based Relay

Postby bjones2011 » Wed Nov 04, 2020 10:40 am

Can anyone verify whether this technique works with the following version:

Release 8.8.15.GA.3869.UBUNTU18.64 UBUNTU18_64 FOSS edition, Patch 8.8.15_P15.

We would like to accomplish the same.
bjones2011
Posts: 5
Joined: Sat Sep 13, 2014 2:03 am

Re: Sender Based Relay

Postby bjones2011 » Thu Nov 05, 2020 9:01 pm

In case anyone runs into this question/problem, we were able to get the external relay working on the version mentioned in my previously post by doing the following:

sudo nano /opt/zimbra/conf/relayhost_map_MULTI

Add an entry for each user needing to use the relay, as follows:
user1@domain.com [smtp.gmail.com]:587
user2@domain.com [smtp.gmail.com]:587

sudo nano /opt/zimbra/conf/relay_password_MULTI

Add password entries for each user as follows:
user1@domain.com user1@domain.com:password1
user2@domain.com user2@domain.com:password2

Then run the following:

sudo su - zimbra

postconf -e smtp_sender_dependent_authentication=yes
postconf -e sender_dependent_relayhost_maps=lmdb:/opt/zimbra/conf/relayhost_map_MULTI
zmprov ms domain.com zimbraMtaSmtpSaslAuthEnable yes
zmprov ms domain.com zimbraMtaSmtpSaslPasswordMaps lmdb:/opt/zimbra/conf/relay_password_MULTI
postmap /opt/zimbra/conf/relayhost_map_MULTI
postmap /opt/zimbra/conf/relay_password_MULTI

postfix reload

zmprov ms domain.com zimbraMtaSmtpTlsSecurityLevel may
zmprov ms domain.com zimbraMtaSmtpSaslSecurityOptions noanonymous
zmprov ms domain.com zimbraMtaSmtpCnameOverridesServername no

postfix reload

Return to “Administrators”

Who is online

Users browsing this forum: Google [Bot] and 15 guests