Skip to main content

Changing mail IP for an individual account

Comments

12 comments

  • quietFinn
    The question is - shouldn't the changed domain (thisonedomain.com) appear under mail usage for the New IP address??

    No. You must change that account's IP address, in WHM -> Account Functions -> Change Site's IP Address. But after the changes you have made mails sent fromthisonedomain.com are sent from IP NEWIP.
    0
  • OLM
    But after the changes you have made mails sent fromthisonedomain.com are sent from IP NEWIP.

    Thanks for the reply - the thing is though I have now checked email coming from fromthisonedomain.com and they are still coming from old IP with the old Helo reference. It looks to me like Exim is not checking the mailips & mailhelo files as I have selected in Exim configuration.
    0
  • OLM
    Haven't been able to resolve this as yet and the advice from my hosts seems to be to raise a support ticket with cPanel so will go ahead with that.
    0
  • quietFinn
    Haven't been able to resolve this as yet and the advice from my hosts seems to be to raise a support ticket with cPanel so will go ahead with that.

    I was testing this in one of our servers, and it worked as expected. Maybe it's something in your server or cPanel so it's good idea to open a ticket.
    0
  • texo
    In your WHM, got to EXIM CONFIGURATION EDITOR and ensure that "Send mail from the account"s IP address" is enabled.
    0
  • quietFinn
    In your WHM, got to EXIM CONFIGURATION EDITOR and ensure that "Send mail from the account"s IP address" is enabled.

    That is not necessarily a good idea. If you do that you must make sure that every account that has own IP has the IP's rDNS configured correctly.
    0
  • texo
    Correct - but you should have rDNS setup for all IPs your server is using anyway.
    0
  • cPanelLauren
    Hello, It looks like you started off on the right path:
    So I have added the IP via WHM Add IP address and can now see it listed.

    This is the correct process
    Then I have gone into the Exim configuration manager/Domains & IPs and set the following to ON: Reference /etc/mailhelo for outgoing SMTP HELO Reference /etc/mailips for outgoing SMTP connections

    Also correct
    Then in /etc/mailips I have edited it by adding this below: thisonedomain.com: NEWIP *: MAINIP

    Looking good this is also where I would have stopped
    Then in /etc/mailhelo I have edited it by adding this below: thisonedomain.com: thisonedomain.com *: vps.maindomain.com

    For this modification, you should really have the PTR record for the IP address thisonedomain.com is using set to resolve back to thisonedomain not the hostname - I don't know what you have it set to now, but it's really not necessary to set this if you have a valid PTR record for both IP addresses.
    Then I have restarted exim using: /etc/init.d/exim restart

    This is fine though not necessary after making the change to /etc/mailips
    Now when I go into IP Functions > Show IP Address Usage It shows the Main IP with all the domains under mail usage It shows the New IP with no domains under mail usage The question is - shouldn't the changed domain (thisonedomain.com) appear under mail usage for the New IP address??

    Right, this is the expected behavior, this will only show the domain as being assigned to that IP address if you assign it as a dedicated IP address. For mailips it will not be referenced here. Once you finish the modification portion up to /etc/mailips modification and send a test email, can you confirm that the headers still reference the shared IP rather than the IP you set for thisonedomain.com?
    0
  • OLM
    Many thanks for the reply - appreciated! I can confirm that when an email is sent from thisonedomain.com it is still showing the shared IP address and not the new one. I wasn't initially sure about the changes to mailhelo and have tried with and without any changes but the result is the same.
    0
  • cPanelLauren
    Hi @OLM Thanks for getting back to me. Can you tell me what the output of the following is? grep custom_mail /etc/exim.conf.localopts
    stat /etc/mailips
    0
  • OLM
    Hi Lauren - thanks for your help answers below:
    grep custom_mail /etc/exim.conf.localopts
    custom_mailhelo=1 custom_mailips=1 stat /etc/mailips
    File: `/etc/mailips' Size: 56 Blocks: 8 IO Block: 4096 regular file Device: ca01h/51713d Inode: 3360197 Links: 1 Access: (0640/-rw-r-----) Uid: ( 0/ root) Gid: ( 12/ mail) Access: 2020-02-15 22:15:05.000000000 +0000 Modify: 2020-02-15 22:22:41.000000000 +0000 Change: 2020-02-15 22:22:41.000000000 +0000

    Cheers Steve
    0
  • quietFinn
    @OLM You could test if you can connect to a mail server using that IP NEWIP: telnet -b NEWIP gmail-smtp-in.l.google.com 25
    0

Please sign in to leave a comment.