Sending emails through another ip address [SOLVED]

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
robertvon
Posts: 21
Joined: Wed Sep 21, 2016 1:23 pm
ZCS/ZD Version: ZCS 8.8.15-P42 FOSS

Sending emails through another ip address [SOLVED]

Post by robertvon »

Hi all,
sorry if this question has already been answered.
I tried searching but couldn't find answers.

Is there a method to send emails through a different ip address, perhaps specifying which domains should go through that address?
I tried following these instructions for postfix:
https://docs.iredmail.org/send.out.emai ... esses.html
but they don't work with Zimbra.
Thanks to whoever points me in the right direction
Last edited by robertvon on Wed Jul 05, 2023 2:06 pm, edited 2 times in total.
phoenix
Ambassador
Ambassador
Posts: 27278
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Re: Sending emails through another ip address

Post by phoenix »

What's the reason for wanting to do this, what problem are you trying to solve?
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
robertvon
Posts: 21
Joined: Wed Sep 21, 2016 1:23 pm
ZCS/ZD Version: ZCS 8.8.15-P42 FOSS

Re: Sending emails through another ip address

Post by robertvon »

Hi, thx for your answer.
The ip address of the server is in the Microsoft blacklist, so I added a second network card assigning
a second ip and I would like mail directed to Microsoft domains (outlook.com, live.com etc.) to be sent through the second ip
phoenix
Ambassador
Ambassador
Posts: 27278
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Re: Sending emails through another ip address

Post by phoenix »

The question you should ask is: why is my IP on a Microsoft blacklist? When you've done that you can try and resolve the problem.

Do you have a fixed IP address for your internet connection? Do you mean that your second NIC will have a public IP address? Do you have valid (and correct) public DNS records plus a reverse DNS for your mail server?
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
robertvon
Posts: 21
Joined: Wed Sep 21, 2016 1:23 pm
ZCS/ZD Version: ZCS 8.8.15-P42 FOSS

Re: Sending emails through another ip address

Post by robertvon »

Thank you Phoenix for your interest.
The answer is yes to all.
The main IP of the server is on a Microsoft Blacklist because an account was compromised and sent spam. (and yes, I've subscribed
Microsoft SNDS service to monitor my IP addresses)
habibza
Posts: 3
Joined: Thu Jul 28, 2022 8:04 am
Location: Indonesia
Contact:

Re: Sending emails through another ip address

Post by habibza »

Dear,

You can do zimbra smtp relay to the relay service provider. Like sendinblue.
robertvon
Posts: 21
Joined: Wed Sep 21, 2016 1:23 pm
ZCS/ZD Version: ZCS 8.8.15-P42 FOSS

Re: Sending emails through another ip address [SOLVED]

Post by robertvon »

[ SOLVED - 05/07/2023]
For anyone interested I solved the problem in this way on Zimbra 8.8.x
1) add a second nic to your system or add an ip address on your existing nic
2) modify /opt/zimbra/common/conf/master.cf.in adding an alternative smtp service like this:
alt-smtp unix - - n - - smtp
-o smtp_bind_address=YOURALTERNATIVEIPADDRESS
-o syslog_name=postfix/alt-smtp
3) Create the following file /opt/zimbra/common/conf/alternative_tranports.pcre and enter the domains or full addresses for which you want the alternative ip address to be used, for example:
/@example\.com$/ alt-smtp:
4) as zimbra user execute zmprov ms `zmhostname` zimbraMtaTransportMaps "pcre:/opt/zimbra/common/conf/alternative_tranports.pcre proxy:ldap:/opt/zimbra/conf/ldap-transport.cf"
5) as zimbra user execute zmcontrol restart
Post Reply