From owner-freebsd-questions Wed Dec 18 16:24:41 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 D9E5E37B401 for ; Wed, 18 Dec 2002 16:24:39 -0800 (PST) Received: from boris.st.hmc.edu (boris.ST.HMC.Edu [134.173.63.11]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B47C43EB2 for ; Wed, 18 Dec 2002 16:24:39 -0800 (PST) (envelope-from jeff@unixconsults.com) Received: from boris.st.hmc.edu (localhost [127.0.0.1]) by boris.st.hmc.edu (8.12.3/8.12.3) with ESMTP id gBJ0OXaq035330 for ; Wed, 18 Dec 2002 16:24:33 -0800 (PST) Received: from localhost (jeff@localhost) by boris.st.hmc.edu (8.12.3/8.12.3/Submit) with ESMTP id gBJ0OWPc035327 for ; Wed, 18 Dec 2002 16:24:32 -0800 (PST) (envelope-from jeff@unixconsults.com) X-Authentication-Warning: boris.st.hmc.edu: jeff owned process doing -bs Date: Wed, 18 Dec 2002 16:24:32 -0800 (PST) From: Jeff Jirsa X-X-Sender: jeff@boris.st.hmc.edu To: FreeBSD Questions Subject: Re: Getting Perl scripts to work as mail filters In-Reply-To: Message-ID: <20021218161618.T35315-100000@boris.st.hmc.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-milter on boris.st.hmc.edu 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 On Thu, 19 Dec 2002, Mxsmanic wrote: > What about appending directly to the mailbox file under /var/mail/$USER with > the script? It looks like the format of the file is very simple. Why > wouldn't that work? I've tried writing to it, but I can't, at least not > when the script runs from the aliases file (works fine when I run it myself, > though). > > Procmail is exactly the sort of bloated tool that I'm trying to avoid. > > I don't know that calling sendmail again would be _that_ hard. After all, > I'm mostly just copying the input to the output. I guess all I'd have to do > would be to change the recipient address to avoid a loop (?). Right? Can't > I just leave all the headers intact otherwise? > Yes, using aliases would probably work to avoid a loop. You may even want to clean out the Cc: and To: lines of anyone and everyone you didn't want getting another copy (I'm not 100% sure this is the case, but it seems to me that if there's a long list of people Cc:'d, calling sendmail again without stripping them out will send them another email).. Someone else mentioned it, I think it's worth mentioning again. I'm not 100% sure what you want to do, but I'm 99% sure you'd be better off using Sendmail's Milter interface than trying to mess around with aliases and .forward files. Check out http://www.samag.com/documents/s=7178/sam0206l/. It's got an example of a small perl script Milter, and the sendmail source has some others (in C, last I checked). - Jeff Jirsa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message