procmail
[Top] [All Lists]

Re: filter duplicate mail

2002-06-14 07:58:14
After Kai explained that the goal is to eliminate duplicates to the same user,
Mark suggested,

| Change this in /etc/procmailrc:
|
|                :0 Wh: msgid.lock
|                | formail -D 8192 msgid.cache
|
| to this:
|                :0 Wh: ~/msgid.lock
|                | formail -D 8192 ~/msgid.cache
|
| The home directory of each user will be the location of their cache.

That's the way to go, but I have a few suggestions:

1. Procmail doesn't grok tildes, so you need to use the $HOME variable.  (If a
command requires a shell and $SHELL is one that understands tildes, it may
look as if procmail expanded a tilde, but in reality, the shell did it.
Procmail can't.)
2. Since most users won't care to see the cache file in an ordinary ls, I'd
recommend a name with a leading period, and the name for the local lockfile
preferably should be whatever the cache's name is plus $LOCKEXT.
3. If procmail still has root privileges at that point, I'm not sure what will
happen (maybe that won't be a problem if the cache file already exists and is
owned by the user, but what if the user deletes it and procmail creates a new
one while it has root privileges?), so maybe that should be done only after
setting DROPPRIVS=yes.
4. Some users may want to get all copies of their messages, so maybe you can
provide a way to opt out.  For example, such a user could touch a file named
~/.keepdupes, and the recipe in /etc/procmailrc could read,

 :0Wh:$HOME/.msgid.cache$LOCKEXT
 * ! ? test -f $HOME/.keepdupes
 | formail -D 8192 $HOME/.msgid.cache



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