On Thu, Dec 04, 2003 at 04:19:24AM +0800, rex cruz wrote:
Hello,
Im new to procmail,
i have a little bit question or guide on how to filter messages
like i want only to recieve email came from the ff. domain xxx.com, yyy.com,
and zzz.net.
Other domain will be rejected automatically.
You'd be better off using sendmail's access database (or an equivalent
for your MTA). You can block incoming messages at connection time
which is much more efficient and effective. However, if you've already
determined that procmail is the only tool that will help you
accomplish this, you can try this:
:0
* ! ^From:(_dot_)*(_at_)\<((xxx|yyy)\.com|zzz\.net)\>
{
## this varies depending on your MTA. See your sysexits.h file
EXITCODE=67
HOST
}
For longer, more maintainable lists, use a two-recipe technique:
## ok domains
:0
* 9876543210^0 ^From:(_dot_)*(_at_)\<xxx\.com\>
* 9876543210^0 ^From:(_dot_)*(_at_)\<yyy\.com\>
* 9876543210^0 ^From:(_dot_)*(_at_)\<zzz\.net\>
{ }
## everything else rejected
:0E
{
## this varies depending on your MTA. See your sysexits.h file
EXITCODE=67
HOST
}
Be sure you've read procmailrc, procmailex, and procmailsc manpages
before asking "how does this work?" questions.
Scott
--
Scott Wiersdorf
scott(_at_)perlcode(_dot_)org
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail