473,473 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Script that receives email message and responds depending on content

The subject line is a little too general. I would like you to tell me
about scripts that can receive email messages and call other scripts
depending on the content of these messages.

Thanks!
Jan 2 '08 #1
10 1580
Bill Bell wrote:
The subject line is a little too general. I would like you to tell me
about scripts that can receive email messages and call other scripts
depending on the content of these messages.

Thanks!
I have implemented such a thing as a daemon that periodically parses a
mailbox on the local server and does various things with the content of
the messages (processing meta tags inside the message, archiving
attachments to NAS, etc). Let me first say that while it is entirely
possible to do this in PHP, it is probably not the best choice (my
opinion, of course).

If you're more specific about what you are trying to do, you'll probably
get better answers. For example, can your script sit on the same
machine as the mail server, or do you need to use IMAP to retrieve the
messages (which is far more complicated)? Will the process be initiated
manually, or periodically, or will it always be running? What sort of
things do you intend to do with the information in the messages?

Jeremy
Jan 2 '08 #2
On Wed, 02 Jan 2008 23:07:28 +0100, Jeremy <je****@pinacol.comwrote:
Bill Bell wrote:
>The subject line is a little too general. I would like you to tell me
about scripts that can receive email messages and call other scripts
depending on the content of these messages.
Thanks!

I have implemented such a thing as a daemon that periodically parses a
mailbox on the local server and does various things with the content of
the messages (processing meta tags inside the message, archiving
attachments to NAS, etc). Let me first say that while it is entirely
possible to do this in PHP, it is probably not the best choice (my
opinion, of course).

If you're more specific about what you are trying to do, you'll probably
get better answers. For example, can your script sit on the same
machine as the mail server, or do you need to use IMAP to retrieve the
messages (which is far more complicated)? Will the process be initiated
manually, or periodically, or will it always be running? What sort of
things do you intend to do with the information in the messages?
There are perl scripts that I know of (mainly in trouble ticket systems)
that ARE the application that recieves the mail, instead of a cronjob
inbox poller. Requires some more access to the server then just some
shared hosting though.
--
Rik Wasmus
Jan 2 '08 #3
On Jan 2, 4:56 pm, Bill Bell <Bell....@gmail.comwrote:
The subject line is a little too general. I would like you to tell me
about scripts that can receive email messages and call other scripts
depending on the content of these messages.

Thanks!
Install Procmail
Configure .procmailrc to pipe incoming mail to a script which parses
the content
you are looking for and take appropriate actions (such as calling
other scripts,
updating a database, etc.)

I use perl to do it, although I imagine you could use php as well.

faulkes
Jan 2 '08 #4
On Wed, 2 Jan 2008 15:52:21 -0800 (PST), faulkes
<mi*************@gmail.comwrote:
>I use perl to do it, although I imagine you could use php as well.
PHP works fine but, on our LAMP setup at least, you need to run PHP as
a CGI I think.
#!/opt/php5/bin/php
as the first line of your script.

Then I read in the Email like this:
$fd = fopen("php://stdin", "r");
$email = "";
while (!feof($fd)) {
$email .= fread($fd, 1024);
}
fclose($fd);

and process.
--
Locate your Mobile phone: <http://www.bizorg.co.uk/news.html>
Great gifts: <http://www.ThisBritain.com/ASOS_popup.html>
Jan 3 '08 #5
On Jan 2, 5:07 pm, Jeremy <jer...@pinacol.comwrote, in part:
I have implemented such a thing as a daemon that periodically parses a
mailbox on the local server and ...
Thanks for this, Jeremy. It hadn't occurred to me to use the fact that
there would be just one receiving mailbox that I could get at.
If you're more specific about what you are trying to do, you'll probably
get better answers. For example, can your script sit on the same
machine as the mail server, or do you need to use IMAP to retrieve the
messages (which is far more complicated)? Will the process be initiated
manually, or periodically, or will it always be running? What sort of
things do you intend to do with the information in the messages?
Some years ago I built a PHP site for a local group of employment
counselling agencies. They are not adept at using computer interfaces,
and my efforts to improve this site's interface have not proven
adequate. So I want to take a different tack.

What happens with the current interface is that users fail to identify
themselves by selecting from a drop-down list. I want to replace the
current system with one in which individuals email messages intended
for everyone to a distinct address on the site's domain. (In this way
they are obliged to identify themselves as individuals, and I can work
out authentication once I get over the current hurdle.) When software
running on the server that hosts this mailbox notices the presence of
a message it is to obtain the contents of the message and the sender's
email address, and arrange to send the message to all of the agencies
using the sender's address.

