views:

36

answers:

4

Hi, I'm getting single emails, for each undelivered address that mail() send couldn't reach. Since this can be a painfull process, to keep copy pasting every single address, I'm wondering if it's possible to access a LOG or something ?

Some notes: - I've got this app running on a GoDaddy server (I know it sucks);

Thanks for your atention ;D

A: 

I'm wondering if it's possible to access a LOG or something ?

Maybe - it depends on what the MTA (mail transport agent) is, how it's configured and whether you have the permissions to access the file.

I've got this app running on a GoDaddy server

Then the above are all questions for your GoDaddy provider.

The MTA log should record details of messages which the MTA failed to offload elsewhere but the elsewhere may be a smart relay (i.e. still on the sending side) - in which case you'd need to look at the relay MTA's logs to see if it managed to pass the message on to one of the recipient MXs. Even if the message got as far as a recipient MX, you don't know that it was successfully delivered. By convention, the receiving system should send back a DSN if it fails (and you can specifically ask for a DSN regardless of outcome) but a lot of systems don't implement this properly.

Regardless it may provide information about some messages which fail - you'd need to poll the return mailbox to identify failures.

C.

symcbean
Thanks a lot for your knowledge people
A: 

If mail() fails immediately, it returns false and you went get any e-mail. However, if a problem arises after the mail has been sent but before it has been received, you get an e-mail.

The mail() function will send the e-mail to some mailserver, which will send it to another, until it reaches its destination. When the user does not exist, this is only discovered at the destination mail server and it responds with an e-mail, called a bounce.

There is no way to group these bounce e-mails, as the destination mail servers do not know that they came from the same script.

Sjoerd
Thanks a lot for your knowledge people
A: 

There is no log as such, because feedback from the receiving mail server is not immediate. There's only the "undeliverable" messages that get returned to you.

However, it should be possible to specify a reply-to or errors-to address pointing to a separate mailbox. That would make it easier to find out which recipient addresses failed.

That is the best way I can think of to group failed messages.

Pekka
A: 

Another option you have is to pipe the incoming emails to a PHP script and process it that way. How this is accomplished depends on the server setup you have and whether your server is set up to use sendmail or exim.

A good tutorial on this is located here.

Joseph