From owner-freebsd-questions Wed Dec 18 16:13:21 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 508A837B401 for ; Wed, 18 Dec 2002 16:13:19 -0800 (PST) Received: from hotmail.com (oe51.law8.hotmail.com [216.33.240.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id E3CC043EA9 for ; Wed, 18 Dec 2002 16:13:18 -0800 (PST) (envelope-from mxsmanic@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 18 Dec 2002 16:13:18 -0800 X-Originating-IP: [193.251.59.14] From: "Mxsmanic" To: "Mark" , "Barry Byrne" , "FreeBSD Questions" References: <200212182250.GBIMOPT39354@asarian-host.net> Subject: Re: Getting Perl scripts to work as mail filters Date: Thu, 19 Dec 2002 01:13:17 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: X-OriginalArrivalTime: 19 Dec 2002 00:13:18.0768 (UTC) FILETIME=[6EE6D300:01C2A6F3] 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 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? ----- Original Message ----- From: "Mark" To: "Mxsmanic" ; "Barry Byrne" ; "FreeBSD Questions" Sent: Wednesday, December 18, 2002 23:50 Subject: Re: Getting Perl scripts to work as mail filters > ----- Original Message ----- > From: "Mxsmanic" > To: "Barry Byrne" ; "FreeBSD Questions" > > Sent: Wednesday, December 18, 2002 7:19 PM > Subject: Re: Getting Perl scripts to work as mail filters > > > > Heck, it's so simple I can list it here: > > > > --- > > #!/usr/bin/perl > > > > while ($inputline = ) > > { > > $inputline =~ s/18 Dec 2002/29 Dec 2013/; > > print STDOUT $inputline; > > } > > --- > > > A bit too simple, perhaps. :) > > STDOUT is irrelevant to sendmail here; because, as far as sendmail is > concerned, your message has already been delivered, namely to the alias > "mymail". And your log says so: > > "to="|/usr/home/mymail/mailman", ctladdr=mymail (1/0)" > > Indicating that the "controlling address" (ctladdr) is "mymail". If your > recipient ("mymail") decides to output something, good for him, but sendmail > is long since done with the delivery. > > If you want to use filters, more or less like you describe, have a look at: > > Sendmail::Milter > > > get deposited in my mailbox on the server. From what I can understand of > > how this works, some program actually receives the messages from sendmail > > (?) and deposits them in my /usr/home/$USER mailbox > > For that to happen, in a set-up where the alias is to deliver mail for > "variable" users, you might, for instance, take a look at the "plussed > users" facility in sendmail. But why re-invent the wheel? A program like > procmail will more than likely do what you want. But even procmail, run from > a .forward scheme, suffers from having difficulty extracting the intended > recipient. Only if you define a Perl mailer can you solve that problem > entirely, as you can parse sendmail variables like $f and $u to your > delivery agent. > > - Mark > > > 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