Re: [PHP] PHP and connection to mail account

2006-12-15 Thread Richard Lynch
If you want to go the route of inbound mail being processed as it
arrives, "man smrsh" made it simple enough for even me to figure out.

On Wed, December 13, 2006 8:17 am, Angelo Zanetti wrote:
> Dear All.
>
> Do u know if its possible with PHP to receive a mail or connect to a
> mail box and do something with an incomming email ? I see there is
> that
> imap_open() but also there are sockets.
>
> Basically I need to connect to a mailbox and then when a mail is
> received it must take that mail and do something with the attachment
> which I know how to do and is not important to this question.
>
> Please maybe advise as to what the best way is and also if you have
> experienced difficulties with a certain way.
>
> Thanks in advance.
>
> --
> 
> Angelo Zanetti
> Systems developer
> 
>
> *Telephone:* +27 (021) 469 1052
> *Mobile:*   +27 (0) 72 441 3355
> *Fax:*+27 (0) 86 681 5885
> *
> Web:* http://www.zlogic.co.za
> *E-Mail:* [EMAIL PROTECTED] 
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP and connection to mail account

2006-12-13 Thread Jochem Maas
Stut wrote:
> Jochem Maas wrote:
>> Angelo Zanetti wrote:
>>  
>>> Do u know if its possible with PHP to receive a mail or connect to a
>>> mail box and do something with an incomming email ? I see there is that
>>> imap_open() but also there are sockets.
>>> 
>>
>> indeed - basically use whatever you want! - I would suggest have a
>> search online,
>> there are quite a lot of mailbox related classes/libs/etc as well as
>> fully featured
>> php webmail packages that you might be able to scrounge some useful
>> code out of.
>>
>> an alternative could be to configure your mail server to pipe the
>> incoming
>> email directly to your script (i.e. don't deliver it to a mailbox at
>> all) -
>> this has the advantage that your script doesn't have to run as a
>> daemon (or via cron)
>> in order to poll the given mailbox - it simply recieves the email on
>> stdin
>> whenever an email arrives.
> 
> Just to add something to consider... which way you do it can depend on
> what your script will be doing and how many emails you expect to
> receive. If the script is intensive and/or you are expecting a lot of
> emails you're better off cron'ing a script to deal with them otherwise
> your server could end up bogged down by those processes. I can't speak
> for other MTAs but I do know that with Postfix you can apply a limit to
> the number of simultaneous processes that are started if you implement
> it in the transport map.

good point!

> 
> -Stut
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP and connection to mail account

2006-12-13 Thread Stut

Jochem Maas wrote:

Angelo Zanetti wrote:
  

Do u know if its possible with PHP to receive a mail or connect to a
mail box and do something with an incomming email ? I see there is that
imap_open() but also there are sockets.



indeed - basically use whatever you want! - I would suggest have a search 
online,
there are quite a lot of mailbox related classes/libs/etc as well as fully 
featured
php webmail packages that you might be able to scrounge some useful code out of.

an alternative could be to configure your mail server to pipe the incoming
email directly to your script (i.e. don't deliver it to a mailbox at all) -
this has the advantage that your script doesn't have to run as a daemon (or via 
cron)
in order to poll the given mailbox - it simply recieves the email on stdin
whenever an email arrives.


Just to add something to consider... which way you do it can depend on 
what your script will be doing and how many emails you expect to 
receive. If the script is intensive and/or you are expecting a lot of 
emails you're better off cron'ing a script to deal with them otherwise 
your server could end up bogged down by those processes. I can't speak 
for other MTAs but I do know that with Postfix you can apply a limit to 
the number of simultaneous processes that are started if you implement 
it in the transport map.


-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP and connection to mail account

2006-12-13 Thread Jochem Maas
Angelo Zanetti wrote:
> Dear All.
> 
> Do u know if its possible with PHP to receive a mail or connect to a
> mail box and do something with an incomming email ? I see there is that
> imap_open() but also there are sockets.

indeed - basically use whatever you want! - I would suggest have a search 
online,
there are quite a lot of mailbox related classes/libs/etc as well as fully 
featured
php webmail packages that you might be able to scrounge some useful code out of.

an alternative could be to configure your mail server to pipe the incoming
email directly to your script (i.e. don't deliver it to a mailbox at all) -
this has the advantage that your script doesn't have to run as a daemon (or via 
cron)
in order to poll the given mailbox - it simply recieves the email on stdin
whenever an email arrives.

> 
> Basically I need to connect to a mailbox and then when a mail is
> received it must take that mail and do something with the attachment
> which I know how to do and is not important to this question.
> 
> Please maybe advise as to what the best way is and also if you have
> experienced difficulties with a certain way.
> 
> Thanks in advance.
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP and connection to mail account

2006-12-13 Thread Aras


Forward the e-mail address to a PHP file, through forwarders in your system
(depends on the mta, how and where)
Than design a php file to read from php://stdin
It will read the mails once they are received.

--Aras

-Original Message-
From: Angelo Zanetti [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 13, 2006 4:18 PM
To: PHP List
Subject: [PHP] PHP and connection to mail account


Dear All.

Do u know if its possible with PHP to receive a mail or connect to a
mail box and do something with an incomming email ? I see there is that
imap_open() but also there are sockets.

Basically I need to connect to a mailbox and then when a mail is
received it must take that mail and do something with the attachment
which I know how to do and is not important to this question.

Please maybe advise as to what the best way is and also if you have
experienced difficulties with a certain way.

Thanks in advance.

--

Angelo Zanetti
Systems developer


*Telephone:* +27 (021) 469 1052
*Mobile:*   +27 (0) 72 441 3355
*Fax:*+27 (0) 86 681 5885
*
Web:* http://www.zlogic.co.za
*E-Mail:* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP and connection to mail account

2006-12-13 Thread Angelo Zanetti

Dear All.

Do u know if its possible with PHP to receive a mail or connect to a 
mail box and do something with an incomming email ? I see there is that 
imap_open() but also there are sockets.


Basically I need to connect to a mailbox and then when a mail is 
received it must take that mail and do something with the attachment 
which I know how to do and is not important to this question.


Please maybe advise as to what the best way is and also if you have 
experienced difficulties with a certain way.


Thanks in advance.

--

Angelo Zanetti
Systems developer


*Telephone:* +27 (021) 469 1052
*Mobile:*   +27 (0) 72 441 3355
*Fax:*+27 (0) 86 681 5885
*
Web:* http://www.zlogic.co.za
*E-Mail:* [EMAIL PROTECTED] 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php