Re: [Exim] Resending messages

Top Page
Delete this message
Reply to this message
Author: Tor Slettnes
Date:  
To: Steffen Heil
CC: exim-users
Subject: Re: [Exim] Resending messages
On Apr 7, 2004, at 00:21, Steffen Heil wrote:
> A user of mine lost its mailbox. But since I do journaling for him
> (every
> incoming or outgoing message on that server is stored in one single
> maildir), he asked me to resend all his messages of the last 2 month.
> Actually the information is there, but I do not want to sort them out
> manually, since there are a few hundred thousand (in monthly folders).


    # find /global/Maildir -type f -print0 | \
      xargs -0 grep -H -i "^Envelope-To: $user" | \
      cut -d: -f1 | \
      while read mailfile
      do
         echo "Restoring $mailfile"
         cp -a "$mailfile" ~user/Maildir/new/
      done


    # chown -R $user:$user ~user/Maildir/new/



- In other words, you normally don't need to send these through Exim
(or any MTA), as long as you can copy them into the user's
"Maildir/new/".

- However, if the user filters their mail (through an exim filter,
sieve filter, or procmail), then replace the "cp" above with:
/usr/sbin/sendmail $user < "$mailfile"
(In this case, the messages will of course be altered somewhat in terms
of Received: trail, and received time stamp).