procmail
[Top] [All Lists]

Re: procmail filtering of /etc/aliases entries (not users)

2002-07-30 08:55:23
Your sketch is the way I have a number of aliases set up, though there
might be a better way.  Note that I'm using SpamAssassin, so my rc
file stays pretty short.  So, in my aliases file I have:

info: "|/usr/bin/procmail /etc/procmailrcs/info.rc"

And /etc/procmailrcs/info.rc contains:
-------------------------------------------------------------------
# This calls spamassassin
:0fw
| spamassassin -P

# This makes sure spamassassin exited properly
:0e
{
   EXITCODE=$?
}

# This forwards spam to spamtrap for Shane's inspection, but lets the
# rest of the recipe have a look at it too 
:0c
* X-Spam-Flag: YES
! spamtrap(_at_)gslis(_dot_)utexas(_dot_)edu

# I want all mail, even spammy mail to go on to info, just marked so
# the client can filter it. 
# To move spam to a quarantine folder instead, uncomment below
# :0:
# * X-Spam-Flag: YES
# spam-folder

#This forwards everything to an info-filtered alias and on from there
:0
!info-filtered-some_random_string_for_obscurity(_at_)gslis(_dot_)utexas(_dot_)edu
-------------------------------------------------------------------
If you have multiple address, I see two choices.  One, create another
alias (like the last address in my recipe) which points to all your
users, or the '!' forward flag can have multiple recipients, like:
!user1(_at_)gslis(_dot_)utexas(_dot_)edu, 
user2(_at_)gslis(_dot_)utexas(_dot_)edu, etc., 
with commas separating the users.  You could probably also read in the
list from a text file as you sketched, but I'll leave that explanation
to someone else.

On Tue, 30 Jul 2002, John McDermott wrote:

I am new to procmail and the list. Sorry if I ask something that is asked 
and answered somewhere I should have already found it. I have looked 
unsuccessfully.

My question:

I have an alias -- I'll call it 'mail-alias' here -- in /etc/aliases which 
corresponds to about 20 email addresses. (The addressees work on a common 
project). The alias has been on a web-page for some time, so gets a lot of 
spam. I want to do some filtering of the 'mail-alias' mail, even though 
there is no user 'mail-alias'. I'd like something like the following sketch 
of a plan to work:

+++ sketch +++
I move all the addresses for the alias into a text file called 
addresses.txt, say. Then I change the entry for mail-alias in /etc/aliases 
to read

mail-alias: "|/usr/bin/procmail /path/to/some_procmail.rc_file"

and I set entries in the file '/path/to/some_procmail.rc_file' to 1) filter 
out spam and 2) forward the remaining mail to the entries in addresses.txt.
+++ sketch +++

Well, I don't know if the sketch is even close. Has anyone out there done 
this successfully already? I'd really appreciate some pointers. If the 
sketch *is* the right sort of thing, has anybody got some help for me about 
just what needs to go in the .rc file?

Thanks in advance,
John.




--
John McDermott
BMS
University of St Andrews

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail


-- 
Public key #7BBC68D9 at            |                 Shane Williams
http://pgp.mit.edu/                |                               
=----------------------------------+-------------------------------
All syllogisms contain three lines |              shanew(_at_)shanew(_dot_)net
Therefore this is not a syllogism  |   www.gslis.utexas.edu/~shanew

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