From owner-freebsd-questions Thu Oct 4 17:27:54 2001 Delivered-To: freebsd-questions@freebsd.org Received: from dell21.cc.flinders.edu.au (dell21.cc.flinders.edu.au [129.96.253.20]) by hub.freebsd.org (Postfix) with ESMTP id 1714C37B401 for ; Thu, 4 Oct 2001 17:27:50 -0700 (PDT) Received: from www (www.nisu.flinders.edu.au [129.96.218.127]) by dell21.cc.flinders.edu.au (Postfix) with SMTP id 8FFE8BC76; Fri, 5 Oct 2001 09:57:48 +0930 (CST) Content-Type: text/plain; charset="iso-8859-1" From: David Robley Reply-To: huntsman@www.nisu.flinders.edu.au Organization: Centre for Injury Studies To: Chris Aitken , php-general@lists.php.net, freebsd-questions@FreeBSD.ORG Subject: Re: [PHP] Getting an Email into a PHP/pl script Date: Fri, 5 Oct 2001 09:57:47 +0930 X-Mailer: KMail [version 1.2] References: <3BBCC9F7.EB932EE4@Visionnet.nl> <0c3701c14d18$3505c910$6401a8c0@workstation7> <5.1.0.14.2.20011005074857.0320bf88@mail.ideal.net.au> In-Reply-To: <5.1.0.14.2.20011005074857.0320bf88@mail.ideal.net.au> MIME-Version: 1.0 Message-Id: <01100509574700.05605@www> Content-Transfer-Encoding: 8bit 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 Fri, 5 Oct 2001 07:24, Chris Aitken wrote: > Hi all, > > I have looked into the archives but im not sure what im searching for > so I decided to ask here. > > What I want to do is, on my FreeBSD box running PHP and MySQL, to have > a system which will take any email sent to a specific address, and pipe > the body of the email to PHP (or even to a perl script). Once I have > the body of the email as a variable, I can do all my parsing and > extracting etc to do with it as I need, but im baffled on where to > start looking to get this done. > > Any help would be greatly appreciated. What are you using for an MTA? If for example you are using sendmail, you can set up an alias, via an entry in /etc/aliases which pipes the incoming mail to a script, which could be a php script. Of course, you would need a php binary. Similarly you can set up an alias file with qmail which passes the email to a script. This is a common technique for say creating web based mail list archives. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Cats aren't clean, they're just covered with cat spit! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message