Date: Fri, 5 Oct 2001 10:33:59 +1000 From: "ReDucTor" <sjdtmv@tpg.com.au> To: <huntsman@www.nisu.flinders.edu.au>, "Chris Aitken" <chris@ideal.net.au>, <php-general@lists.php.net>, <freebsd-questions@FreeBSD.ORG> Subject: Re: [PHP] Getting an Email into a PHP/pl script Message-ID: <002c01c14d35$73916b40$eb00a8c0@mum> References: <3BBCC9F7.EB932EE4@Visionnet.nl> <0c3701c14d18$3505c910$6401a8c0@workstation7> <5.1.0.14.2.20011005074857.0320bf88@mail.ideal.net.au> <01100509574700.05605@www>
next in thread | previous in thread | raw e-mail | index | archive | help
Most mail servers use qmail, so i will explain how to do it with qmail For your qmail accounts, you will have .qmail files(e.g. .qmail-default .qmail-webmaster and so on), open one of these files, now add the bottom of it |preline /path/to/php /path/to/script.php or you can do it with perl the same way, but with your path to perl, The email its self will be stored in stdin, if you want ot read it in php you can just go fopen("php://stdin", "r"); if you want to use it in perl, just do @stdinarray=<stdin>; it's an array, make sure to chomp() your results, from there you can prase the email, and check who it is, reply the the email, delete the email from the mailbox, what ever you want... :D ----- Original Message ----- From: "David Robley" <huntsman@www.nisu.flinders.edu.au> To: "Chris Aitken" <chris@ideal.net.au>; <php-general@lists.php.net>; <freebsd-questions@FreeBSD.ORG> Sent: Friday, October 05, 2001 10:27 AM Subject: Re: [PHP] Getting an Email into a PHP/pl script > 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! > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?002c01c14d35$73916b40$eb00a8c0>