Date: Fri, 30 Oct 1998 04:54:53 -0600 From: Jon Hamilton <hamilton@pobox.com> To: "Jason C. Wells" <jcwells@u.washington.edu> Cc: FreeBSD-questions <freebsd-questions@FreeBSD.ORG> Subject: Re: Mail Recovery Message-ID: <199810301049.CAA16928@hub.freebsd.org> In-Reply-To: Your message of "Fri, 30 Oct 1998 00:01:36 PST." <Pine.BSF.4.05.9810292355300.766-100000@s8-37-26.student.washington.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <Pine.BSF.4.05.9810292355300.766-100000@s8-37-26.student.washington.
edu>, "Jason C. Wells" wrote:
} I buggered up procmail and now I have a file named :0: with 80 messages
} in it.
}
} I moved the :0: file to /var/mail/jason thinking they would be filtered on
} the next mail delivery. They are not. They are just sitting in there.
Naturally. I'm not sure why you would expect procmail to filter messages
already in your inbox; they're by definition already delivered. Anyway,
all hope isn't lost.
} I don't read mail from my ${MAIL} box under normal circumstances. All of
} the traffic I gets put in a special mail folder so I can keep all my
} FreeBSD traffic straight.
}
} I am using sendmail, fetchmail, and procmail.
}
} How can I force redelivery and filtering of these messages?
There's an example in the procmail(1) man page that's probably a little
verbose and over-general for your situation, but should work nonetheless
(the important part is the formail -s procmail line):
Procmail can also be invoked to postprocess an already
filled system mailbox. This can be useful if you don't
want to or can't use a $HOME/.forward file (in which case
the following script could periodically be called from
within cron(1), or whenever you start reading mail):
#!/bin/sh
ORGMAIL=/var/mail/$LOGNAME
if cd $HOME &&
test -s $ORGMAIL &&
lockfile -r0 -l1024 .newmail.lock 2>/dev/null
then
trap "rm -f .newmail.lock" 1 2 3 13 15
umask 077
lockfile -l1024 -ml
cat $ORGMAIL >>.newmail &&
cat /dev/null >$ORGMAIL
lockfile -mu
formail -s procmail <.newmail &&
rm -f .newmail
rm -f .newmail.lock
fi
exit 0
BuGless 1997/04/11 14
PROCMAIL(1) PROCMAIL(1)
--
Jon Hamilton
hamilton@pobox.com
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810301049.CAA16928>
