procmail
[Top] [All Lists]

Re: Where should I put the .procmailrc file?

2002-02-26 12:59:45
At 16:45 2002-02-26 +0100, Gilles N wrote:
I've a small question about procmail... I'm using a linux box with postfix as my entry mail server, then I use aliases to forward the mails to an NT Box where MS-Exchange is running. No users accounts are configured on the linux box, it's only a forwarding mail system...

I would like to use procmail to filter the incoming mails (like spam & virus). My question is where should I put the .procmailrc file if I would like to filter ALL incoming mails?

You'd put a filter in /etc/procmailrcs/, then deal with manually invoking it from postfix somehow. I don't use postfilx, but 'man procmail' does discuss how to invoke it from a _sendmail_ rule. I have a link at the top of my disclaimer page about how to configure procmail to be invoked from a sendmail rule.

As long as you're delivering through aliases though, you should be able to ignore rule-based invocation if postfix aliases are anything like sendmail ones, since you should then be able to do something like so:

remoteuser: "|/usr/local/bin/procmail -m /etc/procmailrcs/gilles_spam_filter.rc \"original alias text\""

(all one line of course). If you were originally piping to another prog, the "original alias text" would _NOT_ include the leading pipe symbol.

At the bottom of your gilles_spam_filter.rc, where you've reached the point that you're going to forward the message, you either:

:0
| $1

or

:0
! $1

depending on whether the arguments you're dealing with are other programs or addresses at a separate server (I don't use this technique for mail forwarding, but I do use it for placing special procmail filters in front of majordomo lists, so I use the first invocation type)

I've read many things about procmail but that always talk about user specific configuration ("the .procmailrc should be located into the /home folder...").

Procmail is most commonly used as an LDA, and that's where the .procmailrc file comes into play. YOU DON'T HAVE LOCAL DELIVERY, SO THIS DOESN'T APPLY.

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