From owner-freebsd-questions Wed Dec 18 14:51:10 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 9742637B401 for ; Wed, 18 Dec 2002 14:51:08 -0800 (PST) Received: from mail4.sea.registeredsite.com (mail4.sea.registeredsite.com [66.111.73.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3829543EE1 for ; Wed, 18 Dec 2002 14:51:07 -0800 (PST) (envelope-from admin@asarian-host.net) Received: from asarian-host.net (asarian-host.net [216.122.74.112]) by mail4.sea.registeredsite.com (8.12.6/8.12.6) with ESMTP id gBIMox7t013901 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 18 Dec 2002 17:51:01 -0500 Comments: To protect the identity of the sender, certain header fields are either not shown, or masked. Anonymous email addresses for asarians can be requested by filling in the appropriate form at: https://asarian-host.net/cgi-bin/signup.cgi Received: (from root@localhost) by asarian-host.net (8.11.6/8.11.0) id gBIMov139405 for freebsd-questions@freebsd.org; Wed, 18 Dec 2002 23:50:57 +0100 (CET) (envelope-from admin@asarian-host.net) Posted-Date: Wed, 18 Dec 2002 23:50:57 +0100 (CET) From: Mark Message-Id: <200212182250.GBIMOPT39354@asarian-host.net> Date: Wed, 18 Dec 2002 23:50:45 +0100 X-Authenticated-Sender: admin@asarian-host.net Subject: Re: Getting Perl scripts to work as mail filters X-Trace: cmwIiJ5RFiMbJCim3LvOb1fdK2HME5Ofq26L3awqFNC6Ekpg1h3iGHSZFdS7p7Xb X-Complaints-To: abuse@asarian-host.net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we are unable to process your complaint Organization: Asarian-host To: "Mxsmanic" , "Barry Byrne" , "FreeBSD Questions" References: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Auth: Asarian-host PGP signature iQEVAwUAPgD70TFqW1BleBN9AQFRKwf9ERPk11J/SLzNxcaN1WEjN9UBL9042iyj +Drlqg8fUr6Vs8PhQDEDT6SHbl2i+5HxzGdedodBVjg2bjn2c1COqk7uUIS1C+JR ULZSffk755gwrzcKpgxYS+Zvfwr0j3kWZEfmYFalC6KMJNWuMymNXScUGcg8ZE9B eFmmOOktbuORFw92bZHVGv9UQhvlFvVh98a2pHaeqQobGzTHBBbnbatetHCv+P7t 6WXpCor/6ryBBknPbuz/fAuUOljiXGrsIdNhJaZcAJAK+dy3zVh86b6aEo1Jv9NA DbTefE02gwkxglZNNCRF48H9FEgyRdryJsIrvB6RbIrgIs7MOOP04Q== =iQNu 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 ----- 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