What is the limit on streams?

Here's what I'm intending to do and perhaps someone has a better solution:
I have a list of email addresses for a virtual email host:

[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]

I want to group by domain, append an ' OK' and insert a '$domain REJECT' after
each domain block.  The output should look like this:

[EMAIL PROTECTED] OK
[EMAIL PROTECTED] OK
[EMAIL PROTECTED] OK
happy.com REJECT
[EMAIL PROTECTED] OK
blah.com REJECT
[EMAIL PROTECTED] OK
test.org REJECT

I want to process the input once for scalability.  Right now I have a small
perl script that opens up 1 through # of domains as streams (ie >&1, >&2,
 >&3).  Then I intend to capture these streams in order.  The streams are all
stored in a hash.  However something tells me this is only an exercise in
stream fun and not the ideal approach.  Pseudo code, Perl or shell solutions
are welcome.

Here's a naive way I could do this with bash, however it calls ldapdump
repeatedly.  ldapdump is a perl script that dumps all email addresses from an
ldap server.

( for i in `cat destination_domains` ; do 
    ldapdump | egrep $i | sed -e 's/$/ OK/'; echo $i REJECT ; 
  done ) > valid_local_senders

Finally, here's why:  Postfix has the capability to reject email for addresses
that don't exist on it's local domains.  However it does not have the native
configured ability to reject email "From: " non-existent addresses on it's
local domains.  Well I figured out how to configure it.  Now for a specific set
of domains that the local mail server is responsible for, email must be either
to or from valid users.

Cory


-- 
Cory Petkovsek                                       Adapting Information
Adaptable IT Consulting                                Technology to Your
(858) 705-1655                                                   Business
[EMAIL PROTECTED]                                  www.AdaptableIT.com

_______________________________________________
EuG-LUG mailing list
[EMAIL PROTECTED]
http://mailman.efn.org/cgi-bin/listinfo/eug-lug

Reply via email to