Question

I'm tring to handle errors from bounced email. This is my scenario:

  • Send emails out with Pear Mail() +Mail_Mime();
  • Set 'Return-Path'and 'Return-Recipient-To' to get errors in "bounces@domain-name.com";

Now using a class mentioned here (How to handle mail delivery errors with PHP) I want to read the mail folder containing the delivery error messages.

The path is like "/home/domain-name/mail/domain-name.com/bounce/new/" but when i run the class i get the error "failed to open dir: Permission denied..."

Dir /mail/ is 770 chmod, /domain-name/ is 750 chmod, /bounce/ is 750 chmod, /new/ is 700 chmod. Think i should change permission, but dont know how and if this could make less secure the mail folder.

Was it helpful?

Solution

I would guess that your webserver is running as apache or nobody which is not the owner of the mail folder (so it would therefore have 0 as the permission - which is nothing)

You either need to run the webserver as that user (I wouldnt do that) or change the permission on the folder to allow the webserver to read the folder

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top