473,908 Members | 7,236 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 3846
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
1683
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 API. Here I'm stuck...
0
10031
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11337
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
11042
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10536
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8094
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6134
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4770
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3355
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.