procmail
[Top] [All Lists]

Re: Newbie: Only allow certain domains

2002-07-27 17:51:55
On 27 Jul, Tim Luoma wrote:
| 
| It would be done better in sendmail or whatever other mail daemon you 
| are using, but it could be done in procmail with something like this:
| 
| 
| :0
| * ! ^From:.*@(ourdomain\.com|\
|       second\.safe\.place\.gov|\
|       other\.safe\.domain\.org)
| {
|       # exit 77 is 'no permission' iirc
|       EXITCODE=77
| 
|       :0
|       /dev/null
| 
| }
| 

As both you and Sean point out, this is almost certainly better
accomplished with the MTA.  But if that proves impossible, and Daniel
ends up needing to use procmail for this task, this recipe will only
work with those senders who are not playing games with their identity. 
Considering the audience (k12), that opens the door to some pretty
egregious offenders.  At the very least, he would also want to check the
envelope sender via ^^From or ^Return-Path, and arguably check that the
envelope matches the From: header.

If it were my job to do I'd do everything possible with the MTA, then
back it up with procmail doing checks like those above, followed by
content filtering.  In fact, that IS how I do it. ;-)

-- 
Reply to list please, or append "8" to "procmail" in address if you must.
Spammers' unrelenting address harvesting forces me to this...reluctantly.


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