procmail
[Top] [All Lists]

Re: Trouble with procmailex recipe

2003-10-21 11:41:54
At 18:05 2003-10-21 +0100, Adrian Simmons wrote:

Hello, recently I started using procmail to send my high scoring spam and virus tagged messages to /dev/null,

"recently started using procmail" and "/dev/null" don't belong in the same phrase. At a MINIMUM, you should be filing messages in a mailbox, and looking at it periodically. Only after you've become familiar with procmail should you send things to the bitbucket from which you can't retrieve things.

So now I have this in my ~/.procmailrc :

:0 c
backup

If you're writing to a MAILDIR, I'd generally expect a trailing slash on the destination filespec. Otherwise, it looks like you're writing to a file, and you don't have a lockfile flag on the flags line...

I'm also thinking I'd like all the messages in a single file, mbox format, I'd have to remove the current directory and create the file and use a rule like this for the backup, right?

:0 c
$PMDIR/backup

But then how would I limit the number of backed-up messages? Anybody got a recipe they could share?

Your problem here is the need to constantly reprocess the mailbox to eliminate the messages stored at the top when tacking something onto the bottom. Not trivial (and highly inefficient in any event). You're better off with a MAILDIR for backups if you want to keep the backup limited to some number of messages.

An alternative is to simply back up messages on a daily bassis - toss messages into a date-named mailbox file (see procmailex, I'm sure there's such an example), and externally, via a cron script, delete the backup mailbox corresponding to "x" days ago. Similarly, you can rotate a backup every "x" days (which keeps you out of the business of having to name files with dates, etc).

Consider the purpose of a backup, and whether, if you get a lot of messages, you'll really be around to solve something just because 21 messages have processed through your account - isn't it easier to expect that you'll hit your account at least every 3 days or something like that?

---
 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>