Results 1 to 9 of 9

Thread: How to set different outgoing IP to each domain.

  1. #1
    0gg1 is offline New Member
    Join Date
    Aug 2012
    Posts
    5
    Rep Power
    3

    Default How to set different outgoing IP to each domain.

    Hi. I have domain1.com, domain2.com, domain3.com ..... domain30.com
    I want to set IP address 1.1.1.1 as outgoing for domain1.com and IP address 2.2.2.2 as outgoing for domain2.com ..... domain30.com.
    How to do that ?
    Last edited by 0gg1; 08-22-2012 at 07:03 AM.

  2. #2
    ypong is offline Senior Member
    Join Date
    Jan 2009
    Posts
    66
    Rep Power
    6

    Default

    To succintly answer your question, you need multiple IPs on your server (I'm running linux servers, so it's an easy task to create some aliases and restart the networking stack), then assuming domain2.com is already created in the zimbra admin interface, provision the IP using the command
    Code:
    zmprov md domain2.com zimbraVirtualIPAddress "2.2.2.2"
    Note that this is assuming you have installed and are using the proxy subsystem. Without the proxy subsystem, you'd have to probably also manually edit the master.cf.in file in .../zimbra/postfix/conf
    Release 7.2.0_GA_2669.UBUNTU10_64 UBUNTU10_64 FOSS edition

  3. #3
    0gg1 is offline New Member
    Join Date
    Aug 2012
    Posts
    5
    Rep Power
    3

    Default

    I have installed CentOS 6.0 and I used:
    Code:
    zmprov md domain1.com +zimbraVirtualHostName domain1.com +zimbraVirtualIPAddress 1.1.1.1
    zmprov md domain2.com +zimbraVirtualHostName domain2.com +zimbraVirtualIPAddress 2.2.2.2
    zmprov md domain3.com +zimbraVirtualHostName domain3.com +zimbraVirtualIPAddress 2.2.2.2
    but when I send e-mail from domain1, domain2 or domain3 to account on an other server and view log file an other server I see that received e-mail is coming from one IP: 1.1.1.1

  4. #4
    ypong is offline Senior Member
    Join Date
    Jan 2009
    Posts
    66
    Rep Power
    6

    Default

    did you restart the proxy server after doing the changes?
    Code:
    zmproxyctl restart
    Release 7.2.0_GA_2669.UBUNTU10_64 UBUNTU10_64 FOSS edition

  5. #5
    0gg1 is offline New Member
    Join Date
    Aug 2012
    Posts
    5
    Rep Power
    3

    Default

    No, but I do "zmcontrol restart".

  6. #6
    speno is offline Senior Member
    Join Date
    Apr 2010
    Posts
    57
    Rep Power
    5

    Default

    I'm skeptical of this answer but it is likely because I'm ignorant.

    1) the zimbraVirtualIPAddress: I thought this mapped users into a domain based on which IP they connected to and didn't have anything to do with outgoing connections from Zimbra.

    2) the Zimbra proxy system is separate from the MTA. The proxy handles incoming pop, imap and http connections, but doesn't have anything to do with smtp.

  7. #7
    0gg1 is offline New Member
    Join Date
    Aug 2012
    Posts
    5
    Rep Power
    3

    Default

    I solved issue, used postfix (master.cf & main.cf).
    1) Backup master.cf.in and main.cf files in /opt/zimbra/postfix/conf/
    2) Create new file named sdd_transport_maps.regexp and use regular expression for sites that you want to route.
    In my case, file include this:
    /@domain1\.com$/ domain1_com:
    /@domain2\.com$/ domain2_com:


    Edit: domain1_com and domain2_com are just name, you can rename that how do you want.

    3) At the last line on file master.cf.in add this:
    domain1_com unix - - n - - smtp
    -o smtp_bind_address=1.1.1.1
    -o smtp_helo_name=domain1.com
    -o syslog_name=postfix-domain1_com
    domain2_com unix - - n - - smtp
    -o smtp_bind_address=2.2.2.2
    -o smtp_helo_name=domain2.com
    -o syslog_name=postfix-domain2_com


    4) At the last line on file main.cf add this:
    sender_dependent_default_transport_maps = regexp:/opt/zimbra/postfix/conf/sdd_transport_maps.regexp


    I hope this issue will be help on other people.
    Release 7.2.0_GA_2669.RHEL6_64_20120410002025 CentOS6_64 FOSS edition.

  8. #8
    ypong is offline Senior Member
    Join Date
    Jan 2009
    Posts
    66
    Rep Power
    6

    Default

    oops, my bad, speno is right, you will have to bind (as you've found out), manually edit the master.cf.in file. I have a firewall cluster in front of my mailservers so I do my mapping from there, my apologies for misleading you.
    Release 7.2.0_GA_2669.UBUNTU10_64 UBUNTU10_64 FOSS edition

  9. #9
    brijendrasial is offline New Member
    Join Date
    Feb 2014
    Posts
    4
    Rep Power
    1

    Default

    @0gg1 i tried what you wrote and everything went perfect but when i send email i get error. I created transport emarketing_in.


    Feb 16 02:02:53 mail postfix/qmgr[23809]: warning: connect to transport private/emarketing_in: No such file or directory

    Feb 16 02:02:53 mail postfix/error[1956]: 358B89B67B: to=<****@yahoo.com>, relay=none, delay=2839, delays=2839/0.02/0/0.06, dsn=4.3.0, status=deferred (mail transport unavailable)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to Require TLS incoming/outgoing for one domain
    By liverpoolfcfan in forum Administrators
    Replies: 6
    Last Post: 10-12-2012, 09:41 AM
  2. Incorrect domain name appended to outgoing mails
    By dhyanesh in forum Installation
    Replies: 5
    Last Post: 12-12-2009, 06:10 PM
  3. Change Outgoing Domain
    By link915 in forum Administrators
    Replies: 1
    Last Post: 09-11-2007, 09:03 AM
  4. Split outgoing message into one per domain
    By cshepherd in forum Administrators
    Replies: 0
    Last Post: 04-15-2007, 10:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •