From owner-freebsd-questions Thu Feb 20 6:45:33 2003 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 11F4F37B401 for ; Thu, 20 Feb 2003 06:45:30 -0800 (PST) Received: from hotmail.com (dav44.sea1.hotmail.com [207.68.162.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7EA6643FBD for ; Thu, 20 Feb 2003 06:45:29 -0800 (PST) (envelope-from kenzo_chin@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 20 Feb 2003 06:45:29 -0800 X-Originating-IP: [209.187.233.156] From: "Kenzo" To: Subject: Fw: Removing emails from an email file automatically. Date: Thu, 20 Feb 2003 08:45:28 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: X-OriginalArrivalTime: 20 Feb 2003 14:45:29.0377 (UTC) FILETIME=[B6665110:01C2D8EE] 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 message bounced back with an undelivered message? ----- Original Message ----- From: "Kenzo" To: Sent: Thursday, February 20, 2003 8:18 AM Subject: Re: Removing emails from an email file automatically. > Better yet, use postfix. You can easily configure the files to block about > 90% of all spam. > http://www.postfix.org/ > Also use IMGATe. works great. > http://imgate.meiway.com/ > The site refers to it, as a mailgate for imail, but it will work for any > system. > On top of that you can use Amavis or RAV to scan all E-mails for viruses. > > ----- Original Message ----- > From: "Ken McGlothlen" > To: "Dragoncrest" > Cc: > Sent: Wednesday, February 19, 2003 10:23 PM > Subject: Re: Removing emails from an email file automatically. > > > > Dragoncrest writes: > > > > | Is there a simple way to remove a single email from a mail file using an > > | automated script of some kind? > > > > Well, it's better to remove them on their way in, with a tool like > procmail. > > > > I do have a set of tools I wrote to help one person get out from under his > > rather substantial spamload. I don't know if they'll help, but they might > give > > you some ideas. Note that these are not exhaustively written; they're > just > > very, very cheap hacks that could be improved on. Needless to say, > they're all > > intended to be run as root (unless you're working on your own mailbox). > > > > The first is "fromn," which gives you a numbered "from": > > > > #!/bin/sh > > > > from -f $1 | cat -n > > > > For example (dates slightly elided) > > > > $ fromn /var/mail/mcglk > > 1 From bounce-stellaawards-967752@lyris.net Feb 19 20:02:46 > 2003 > > 2 From owner-freebsd-questions@FreeBSD.ORG Feb 19 20:05:46 > 2003 > > 3 From nobody@devnull.spamcop.net Feb 19 20:05:57 2003 > > 4 From owner-freebsd-questions@FreeBSD.ORG Feb 19 20:06:08 > 2003 > > 5 From owner-freebsd-questions@FreeBSD.ORG Feb 19 20:06:21 > 2003 > > 6 From owner-freebsd-ports@FreeBSD.ORG Feb 19 20:06:31 2003 > > 7 From owner-freebsd-questions@FreeBSD.ORG Feb 19 20:06:57 > 2003 > > 8 From mcglk@artlogix.com Feb 19 20:08:42 2003 > > $ _ > > > > The second tool I have is "headers" > > > > #!/bin/sh > > > > skip=`dc -e "$2 1 - p"` > > formail +"$skip" -1 -s < $1 | formail -X "" > > > > This allows me to see the headers of any particular message without > violating > > the privacy of the body of the message. For example: > > > > $ headers /var/mail/mcglk 2 > > From nobody@devnull.spamcop.net Wed Feb 19 20:05:57 2003 > > Return-Path: > > Delivered-To: mcglk@artlogix.com > > Received: from shagrat.julianhaight.com (shagrat.julianhaight.com > > [216.127.43.86]) > > by c3po.artlogix.com (Postfix) with SMTP id 1D8331AA07 > > for ; Wed, 19 Feb 2003 20:05:57 -0800 > (PST) > > Received: (qmail 13946 invoked from network); > > 20 Feb 2003 03:59:44 -0000 > > Received: from localhost (HELO spamcop.net) (127.0.0.1) > > by shagrat.julianhaight.com with SMTP; 20 Feb 2003 > 03:59:44 -0000 > > From: SpamCop AutoResponder > > To: mcglk@artlogix.com > > Subject: SpamCop has accepted 1 email for processing > > Date: Thu, 20 Feb 2003 03:59:44 GMT > > Message-ID: > > In-Reply-To: <200302200357.TAA40662@itchy.serv.net> > > References: <200302200357.TAA40662@itchy.serv.net> > > $ _ > > > > If I really need to delete a message at this point, I can use > /usr/bin/mail to > > delete the message by the message number. > > > > Still, much better to use procmail so you don't have to do any of this > stuff in > > the first place if at all possible. > > > > | Can I setup something that will search a mail file, find a given sender, > and > > | then just nuke the message without hurting the mail file? > > > > In theory. Take a look at the manpages for formail (if you have procmail > > installed), which can extract headers from specific messages. > > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > > with "unsubscribe freebsd-questions" in the body of the message > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message