Bill
Jan 3 '08 #6
On Jan 2, 6:09 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote, in
part:
There are perl scripts that I know of (mainly in trouble ticket systems)
that ARE the application that recieves the mail, instead of a cronjob
inbox poller. Requires some more access to the server then just some
shared hosting though.
--
Rik Wasmus

Thanks, Rik. Although I work in Python I used to be able to read and
write Perl. Would you happen to have the URL for a sample, please?

Bill
Jan 3 '08 #7
On Jan 2, 6:52 pm, faulkes <michael.behr...@gmail.comwrote, in part:
Install Procmail
Configure .procmailrc to pipe incoming mail to a script which parses
the content
you are looking for and take appropriate actions (such as calling
other scripts,
updating a database, etc.)
Thanks, Michael. I'll take a look at procmail.

Bill

Jan 3 '08 #8
On Jan 3, 2:42 am, David Quinton
<usenet_2005D_em...@REMOVETHISBITbizorg.co.ukwrote , in part:
PHP works fine but, on our LAMP setup at least, you need to run PHP as
a CGI I think.
Thanks, David. I'm not sure I can run PHP as a CGI. However, I will
bear this in mind.

Bill
Jan 3 '08 #9
Bill Bell wrote:
On Jan 2, 5:07 pm, Jeremy <jer...@pinacol.comwrote, in part:
>I have implemented such a thing as a daemon that periodically parses a
mailbox on the local server and ...

Thanks for this, Jeremy. It hadn't occurred to me to use the fact that
there would be just one receiving mailbox that I could get at.
>If you're more specific about what you are trying to do, you'll probably
get better answers. For example, can your script sit on the same
machine as the mail server, or do you need to use IMAP to retrieve the
messages (which is far more complicated)? Will the process be initiated
manually, or periodically, or will it always be running? What sort of
things do you intend to do with the information in the messages?

Some years ago I built a PHP site for a local group of employment
counselling agencies. They are not adept at using computer interfaces,
and my efforts to improve this site's interface have not proven
adequate. So I want to take a different tack.

What happens with the current interface is that users fail to identify
themselves by selecting from a drop-down list. I want to replace the
current system with one in which individuals email messages intended
for everyone to a distinct address on the site's domain. (In this way
they are obliged to identify themselves as individuals, and I can work
out authentication once I get over the current hurdle.) When software
running on the server that hosts this mailbox notices the presence of
a message it is to obtain the contents of the message and the sender's
email address, and arrange to send the message to all of the agencies
using the sender's address.

Bill
Bill,

Actually, I would think this would be better done in the MTA. Every one
I know of has the ability to have email lists. Why reinvent the wheel?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jan 3 '08 #10
On Jan 3, 1:16 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Actually, I would think this would be better done in the MTA. Every one
I know of has the ability to have email lists. Why reinvent the wheel?
The answer to that question in my case, Jerry, is that I didn't know
much about wheels. ;-)

I'll think about this idea for sure.

Bill
Jan 3 '08 #11

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

Similar topics

2
by: Web Master | last post by:
Hi, I am having a little issue with Jacks Form mail php script. I have installed it and configured the form to get it to work, but for some bizarre reason I have 2 issues I can't seem to debug....
4
by: Ann | last post by:
Hi, I am trying to send a html email from a php script. This script emails a common information to all the members in the database. The only problem is I cannot specify colors, hyperlinks...
6
by: Paul Winkler | last post by:
This is driving me up the wall... any help would be MUCH appreciated. I have a module that I've whittled down into a 65-line script in an attempt to isolate the cause of the problem. (Real...
12
by: Charles Law | last post by:
This is a bit of a vague question, but I am just starting on this, and wonder if anyone has ideas of where to start. I have a program that controls some external equipment. It sends messages in...
2
by: tmb | last post by:
- Want to open a 2nd browser window when someone clinks a link with the link content inside it. - Want to control window size - Want all tool bars so only blue bar at top shows - Can I put my...
6
by: chris_fieldhouse | last post by:
Hi, I have a script for processing emails, The script finds email sent to a particular alias, grabs the body text of the email and stores it into a database. Problem is that certain character...
7
by: AmitKu | last post by:
I'm trying to use RegisterStartupScript. I am making a call to it in Page_Load...and nothing shows up. Well that not's entirely true. Half the pages I've put it on do work properly, but the...
2
chunk1978
by: chunk1978 | last post by:
i wrote a custom PHP script last year and everything worked perfectly... recently my webserver upgraded to PHP 5 and now my script doesn't work properly. what the script does is: users fill out...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
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...
0
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,...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...

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.