473,570 Members | 2,840 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mail2PHP

I want to send an email directly to a directory on my server
what script do I need to do this?
Maybe I should add a line to my aliases file like this: emailaddress:
"|/usr/bin/email2directory " ?
Thanks for some suggestions
Jul 16 '05 #1
10 3823
in your aliases enter a line such as:

mailprog: "|/usr/local/bin/php /path/to/your/file.php"

The below script will read the entire email recieved and store it in $buffer
for you do do what you want with it...

<?php
define('STDIN', fopen("php://stdin","r"));
//define('STDIN', fopen("dev/stdin","r"));
$str = fgets(STDIN);

$fp = popen('cat /dev/fd/0','r');
while(!feof($fp )) {
$lines = fgets($fp,4096) ."\n";
}

$handle = STDIN;
while (!feof ($handle)) {
$buffer .= fgets($handle, 4096);
echo $buffer;
}
fclose ($handle);

// Rest of Script to manipulate the recieved email...

?>

HTH,

Brian...

"Lukas" <Lu***@verwijde rdit.be> wrote in message
news:3f******** *************@r eader0.news.sky net.be...
I want to send an email directly to a directory on my server
what script do I need to do this?
Maybe I should add a line to my aliases file like this: emailaddress:
"|/usr/bin/email2directory " ?
Thanks for some suggestions

Jul 16 '05 #2

"Brian McGarvie" <br************ @nospam.anypurp oseloans.co.uk> schreef in
bericht news:be******** **@sparta.btint ernet.com...
in your aliases enter a line such as:

mailprog: "|/usr/local/bin/php /path/to/your/file.php"

where can I find the exact path of php? It's not on this location :-(
Jul 16 '05 #3

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Whilst lounging around on Sat, 5 Jul 2003 11:35:09 +0200, "Lukas"
<Lu***@verwijde rdit.be> amazingly managed to produce the following
with their Etch-A-Sketch:

"Brian McGarvie" <br************ @nospam.anypurp oseloans.co.uk>
schreef in bericht news:be******** **@sparta.btint ernet.com...
in your aliases enter a line such as:

mailprog: "|/usr/local/bin/php /path/to/your/file.php"

