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.

Merge Two Mail Files

Discussion in 'E-mail Discussions' started by billy79, Mar 28, 2006.

  1. billy79

    billy79 Active Member

    Joined:
    Dec 15, 2004
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    I figuerd someone must have asked this quesiton before but none of the search terms I tried returned any answers.

    I moved a client to a new server, and I screwed up the DNS forwarding. So some mail was delivered to the old server. Is there any way to merget he two mail files. This is a reseller who has quiet a few accounts, most of which have heavy email users.

    So overwriting the mail file on the new server is not an option as that is currently recieving email, but we cannot disregard the email that was delivered to the old server for just about a day.

    Any ideas or input would be greatly appreciated, I have a petty frustrated (and rightfully so) customer on my hands.

    -Billy
     
  2. Lyttek

    Lyttek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    770
    Likes Received:
    3
    Trophy Points:
    18
    Are you on mbox or maildir format? That'll make a big difference...
     
  3. billy79

    billy79 Active Member

    Joined:
    Dec 15, 2004
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    Now for the question that makes me look really stupid, how can I tell which one I have.

    To be honest I did not even know there was two formats to choose between.
     
  4. billy79

    billy79 Active Member

    Joined:
    Dec 15, 2004
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    From what I can tell I am running cppop so if I understand it correctly I am running mbox correct?
     
  5. Lyttek

    Lyttek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    770
    Likes Received:
    3
    Trophy Points:
    18
    I believe that's correct, yes.

    If you look through the users mail directories and see 'new' and/or 'cur' directories, then you're on maildir and it's a simple matter... just copy the files from one place to the other. Each message is stored as a single file.

    If instead you see files that end in .mbox , well then, that part should be obvious ;-)

    Do you have full control of the server? Can you convert over to the maildir format? If so, then you can do the conversion once, copy over the mbox file(s), run the conversion again, and it should take care of it.

    Of course, I'd like a second opinion on that idea, as there may be an easier way.

    If you can't convert to maildir, and everything is in mbox... there's going to be some work involved, methinks.
     
  6. billy79

    billy79 Active Member

    Joined:
    Dec 15, 2004
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    I have full root access to both servers.

    Since some people keep mail on the servers would I be better off converting both serves and then copying over all the mail. When it asks if I want to replace files I can so no, and only the new files will copy over and there will be no duplicates.

    Does anyone at all think this is a good idea, bad or whatever?

    Thanks,
    Billy
     
  7. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    One option is to rename the inbox on one to inbox2 then move it to the other one, then the user can just go to his webmail and do what he wants from there. If the customer knows whats going on, this would be easiest.

    Other option is to stop exim, append one file to the other, then restart exim.
     
  8. billy79

    billy79 Active Member

    Joined:
    Dec 15, 2004
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    Are you saying that I could do this under the current system? How would I go about appending the files together? Is this a difficult or risky move?

    Thanks for the input.

    -Billy
     
  9. aby

    aby Well-Known Member

    Joined:
    May 31, 2005
    Messages:
    638
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    That should not be difficult. Just copy the other inbox as inbox2 to the server by any means like scp or ftp where you need the mails to be.

    Then

    cat inbox2 >> inbox.

    That should do the job for you. anyway please keep a backup of inbox just to restore it if something goes wrong.
     
  10. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    That would do it. It will just append inbox2 to inbox.
     
  11. billy79

    billy79 Active Member

    Joined:
    Dec 15, 2004
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    Thanks guys. I like that idea of appending the two mail files and that is what we have decided to do. We will probably be doing that this afternoon.

    As always this board and it's users have proved to be very helpful :)
     
Loading...

Share This Page