Results 1 to 5 of 5

Thread: [SOLVED] Force Zimbra to send mail using another interface

  1. #1
    DougWare is offline Loyal Member
    Join Date
    Dec 2007
    Location
    Raleigh, NC
    Posts
    91
    Rep Power
    7

    Default [SOLVED] Force Zimbra to send mail using another interface

    I need to force Zimbra to make outgoing SMTP connection on a certain interface/ip address because it's not the primary interface. We are using a VIP with heartbeat, and until we can get this straight, we have a DNS/reverse DNS name mismatch.

    How can I force Zimbra to using bond0:0 or 216.27.19.204 (the VIP interface and IP) when it makes outgoing SMTP connections.

    Thanks

  2. #2
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,016
    Rep Power
    24

    Default

    So do you have multiple NICs ? For the specific IPs you need to connect too have you tried setting a preferred route ?

  3. #3
    DougWare is offline Loyal Member
    Join Date
    Dec 2007
    Location
    Raleigh, NC
    Posts
    91
    Rep Power
    7

    Default

    No, same NICs.

    However, it dawned on me a few minutes after writing this that I could accomplish this using source-nat and IP tables.

    Here is the rule I'm using:
    iptables -t nat -D POSTROUTING -p tcp --dport 25 -j SNAT --to-source 216.27.19.204
    Here is a cron script I wrote that runs every minute, it's pretty self explanatory. I don't know why I didn't think of doing it this way before. Since we use heartbeat, and /opt is only mounted on the "active" server, I check to see if /opt is mounted and then check the rule status.

    Code:
    volume="/opt"
    rule="to:216.27.19.204"
    
    if mount | grep "on ${volume} type" > /dev/null
    then
            if iptables -L -v -t nat | grep -v grep | grep "${rule}" > /dev/null
            then
                    echo "IPTables rule already exists!"
            else
                    echo "IPTables rule doesn't exist, we need to add it!"
                    iptables -t nat -A POSTROUTING -p tcp --dport 25 -j SNAT --to-source 216.27.19.204
            fi
    else
            echo "Zimbra isn't running here"
            if iptables -L -v -t nat | grep -v grep | grep "${rule}" > /dev/null
            then
                    echo "IPTables rule exists, we need to remove it!"
                    iptables -t nat -D POSTROUTING -p tcp --dport 25 -j SNAT --to-source 216.27.19.204
            else
                    echo "IPTables rule doesn't exist, we don't do anything!"
            fi
    fi
    Does anyone know of a reason not to do it this way?
    Visit my webste online: http://www.dougware.net

  4. #4
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,016
    Rep Power
    24

    Default

    Would it be better with /opt/zimbra ? or do you have other software on your ZCS installation ?

  5. #5
    DougWare is offline Loyal Member
    Join Date
    Dec 2007
    Location
    Raleigh, NC
    Posts
    91
    Rep Power
    7

    Default

    Zimbra is in the /opt/zimbra directory, but that's on the /opt mount for us. It was configured this way so that other applications (backup software, etc) would only run on the active system. Thus, when we check for the active server, we check the /opt mount.
    Visit my webste online: http://www.dougware.net

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 7
    Last Post: 02-03-2011, 07:01 AM
  2. [SOLVED] Mailserver down when send file attach of 50Mb
    By ZMilton in forum Administrators
    Replies: 20
    Last Post: 04-10-2008, 11:44 AM
  3. [SOLVED] Upgraded to 5.0 OSS - Sendmail Problem
    By Chewie71 in forum Installation
    Replies: 11
    Last Post: 12-28-2007, 07:07 PM
  4. huge log size
    By rmvg in forum Administrators
    Replies: 5
    Last Post: 01-02-2007, 10:39 AM
  5. fatal: Queue report unavailable - mail system is down
    By zzzzsg in forum Administrators
    Replies: 16
    Last Post: 08-24-2006, 02:31 AM

Posting Permissions

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