Hey,

If you have a catch-all pipe set up for @domain.com for all emails to go to a PHP script, what is the trusted method of detecting which address the email was sent to?

For example, generally the "To:" header does contain "user1@domain.com" - however, problems occur when "user1@domain.com" is in the BCC field.

Additionally, "Envelope-To:" does not always provide you the email. Is there a setting that can be configured for the email client to add a header with the email address this specific email was meant for?

The other reason its crucial to have this is because additionally a To: could have 5 recipients, however the PHP script will be dealing with 5 separate emails.

What general practice do people use?

Thanks!

James

    99.9% of people would set the catch all to :fail: No Such User Here as spammers guess random email addresses for a domain, i got 3000 spam on one domain in less than a day when i antecedently forwarded them to me.

    do you really want to do this?

      Yes, I do, because I plan to enable [username]@domain.com - any emails to the script which do not come from a certain "from" address that also do not contain a certain [username] (these are in thousands), will not be let through so I have zero worries about spam issues. This is the key reason why I need access to the routing email address for these emails given the To: header is unreliable for this.

      Best,

        Write a Reply...