On Sat, 2010-06-12 at 08:59 -0700, andrewj wrote: > > Evan Platt wrote: > > > > Why are you accepting e-mail to that address in the first place? You > > should have your MTA not accept the mail in the first place. > > > > I want to accept email on that address from certain trusted users. I want to > block everything except the whitelist. can I do this? > You don't say what your MTA is, but in Postfix you can do this at MTA level with header_checks. It gives you the option of rejecting (REJECT), silently discarding (DISCARD) or excluding the message from further checks of this type (DUNNO). You can use Perl-type regular expressions for this. The regexes in a .pcre file are executed in the order they are listed, so something like
/^From:.*goodg...@spamsource\.com/ DUNNO /^From:....@spamsource\.com/ REJECT should accept mail from good...@spamsource.com while rejecting all other mail from spamsource.com. DUNNO is a Postfixism that says 'pretend messages that match this regex weren't compared with this file's contents. Disclaimer: this has not been tested. It was merely written after looking at the Postfix manual. Martin