Technical & Scientific > Programming

Redirecting 'headless'

(1/2) > >>

ober:
So this is sort of related to my other topic on mail parsing.  Here's my situation:


1) I have a PSR compliant app that I wrote using Slim as the router
2) I have this requirement to catch incoming mail
3) I setup the subdomain for the emails which points to a specific file that catches the email and does some basic processing (basically grabbing the message and writing it to disk for now)
4) I want to forward that caught action to the app because I want to run the remaining aspects of the processing in the context of the application where I have a bunch of routines for logging audits and adding details from the message to the interface.  If I don't, I have to recreate a bunch of processing.  Obviously that request isn't coming from a browser and it doesn't appear that a php 'header()' redirect is working. 


Is there a way to that mail catch functionality go to a URL instead of a single file or is there a way to forward the mail catch functionality into my app?  Is this even making sense?

KnuckleBuckett:
Wait a couple minutes.  It'll come to you.

ober:
Hahahhaa

Mike:
What are you using to catch the mail?  And what are you using to forward the request?  And what are your restrictions (e.g. can you change the SMTP program?)

ober:
I created a subdomain and I'm just using a catch-all mechanism in Cpanel to say 'send all mail to this subdomain to this php file'.  According to the docs, I have to use a local path which removes my ability to just point that to a URL that my app would normally process.  I had tried the other night to take the mail message and write it to a text file and then redirect using header() to a path in my actual application where I would read that file off the disk and process it.  But it never gets into the application.  It's like it ignores the header call.

I'm not really using an SMTP program.  Emails come into the server and I just grab the stream from stdin and drop it to a file.  I guess one way to do it would be to dump all the emails to an inbox and then read from the inbox but that would still be via cron job which also points to a file, not an application path.

I feel like I'm thinking about this the wrong way or something.

Navigation

[0] Message Index

[#] Next page

Go to full version