The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

incorrect ip in the auto generated /etc/mailips

Discussion in 'E-mail Discussions' started by weeming21, Feb 3, 2016.

  1. weeming21

    weeming21 Member

    Joined:
    Jun 13, 2015
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Malaysia
    cPanel Access Level:
    Root Administrator
    the problem is that, a.com ip is 1.1.1.1 and the reseller share ip has been changed to 1.1.1.2
    then the a.com ip inside the /etc/mailips become 1.1.1.2 instead of 1.1.1.1
    it cause exim use 1.1.1.2 send the a.com email

    and how to change the /etc/mailhelo use rdns instead of domain name itself?
    cbl blacklisted our ip due to the following reason:

    Note that the above list may include one or more names that are not
    fully qualified DNS names (FQDNs). Host names (ie: Windows node names)
    without a dot are not FQDNs.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,737
    Likes Received:
    661
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    There are a few recent bug fixes regarding the /etc/mailips and /etc/mailhelo files. Please let us know the version of cPanel installed on this system:

    Code:
    cat /usr/local/cpanel/version
    Thank you.
     
  3. weeming21

    weeming21 Member

    Joined:
    Jun 13, 2015
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Malaysia
    cPanel Access Level:
    Root Administrator
    11.54.0.8
     
  4. T.C.

    T.C. Member

    Joined:
    Mar 31, 2015
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Italy
    cPanel Access Level:
    Root Administrator
    I've have exactly the same problem. I got blacklisted a few days after update to 11.54.0.12.
    File /etc/mailips is wrong and all the domains are set to use one ip.
    Any fix available apart recreate /etc/mailips from scratch as I'm currently doing?
     
  5. weeming21

    weeming21 Member

    Joined:
    Jun 13, 2015
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Malaysia
    cPanel Access Level:
    Root Administrator
    these is how i fix it temp0rary
    try put the following code to the /usr/local/cpanel/scripts/postupdateuserdomains :
    #!/bin/bash
    # change [MAIN_IP] to your default server main ip
    # change [MAIN_RDNS] to your main ip rdns

    rm -f /tmp/mailips
    rm -f /tmp/mailhelo

    # While loop processes each domain from /etc/mailhelo
    while read DOMAIN
    do
    # Skip ahead if a blank line is read in
    if [ "$DOMAIN" == "" ] || [ "$DOMAIN" == "no" ]
    then
    continue
    fi

    USERNAME=`grep -G =${DOMAIN}\$ /var/cpanel/users/* -l | cut -c19-`

    IP=`cat /var/cpanel/users/$USERNAME | grep 'IP=' | cut -c4-`
    echo ${DOMAIN}: $IP >> /tmp/mailips

    RDNS="[MAIN_RDNS]"

    #RDNS Part Start
    #if more then 1 ip, then change the rdns base on ip address
    #e.g [IP2] change to 1.1.1.1 and [RDNS2] change to server1.domain.tld
    #if [ "$IP" == "1.1.1.1" ]
    # then
    # RDNS="server1.domain.tld"
    # fi
    if [ "$IP" == "[IP2]" ]
    then
    RDNS="[RDNS2]"
    fi

    if [ "$IP" == "[IP3]" ]
    then
    RDNS="[RDNS3]"
    fi
    #RDNS Part End

    echo ${DOMAIN}: ${RDNS} >> /tmp/mailhelo

    # End of while loop, command substitution used to feed it.
    done < <(awk -F":" '{print $1}' /etc/mailhelo)

    echo '*: [MAIN_IP]' >> /tmp/mailips

    mv -f /tmp/mailips /etc/
    mv -f /tmp/mailhelo /etc/
     
  6. T.C.

    T.C. Member

    Joined:
    Mar 31, 2015
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Italy
    cPanel Access Level:
    Root Administrator
    Thanks for your help. There is an error on line 24. I'm not able to spot it can you fix it?
    Thanks
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,737
    Likes Received:
    661
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Please let us know if the issue continues on cPanel version 54.0.15. It includes the following case:

    Fixed case CPANEL-3984: Turn IPv6 handling off for mailips/mailhelo.


    Thank you.
     
  8. T.C.

    T.C. Member

    Joined:
    Mar 31, 2015
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Italy
    cPanel Access Level:
    Root Administrator
    Hi Mike,
    I'm now on 54.0.17 but the issue persists. My server has only Ipv4. I've reopened the Ticket: #7461765
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,737
    Likes Received:
    661
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    To update, it looks like the existing behavior is by design. Users should vote for the following feature request if the goal is to have native support for multiple shared IP addresses:

    Multiple Shared IP Addresses

    Thank you.
     
Loading...

Share This Page