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.

Migrating Account - How to Reject email on old server

Discussion in 'E-mail Discussions' started by southernson, Apr 28, 2014.

  1. southernson

    southernson Member

    Joined:
    Jul 10, 2013
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Hi,

    I don't have root access to the server. I have WHM and cPanel access, and I'm wanting to migrate an account from one hosting provider to another.

    I'm planning on using the backup feature, and having the new hosting provider restore the backup on the new account.

    The problem I have is with delayed DNS where email may be delivered to the old server. My client does not want email to go 'missing'. They are happy for any email that finds it's way to the old server to bounce back as rejected so the sender knows that it didn't go through - but they are not happy for it to end up on the old server after the backup has been done as the recipient may never receive the message.

    Since one of my clients I'm looking at having has over 100 email addresses I need something that can be done general.

    What I was hoping to do is something like the following:

    1) Disable Email on the current cPanel so all emails bounce back.

    2) Perform a backup

    3) Have backup restored on new hosting provider

    4) Redirect DNS entries to point to the new hosting provider

    5) On the new hosting provider, enable email in cPanel so it accepts email on new server.

    I figure that this way, any slow emails, or emails sent between the backup and the restore will bounce back to their senders so nothing will be assumed as delivered that hasn't been. The problem is - I don't know if this is possible to achieve? The order I've chosen above is specific to make sure there's no chance of even 1 email being received and not migrated to the other server. (which is why email is disabled before the backup).

    I tried going into WHM and setting 'Maximum emails relayed per hour' to 1, but I could still send emails to email accounts hosted on that server.

    I've tried going into cPanel-Mail-MX and setting email to "Remote Mail Exchanger", but todate no email has bounced back yet. (Although the email wasn't delivered either - so I don't know if it's going around in circles, or whether it's just gone missing).

    Keeping in mind that I only have cPanel and WHM access (not root access to the server as it's on shared hosting) - is it possible for me to achieve this, or is there another alternative?

    - - - Updated - - -

    Oh - OK..... now the emails decide to bounce back after I've posted a question on a forum. Should have know. :cool:

    Looks like setting email Mx to Remote Mail Exchanger is the way to go.

    Error I get is:

    5.1.2 - Bad destination host 'Multiple DNS queries were attempted and failed: DNS Hard Error looking up mx.mydomain.com (A): NXDomain'

    That's good enough for me. If anyone has any better advise, I'm all ears, otherwise I'll go with this.

    Cheers
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    The method you used to reject email should be suitable for what you are attempting to accomplish. You could also create an account level filter in cPanel that uses a "Fail with Message" action. This would allow you to bounce the emails with a specific message (e.g. Domain is moving, please resend later).

    Thank you.
     
  3. southernson

    southernson Member

    Joined:
    Jul 10, 2013
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Thanks for the reply - that could work too!
     
  4. southernson

    southernson Member

    Joined:
    Jul 10, 2013
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    I'm just trying to think outside the box. I was wondering if it might be possible to set up the original server as a 'backup' mail server. Would that hold email until the new server was online and functioning correctly and the DNS updates?
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  6. southernson

    southernson Member

    Joined:
    Jul 10, 2013
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Hi Michael,

    Thanks for that. Unfortunately I am a WHM customer (I don't have root level access to the server).

    I was wondering if it's possible to do this another way?

    ie - could I just do a FTP transfer of all the files in /mail/new directory and dump them on the new server. Would this potentially work? (I realise there's a risk of double-up so users may get 2 copies of the same email, but that wouldn't be too bad really - it's missing emails that I'm more worried about).

    If this works, I might consider writing some sort of application or script that could do this in bulk for multiple cPanel sites.

    Thanks & Regards

    Adam.
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Yes, that solution should work, however you may need to contact your web hosting provider on the destination server and have them repair the ownership/permissions on the maildir files that you copy via FTP using a command such as:

    Code:
    /scripts/mailperm $username
    Thank you.
     
  8. southernson

    southernson Member

    Joined:
    Jul 10, 2013
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Hi Michael,

    OK - thanks for that. I'll give that a try and see how it works.

    If you're looking for new ideas to improve cPanel, may I suggest an addin that can 'collect' email from another server automatically with the same email addresses for helping with migration? (Maybe something where you run manually, specify the other server's IP address, username and password). :)

    Best Regards

    Adam
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Feel free to open a feature request if you feel that would improve the product:

    Submit A Feature Request

    Thank you.
     
Loading...

Share This Page