Sending emails through another ip address [SOLVED]

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
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: 27279
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: 27279
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
loocek
Advanced member
Advanced member
Posts: 64
Joined: Sat Sep 13, 2014 1:14 am
Contact:

Re: Sending emails through another ip address [SOLVED]

Post by loocek »

I've done as is written here and it doesn't work :(

1. Additional IP is added on interface
2. On the end of /opt/zimbra/common/conf/master.cf.in I've added:
martel12 unix - - n - - smtp
-o smtp_bind_address=89.174.13.12
-o smtp_helo_name=lk.net.pl
-o syslog_name=postfix/martel12
3.
zimbra@mail:~$ zmprov gs `zmhostname` | grep zimbraMtaTransportMaps
zimbraMtaTransportMaps: pcre:/opt/zimbra/common/conf/alternative_tranports.pcre proxy:ldap:/opt/zimbra/conf/ldap-transport.cf
zimbra@mail:~$

4.
zimbra@mail:~$ cat /opt/zimbra/common/conf/alternative_tranports.pcre
/\@lk\.net\.pl$/ martel12:
zimbra@mail:~$

5. zmcontrol restart

And still email goes from default IP.
This is Zimbra 8.8.15 FOSS.
What can be wrong here ?
Thank you for answer in advance.
Good hosting:
https://sdata.net.pl
loocek
Advanced member
Advanced member
Posts: 64
Joined: Sat Sep 13, 2014 1:14 am
Contact:

Re: Sending emails through another ip address [SOLVED]

Post by loocek »

I noticed that orig packages on Ubuntu have separate package "postfix-pcre" while I have installed just "zimbra-postfix" and "zimbra-postfix-logwatch" packages so maybe they don't support PCRE ?
Good hosting:
https://sdata.net.pl
loocek
Advanced member
Advanced member
Posts: 64
Joined: Sat Sep 13, 2014 1:14 am
Contact:

Re: Sending emails through another ip address [SOLVED]

Post by loocek »

Does anybody know any other way to send emails from some domain from other IP address ? In fact I think this is quite important feature for mail server and I'm suprised there isn't any official option for this in GUI or similar - because it should be.
Good hosting:
https://sdata.net.pl
Post Reply