procmail
[Top] [All Lists]

Re: Reprocessing mail

2002-12-16 15:22:40
At 16:38 2002-12-16 -0500, Kevin Ring wrote:
I've set up a new mail server and I want to move my users mail spools
from one to the other. I've read through the archives and the man page
and found several solutions, most being something like "formail -s
procmail < mailbox"

No, that invocation will run procmail for whatever account is currently shelled, not reprocess mail generically.

If you had a lot of mailboxes, I'd just drop into single user mode (which should handily disable the SMTP, POP, and IMAP services, and disable user logins for the duration, then use scp to copy the mailbox files from one host to the new one, presuming you did this before firing up mail services and stuffing things into user mailboxes.

That solution definitely reprocesses the mail, however I've found that
when I run that command on a mail spool, it delivers the mail to root
(the user I'm logged in as) and not the actual recipient of the mail.

Righto.  See 'man procmail' and 'man formail'.

Mailboxes do not store SMTP envelope data.

Assuming the new usernames are the same as the old ones (and if not, rename the mailbox files accordingly), and you're running this on the new mail host, then the following should do it (execute as root after reading the manpages to see what this is supposed to do). Note that the dir you place the old mailboxes in should contain NOTHING BUT THE OLD MAILBOXES:

for x in *
do
 formail -s procmail -d $x < $x
done

Keep in mind that by redelivering the mail, if any users have ~/.procmailrc files which, say, COPY mail to a local mailbox and allow default delivery to occur, these users will end up with extra copies for any messages they had previously manipulated.

Clearly I'm doing something wrong.

Clearly.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • Reprocessing mail, Kevin Ring
    • Re: Reprocessing mail, Professional Software Engineering <=