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.

Mail in /new dir

Discussion in 'E-mail Discussions' started by jscherbel, Jun 12, 2007.

  1. jscherbel

    jscherbel Member

    Joined:
    Aug 27, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    I recently changed the MX record for a domain and there are 200 messages in the /mail/new directory that I'd like to "resend" to the new host. Is it possible to do this easily?
     
  2. jscherbel

    jscherbel Member

    Joined:
    Aug 27, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    So thinking about this more, the files contain complete headers and bodies for an email. Can I just dump these files in to some exim directory and have SMTP take them and redeliver?
     
  3. spammer

    spammer Member

    Joined:
    Dec 11, 2003
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    late reply, just had this problem for a few messages. couldn't find mention on forum here

    use script here http://wiki.exim.org/Redeliver in similar form to ->

    ./redeliver.pl /home/user/mail/domain.com/emailuser/new/xxxxxxxxxx.xxxxxxxxxxxxx.server.serverdomain.com
     
  4. HostIt

    HostIt Well-Known Member

    Joined:
    Feb 22, 2003
    Messages:
    151
    Likes Received:
    1
    Trophy Points:
    18
    Like you, I had this problem and couldn't find the answer here either, so I'll post the solution I eventually found in case it's helpful to others in future.

    Rather than using an external script like redeliver.pl, you can use the following single line in shell to redeliver an entire directory of mail (or a single existing email by adding the filename to the path) to *any* email address you specify:

    FOR MBOX SYSTEMS:
    Code:
    formail -Y -s sendmail some@address < /path/to/mbox
    FOR MAILDIR SYSTEMS:
    Code:
    for mail in `ls -1 /path/to/maildirfiles`; do formail -Y -s sendmail some@address < $mail; done
    I haven't tested on mbox, but the maildir command works great and maintains all mail headers, To/From/Date etc as they should be. Handy! :)
     
  5. apodigm

    apodigm Well-Known Member

    Joined:
    May 12, 2003
    Messages:
    67
    Likes Received:
    0
    Trophy Points:
    6
    exim -bm -t < filename
    (where filename is the name of the file in the /home/user/mail/new/ folder.

    This will re-queue to the original intended recipients of the mail.
     
    #5 apodigm, Apr 7, 2009
    Last edited: Apr 7, 2009
Loading...

Share This Page