From owner-freebsd-questions Fri Aug 2 10:46: 1 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 31D3537B400 for ; Fri, 2 Aug 2002 10:45:56 -0700 (PDT) Received: from sage-one.net (adsl-65-71-135-137.dsl.crchtx.swbell.net [65.71.135.137]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1817243E65 for ; Fri, 2 Aug 2002 10:45:52 -0700 (PDT) (envelope-from jackstone@sage-one.net) Received: from sagea (sagea [192.168.0.3]) by sage-one.net (8.11.6/8.11.6) with SMTP id g72HjZB31967; Fri, 2 Aug 2002 12:45:37 -0500 (CDT) (envelope-from jackstone@sage-one.net) Message-Id: <3.0.5.32.20020802124533.02ba28a8@mail.sage-one.net> X-Sender: jackstone@mail.sage-one.net X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32) Date: Fri, 02 Aug 2002 12:45:33 -0500 To: Roman Neuhauser , freebsd-questions@FreeBSD.ORG From: "Jack L. Stone" Subject: Re: Script help In-Reply-To: <20020802164606.GJ52563@freepuppy.bellavista.cz> References: <3.0.5.32.20020802112435.02ba28a8@mail.sage-one.net> <20020802155258.GG52563@freepuppy.bellavista.cz> <3.0.5.32.20020802094620.02ba28a8@mail.sage-one.net> <20020802155258.GG52563@freepuppy.bellavista.cz> <3.0.5.32.20020802112435.02ba28a8@mail.sage-one.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At 06:46 PM 8.2.2002 +0200, Roman Neuhauser wrote: >> Date: Fri, 02 Aug 2002 11:24:35 -0500 >> To: Roman Neuhauser , >> freebsd-questions@FreeBSD.ORG >> From: "Jack L. Stone" >> Subject: Re: Script help >> >> At 05:59 PM 8.2.2002 +0200, Roman Neuhauser wrote: >> >> From: Roman Neuhauser >> >> > From: "Jack L. Stone" >> >> > >> >> > When placing blocks on some ISPs as being sources of spam floods, >> >> > one consideration has to be if it affects a number of innocent >> >> > members on various vhost majordomo mail lists so they may have >> >> > passes. >> >> > >> >> > I know I can find a list of any that would be affected by >> >> > manually doing this: grep spammer1.net /mj/vhost1.com/lists/list1 >> >> > grep spammer1.net /mj/vhost2.org/lists/list2 >> >> > grep spammer1.net /mj/vhost2.org/lists/list2-digest >> >> > ..etc, etc. >> >> > >> >> > ..but, doing that for each list takes a lot of time and some type >> >> > of script would sure speed up things, like this command that runs >> >> > a script to check the above 3 mail lists all at once: >> >> > root@myserver>> check_all_lists >> >> > output = goodguy1@spammer1.net >> >> > goodguy2@spammer1.net >> >> > goodguy3@spammer1.net >> >> >> >> grep -Fl spammer1.net /mj/*/lists/* >> > >> > hm. if you had enough (like 3000) vhosts you could exceed your >> > shell's (or is it kernel? anyone?) command line argument count >> > limit. if that's the case, you could (not tested): >> > >> > #!/bin/sh >> > >> > for d in /mj/*; do >> > grep -Flr spammer1.net $d/lists >> > done >> > >> >> Thanks for the quick response. Maybe I wasn't clear enough but that >> gives me a list of the "lists" that contans "spammer1.net" but not a >> list of the email address within those lists. >> My example of output needed: >> output = goodguy1@spammer1.net >> goodguy2@spammer1.net >> goodguy3@spammer1.net >> >> I need to know who is affected in each list so I can set them as OK by >> email addresses, but still block the IPS's general address. Not sure >> I'm being clear yet.... > > #!/bin/sh > > for d in /mj/*; do > grep -Flhr spammer1.net $d/lists > done > > but this is all in the man page. have you seen it at all? > >-- Ah, this may be crude, but it works great: grep spammer1.net /mj/vhost1.com/lists/list1 > oklist grep spammer2.com /mj/vhost2.org/lists/list2 >> okaylist grep spammer3.org /mj/vhost2.org/lists/list2-digest >> okaylist mail -s "Spammer ISP Passes" mail_to_me < oklist All I need to do is replace the "spammerxx.xxx" first (gotta script that too!), then run that script that mails itself to me.... Best regards, Jack L. Stone, Administrator SageOne Net http://www.sage-one.net jackstone@sage-one.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message