OK I’m not great with PHP but I’m learning so stay with me here.
I have an email address that all email received is piped to a php script which then stores the headers message subject etc in a database.
This works Fine but what I need to do is search the header for the senders server IP and then put that into a variable.
From originalguy@someplace.com Sun Dec 12 02:37:01 2010
Received: from mail-pz0-f52.google.com ([**209.85.210.52**])
by some.server.com with esmtp (Exim 4.69) (envelope-from <razz222au@gmail.com>)
id 1PRRVJ-00020U-1p for someguy@someplace.com;
Use regular expressions.
i.e.