procmail
[Top] [All Lists]

Re: Make procmail write to /tmp on home machine?

1997-11-10 23:13:34
Andrew Kelley <kelleya(_at_)dimensional(_dot_)com> writes:
Sorry if this is a clueless newbie question. I want to store spam outside
my quota, so I can check it for false positives but not take up precious
disk space. Problem: if I tell procmail to deliver to, say, /tmp/spam.box,
it does so just fine (according to the log). Unfortunately, it delivers
to /tmp on the mail host which I cannot access. (spam.box doesn't appear
in the /tmp directory of the shell machine when procmail is invoked for
incoming mail. However, when I run procmail from the command line, it
delivers to /tmp/spam.box on the shell machine just fine.)

How can I force procmail to deliver to the /tmp directory of the shell
machine?

Under the most likely configuration of sendmail in this situation, it
is impossible to have procmail invoked by sendmail on the shell
machine:  sendmail is probably set to just forward all mail to the
designated mail delivery machine.

There are other options: you could temporarily store the mail in your
account, then have a cronjob on the shell machine that reprocesses the
message.  That would probably be more efficient than having each message
trigger an rsh to the shell machine.  If you actually get enough spam that
it's pushing against your quota, then the rsh is too expensive -- use a
cronjob that invokes something like:

        cd your-maildir && lockfile spam.lock && test -s spam && { procmail 
DEFAULT=/tmp/spam.box /dev/null <spam && rm -f spam; rm -f spam.lock; }

WARNING: the above assumes the following:
        everything in your-maildir/spam is spam and belongs in /tmp/spam.box
        no further filtering of the messages is necessary: they just need to
                be moved (it actually treats everything in the
                your-maildir/spam as a single message and uses procmail as
                a reliable copy command, thus the DEFAULT assignment as the
                use of /dev/null as a empty procmailrc)
        /tmp/spam.box is a not a directory

If the latter two of those conditions isn't true OR IF THEY MIGHT
CHANGE then you should use formail -s to break the message apart and
invoke procmail on each one separately.

Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>