Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP - IMAP - CRON - ALIAS (wow!)

Status
Not open for further replies.

Sleidia

Technical User
May 4, 2001
1,284
FR
Hello,

Here is a very difficult question (at least for me :)

If someone sends an email to me while, on my server, a CRON job is running a PHP script that is editing the file that contains the messages for my account, in that case, will the incoming mail be bounced or generate an error message to the face of the sender?

Also, I've planned to use an Alias in order to run a script upon arrival of messages in a chosen mailbox (myemail@example.com,"|/our/script.php"). But if I receive plenty of mails into this account during a very short period of time, will each action from the PHP script be cleanly started one by one, or all at the same time?

Thank you for posting your opinion.

 
Describe your environment in greater detail.
______________________________________________________________________
TANSTAAFL!
 
To those who want to know a possible answer, here is a reply I got from some expert:

--------------->
If you are running a cron that edits the mailbox itself the email could very well be bounced back. You would want to have your cron either make a copy of the mailbox or create a lock on the mailbox and then run its changes to the file. After the changes are done then you would want it to append the copy to the original. This is somewhat how the server works when you check your email. The server creates a copy and sends the copy to the mail client any email received during that time is spooled in the mqueue and then appended to the mailbox after the popper request is closed.

With the alias file executing a script, the script would open a new process each time an email is received. Depending on how long the script runs would determine how many processes are running at the same time when new email is received. Please let me know if you have any questions.
<-------------

It will help someone I guess.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top