Mailing List Archive

Using Exim to "forward" certain messages to a PHP script?
This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
Hi guys

I don't know if this is possible at all, but can you tell me if/how I
can set up Exim to check predefined email addresses and in case someone
sends an email, then forward (part of it) to a PHP script.

What I need is to set up some kind of autoresponder, where people can
send a blank email to a given email address and then will be added to a
mailing list with their name and email address.

I hope this makes sense ?

Thank you in advance

Jesper
--
Re: Using Exim to "forward" certain messages to a PHP script? [ In reply to ]
--
On Thu, Jul 11, 2002 at 02:03:33PM +0200, Jesper Lindhardt wrote:

| I don't know if this is possible at all, but can you tell me if/how I
| can set up Exim to check predefined email addresses and in case someone
| sends an email, then forward (part of it) to a PHP script.

Put an alias in /etc/aliases that looks like

the_local_part: "|/usr/bin/php /usr/local/script/foo.php"

| What I need is to set up some kind of autoresponder, where people can
| send a blank email to a given email address and then will be added to a
| mailing list with their name and email address.
|
| I hope this makes sense ?

Have you investigated Mailman or other existing MLMs? Given the
complexity of such a tool, I expect that using an existing
implementation will be easier and more robust than creating your own.

HTH,
-D

--

The Consultant's Curse:
When the customer has beaten upon you long enough, give him
what he asks for, instead of what he needs. This is very strong
medicine, and is normally only required once.

http://dman.ddts.net/~dman/

--
[ Content of type application/pgp-signature deleted ]
--
RE: Re: Using Exim to "forward" certain messages to a PHP script? [ In reply to ]
Hi Derrick

Thank you for writing back to me.

If I use /etc/aliases to forward emails, how will it pass it to the PHP
files? (how can I get to the email in the php file?) Also, will it work
with virtual domains?

I looked at Mailman and some similar programs, but from what I could
tell they are actual mailing list managers. I'm not sure I would be able
to use them just to handle emails and pass the information on the a PHP
script.

Thank you,

Jesper

-----Original Message-----
From: exim-users-admin@exim.org [mailto:exim-users-admin@exim.org] On
Behalf Of Derrick 'dman' Hudson
Sent: Thursday, July 11, 2002 7:26 PM
To: exim-users@exim.org
Subject: [Exim] Re: Using Exim to "forward" certain messages to a PHP
script?

--
On Thu, Jul 11, 2002 at 02:03:33PM +0200, Jesper Lindhardt wrote:

| I don't know if this is possible at all, but can you tell me if/how I
| can set up Exim to check predefined email addresses and in case
someone
| sends an email, then forward (part of it) to a PHP script.

Put an alias in /etc/aliases that looks like

the_local_part: "|/usr/bin/php /usr/local/script/foo.php"

| What I need is to set up some kind of autoresponder, where people can
| send a blank email to a given email address and then will be added to
a
| mailing list with their name and email address.
|
| I hope this makes sense ?

Have you investigated Mailman or other existing MLMs? Given the
complexity of such a tool, I expect that using an existing
implementation will be easier and more robust than creating your own.

HTH,
-D

--

The Consultant's Curse:
When the customer has beaten upon you long enough, give him
what he asks for, instead of what he needs. This is very strong
medicine, and is normally only required once.

http://dman.ddts.net/~dman/

--
[ Content of type application/pgp-signature deleted ]
--

--

## List details at http://www.exim.org/mailman/listinfo/exim-users Exim
details at http://www.exim.org/ ##
Re: Using Exim to "forward" certain messages to a PHP script? [ In reply to ]
--
On Thu, Jul 11, 2002 at 08:52:36PM +0200, Jesper Lindhardt wrote:
| Hi Derrick
|
| Thank you for writing back to me.

You're welcome.

| If I use /etc/aliases to forward emails, how will it pass it to the PHP
| files? (how can I get to the email in the php file?)

Are you familiar with UNIX pipes? If not then I don't recommend that
you try to craft an mail bot.

| Also, will it work with virtual domains?

If you write the handler properly.

| I looked at Mailman and some similar programs, but from what I could
| tell they are actual mailing list managers. I'm not sure I would be able
| to use them just to handle emails and pass the information on the a PHP
| script.

Why would you need the php script? In your original message you said
that the php script would serve the purpose of
1) accepting subscription requests
2) providing double-optin verification to prevent abuse of your list
3) managing maililng list subscriptions

This is what mailman (and others) do. By choosing mailman, you change
your job from "write a program to do X" to "configure existing (well
tested, too) program Y to do X".

Configuring an existing program is (almost always) easier and less
error prone than writing your own.

Email isn't the most straightforward data format to handle, even
though it seems that way on the surface.

HTH,
-D

--
A wise servant will rule over a disgraceful son,
and will share the inheritance as one of the brothers.
Proverbs 17:2

http://dman.ddts.net/~dman/
--
[ Content of type application/pgp-signature deleted ]
--