473,800 Members | 2,726 Online
Bytes | Software Development & Data Engineering Community
+ 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 1607
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.comwrot e:
>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.u k/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.comwro te, 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.comwrot e, 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_e m...@REMOVETHIS BITbizorg.co.uk wrote, 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*******@attgl obal.net
=============== ===

Jan 3 '08 #10

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

Similar topics

2
3324
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. Issue#1: I get 2 copies of the form that gets submitted each time. Issue#2: The header does not display the "FROM" information in Outlook, but I can see the From information in my email spam filter
4
4344
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 etc..Html tags like <h1></h1>, <br/>, <b> etc works though.. Could any one tell me what i might be doing wrong? Any help will be greatly appreciated.
6
2836
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 domain names have been removed in everything below.) SYNOPSIS: I have 2 target servers, at https://A.com and https://B.com. I have 2 clients, wget and my python script.
12
1621
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 various flavours to cause the equipment to turn signals on and off, and change voltages and such like. Attached to this external equipment, is another piece of equipment that responds to these changes in signals and voltages.
2
2321
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 content in the blue bar? - Only options are Minimize, Maximize or Close (top right of blue bar) 1 - What is the difference in 'OpenWindow' and 'Spawn' ?? 2 - Can anyone point me to a simple script I can use... or just post one...
6
1828
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 like '_' sometimes get stored as =5F, and some email clients seem to add in =0D encoded characters. I store the text in an Mysql database, and depending on the message
7
5246
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 other half just don't work at all. Nothing shows up at all. How can I debug this? What are possible causes? Thanks,
2
1839
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 info and optionally can upload images, the user receives and email receipt of all the data they just submitted, and i'm suppose to receive their information in my email. what still works is that the user will receive their receipt and the images...
1
47492
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 on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
0
9691
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
9551
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10507
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...
0
10279
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10255
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,...
1
7582
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
6815
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5607
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4150
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

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.