where can I find the exact path of php? It's not on this location
:-(

$ locate php

or

$ find / -name php

HTH.
Regards,

Ian

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0

iQA/AwUBPwaiT2fqtj2 51CDhEQIT8ACeOJ G5Bco26og5etX+y P5oMJ6SkjsAmweB
q5yo5advPNid9F+ Pe3xg5giS
=fZ+V
-----END PGP SIGNATURE-----

--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.ne t | forum.digiserv. net
Programming, Web design, development & hosting.
Jul 16 '05 #4

"Ian.H [dS]" <ia*@WINDOZEdig iserv.net> schreef in bericht
news:2h******** *************** *********@4ax.c om...

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Whilst lounging around on Sat, 5 Jul 2003 11:35:09 +0200, "Lukas"
<Lu***@verwijde rdit.be> amazingly managed to produce the following
with their Etch-A-Sketch:

"Brian McGarvie" <br************ @nospam.anypurp oseloans.co.uk>
schreef in bericht news:be******** **@sparta.btint ernet.com...
in your aliases enter a line such as:

mailprog: "|/usr/local/bin/php /path/to/your/file.php"

where can I find the exact path of php? It's not on this location
:-(

$ locate php

or

$ find / -name php

%locate php
/usr/local/www/bin/php-config
/usr/local/www/bin/phpextdist
/usr/local/www/bin/phpize
/usr/local/www/etc/php.ini-dist
/usr/local/www/include/php
/usr/local/www/include/php/TSRM
/usr/local/www/include/php/TSRM/TSRM.h
/usr/local/www/include/php/TSRM/acconfig.h
/usr/local/www/include/php/TSRM/readdir.h
/usr/local/www/include/php/TSRM/tsrm_config.h
/usr/local/www/include/php/TSRM/tsrm_config.w32 .h
/usr/local/www/include/php/TSRM/tsrm_config_com mon.h
/usr/local/www/include/php/TSRM/tsrm_strtok_r.h
/usr/local/www/include/php/TSRM/tsrm_virtual_cw d.h
/usr/local/www/include/php/TSRM/tsrm_win32.h
/usr/local/www/include/php/Zend
/usr/local/www/include/php/Zend/-ZENDSHIT-
/usr/local/www/include/php/acconfig.h
/usr/local/www/include/php/ext
/usr/local/www/include/php/ext/standard
/usr/local/www/include/php/ext/standard/-STANDARDSHIT-
/usr/local/www/include/php/ext/xml
/usr/local/www/include/php/ext/xml/-XMLSHIT-
/usr/local/www/include/php/main
/usr/local/www/include/php/main/-MAINSHIT-
/usr/local/www/include/php/php_version.h
/usr/local/www/include/php/regex
/usr/local/www/include/php/regex/-REGEXSHIT-
/usr/local/www/lib/php
/usr/local/www/lib/php/Benchmark
/usr/local/www/lib/php/Benchmark/Iterate.php
/usr/local/www/lib/php/Benchmark/Timer.php
/usr/local/www/lib/php/Cache
/usr/local/www/lib/php/Cache/-CACHESHIT-
/usr/local/www/lib/php/Console
/usr/local/www/lib/php/Console/Getopt.php
/usr/local/www/lib/php/Crypt
/usr/local/www/lib/php/Crypt/CBC.php
/usr/local/www/lib/php/Crypt/HCEMD5.php
/usr/local/www/lib/php/DB
/usr/local/www/lib/php/DB/-DBSHIT-
/usr/local/www/lib/php/Date
/usr/local/www/lib/php/Date/Calc.php
/usr/local/www/lib/php/Date/Human.php
/usr/local/www/lib/php/File
/usr/local/www/lib/php/File/Find.php
/usr/local/www/lib/php/File/Passwd.php
/usr/local/www/lib/php/File/SearchReplace.p hp
/usr/local/www/lib/php/HTML
/usr/local/www/lib/php/HTML/Common.php
/usr/local/www/lib/php/HTML/Form.php
/usr/local/www/lib/php/HTML/IT.php
/usr/local/www/lib/php/HTML/ITX.php
/usr/local/www/lib/php/HTML/Page.php
/usr/local/www/lib/php/HTML/Processor.php
/usr/local/www/lib/php/HTML/Select.php
/usr/local/www/lib/php/HTML/Table.php
/usr/local/www/lib/php/HTTP
/usr/local/www/lib/php/HTTP/Compress.php
/usr/local/www/lib/php/HTTP.php
/usr/local/www/lib/php/Image
/usr/local/www/lib/php/Image/Remote.php
/usr/local/www/lib/php/Log
/usr/local/www/lib/php/Log/composite.php
/usr/local/www/lib/php/Log/file.php
/usr/local/www/lib/php/Log/mcal.php
/usr/local/www/lib/php/Log/observer.php
/usr/local/www/lib/php/Log/sql.php
/usr/local/www/lib/php/Log/syslog.php
/usr/local/www/lib/php/Log.php
/usr/local/www/lib/php/Mail
/usr/local/www/lib/php/Mail/RFC822.php
/usr/local/www/lib/php/Mail/sendmail.php
/usr/local/www/lib/php/Mail/smtp.php
/usr/local/www/lib/php/Mail.php
/usr/local/www/lib/php/Math
/usr/local/www/lib/php/Math/Fraction.php
/usr/local/www/lib/php/Math/Util.php
/usr/local/www/lib/php/Net
/usr/local/www/lib/php/Net/Curl.php
/usr/local/www/lib/php/Net/Dig.php
/usr/local/www/lib/php/Net/SMTP.php
/usr/local/www/lib/php/Net/Socket.php
/usr/local/www/lib/php/Numbers
/usr/local/www/lib/php/Numbers/Roman.php
/usr/local/www/lib/php/PEAR
/usr/local/www/lib/php/PEAR/Common.php
/usr/local/www/lib/php/PEAR/Installer.php
/usr/local/www/lib/php/PEAR/Packager.php
/usr/local/www/lib/php/PEAR/Uploader.php
/usr/local/www/lib/php/PEAR.php
/usr/local/www/lib/php/Payment
/usr/local/www/lib/php/Payment/Verisign.php
/usr/local/www/lib/php/Schedule
/usr/local/www/lib/php/Schedule/At.php
/usr/local/www/lib/php/XML
/usr/local/www/lib/php/XML/Parser.php
/usr/local/www/lib/php/XML/RPC
/usr/local/www/lib/php/XML/RPC/Server.php
/usr/local/www/lib/php/XML/RPC.php
/usr/local/www/lib/php/build
/usr/local/www/lib/php/build/acinclude.m4
/usr/local/www/lib/php/build/dynlib.m4
/usr/local/www/lib/php/build/dynlib.mk
/usr/local/www/lib/php/build/fastgen.sh
/usr/local/www/lib/php/build/library.mk
/usr/local/www/lib/php/build/ltlib.mk
/usr/local/www/lib/php/build/mkdep.awk
/usr/local/www/lib/php/build/pear.m4
/usr/local/www/lib/php/build/program.mk
/usr/local/www/lib/php/build/rules.mk
/usr/local/www/lib/php/build/rules_common.mk
/usr/local/www/lib/php/build/rules_pear.mk
/usr/local/www/lib/php/build/shtool
/usr/local/www/libexec/libphp4.so
/var/db/pkg/mod_php4-4.0.6_5
/var/db/pkg/mod_php4-4.0.6_5/+COMMENT
/var/db/pkg/mod_php4-4.0.6_5/+CONTENTS
/var/db/pkg/mod_php4-4.0.6_5/+DESC
/var/db/pkg/mod_php4-4.0.6_5/+DISPLAY
/var/db/pkg/phpMyAdmin-2.1.0
/var/db/pkg/phpMyAdmin-2.1.0/+COMMENT
/var/db/pkg/phpMyAdmin-2.1.0/+CONTENTS
/var/db/pkg/phpMyAdmin-2.1.0/+DESC
Jul 16 '05 #5

"Joshua Ghiloni" <jd***@SPAM.ME. AND.DIE.cwru.ed u> schreef in bericht
news:be******** **@eeyore.INS.c wru.edu...
Lukas wrote:
"Ian.H [dS]" <ia*@WINDOZEdig iserv.net> schreef in bericht
news:2h******** *************** *********@4ax.c om...
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Whilst lounging around on Sat, 5 Jul 2003 11:35:09 +0200, "Lukas"
<Lu***@verwij derdit.be> amazingly managed to produce the following
with their Etch-A-Sketch:
"Brian McGarvie" <br************ @nospam.anypurp oseloans.co.uk>
schreef in bericht news:be******** **@sparta.btint ernet.com...

>in your aliases enter a line such as:
>
>mailprog: "|/usr/local/bin/php /path/to/your/file.php"

where can I find the exact path of php? It's not on this location
:-(


[ snip lots of places php was found ]

You could also try $ which php
If that doesn't return anything then either a) php isn't in your path or
b) you don't have it installed as a binary, only a module.


Last login: Sat Jul 5 13:09:23 2003 from deurne.ox.be
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD 4.4-RELEASE (SERVER) #0: Wed Aug 28 19:41:18 GMT 2002
%which php
php: Command not found.
%

bad luck? Other options for my problem?
Jul 16 '05 #6
"Lukas" <Lu***@verwijde rdit.be> wrote in
news:3f******** *************@r eader0.news.sky net.be:

"Joshua Ghiloni" <jd***@SPAM.ME. AND.DIE.cwru.ed u> schreef in bericht
news:be******** **@eeyore.INS.c wru.edu...
[snip]

Last login: Sat Jul 5 13:09:23 2003 from deurne.ox.be
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
The Regents of the University of California. All rights
reserved.
FreeBSD 4.4-RELEASE (SERVER) #0: Wed Aug 28 19:41:18 GMT 2002
%which php
php: Command not found.
%


That should be

where php
try that...

Ken Robinson
Jul 16 '05 #7
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Whilst lounging around on Sun, 06 Jul 2003 10:56:24 GMT, Ken Robinson
<se**********@r bnsn.com> amazingly managed to produce the following
with their Etch-A-Sketch:
%which php
php: Command not found.
%


That should be

where php
try that...

Ken Robinson

[tk@morris:~]$ where php
bash: where: command not found

[tk@morris:~]$ which php
[tk@morris:~]$

Are you sure?

I get no results from 'which' as PHP isn't installed as a binary, but
results are still better than 'where' as shown by:
[tk@morris:~]$ which perl
/usr/bin/perl


Regards,

Ian

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0

iQA/AwUBPwhVOGfqtj2 51CDhEQJI6wCgwC yOhsa8pnEx23kWB 51iVVDrjGsAoMwK
Dy7bnzitBBaTMIu JHx4euzm+
=Kv3M
-----END PGP SIGNATURE-----

--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.ne t | forum.digiserv. net
Programming, Web design, development & hosting.
Jul 16 '05 #8
"Ian.H [dS]" <ia*@WINDOZEdig iserv.net> wrote in
news:08******** *************** *********@4ax.c om:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Whilst lounging around on Sun, 06 Jul 2003 10:56:24 GMT, Ken Robinson
<se**********@r bnsn.com> amazingly managed to produce the following
with their Etch-A-Sketch:
> %which php
> php: Command not found.
> %


That should be

where php
try that...

Ken Robinson

[tk@morris:~]$ where php
bash: where: command not found

[tk@morris:~]$ which php
[tk@morris:~]$

Sorry,

It should be

whereis php

Here's the output from a Linux box:

bash-2.05$ whereis php
php: /usr/bin/php /usr/lib/php /usr/local/bin/php /usr/local/lib/php
/usr/local/lib/php.ini /usr/include/php

Ken
Jul 16 '05 #9

"Ken Robinson" <se**********@r bnsn.com> schreef in bericht
news:445d876745 776d519e9831619 c601b98@TeraNew s...
"Ian.H [dS]" <ia*@WINDOZEdig iserv.net> wrote in
news:08******** *************** *********@4ax.c om:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Whilst lounging around on Sun, 06 Jul 2003 10:56:24 GMT, Ken Robinson
<se**********@r bnsn.com> amazingly managed to produce the following
with their Etch-A-Sketch:
> %which php
> php: Command not found.
> %

That should be

where php
try that...

Ken Robinson

[tk@morris:~]$ where php
bash: where: command not found

[tk@morris:~]$ which php
[tk@morris:~]$

Sorry,

It should be

whereis php

Here's the output from a Linux box:

bash-2.05$ whereis php
php: /usr/bin/php /usr/lib/php /usr/local/bin/php /usr/local/lib/php
/usr/local/lib/php.ini /usr/include/php


I get /usr/ports/lang/php
when I mail to this alias I get:
############### ############### ############### #######
----- The following addresses had permanent fatal errors -----
"|/usr/ports/lang/php /www/htdocs/php/do.php"
(reason: 126)
(expanded from: <ph*@oxcamp.com >)

----- Transcript of session follows -----
/usr/ports/lang/php: permission denied
554 5.3.0 unknown mailer error 126
############### ############### ############### #######
Does this mean that the mail user does not have permission to read
/usr/ports/lang/php
or that it doesn't have permission to read/write in the /www/htdocs/php/
dir?

Thanks
Jul 16 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1673
by: Mathieu Maes | last post by:
Hello all, I'm working on a professional invoice webapplication. I'm working on means to automate the invoice generation. Therefor I created a class which creates invoices using given XML-data. This is what the server can do... Now I'm looking for solutions to allow clients with external servers (like websites) to send XML data to the...
0
7729
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7637
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7950
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7702
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6332
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5523
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3684
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1238
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.