Pipe email to PHP - get mail adress from MySQL - send?


Posted on 16th Feb 2014 07:03 pm by admin

Hi all,

this is the challenge:

Did you know?Explore Trending and Topic pages for more stories like this.
1) Our faculty at the college where I'm employed includes quite a bit of freelancers that don't check the college mailbox quite as often as the administration would like.
2) I have created forwarders in the form firstname.lastname@ourcollege.com, forwarded to their private mailboxes. That has worked fine up until now.
3) Lately we implemented Moodle as a course platform. As Moodle relies on a MySQL backend, this gave me the idea that something much more flexible would be possible.


I would need a php script that

1) grabs the email piped from cPanel,

2) extracts the email address 'just before', that is, the part in the header that indicates where it were piped from (is that possible? - I'm talking about the last part in a rather complex group mail forwarding sceme, just before the pipe = (ie staff@ourcollege.com->teachers@ourcollege.com->firstname.lastname@ourcollege.com),

3) queries the MySQL database by this field (official_email) and brings back another related field (private_email),

4) forwards the original email to that private e-mail address.

This would give us the opportunity to have our "forwarders -> real mail adresses' list constantly up-to-date, as all the freelancers could keep their records up to date all by themselves through the moodle user front-end interface.

This is, however, beyond me. I know the basics of piping from cPanel, and some rudimental PHP and MySQL, but that's it. Any help would be most appreciated.
No comments posted yet

Your Answer:

Login to answer
103 Like 30 Dislike
Previous forums Next forums
Other forums

reading xml faster than DB call?
I am trying to optimize a high traffic website, and I enabled a feature where there are three photos

Using the $_GET variable to view certain records
Hello,

First let me explain my problem, I have 2 pages the first page pull a list of Guide ti

Login Script Issues
I am using a script I got from http://phpsense.com/php/php-login-script.html in order to allow peopl

Auto fill in input value based on User_ID
Hello,

I'm looking form some input on the following problem.

User loads page ->

Checking if variable is 0 as opposed to NULL/Empty...
I'm trying to write some code that will retrieve a user's access level from my database and if it do

Remove values in array2 from array1
I have two arrays.

Array 1 is where the array key holds various different numbers. For exampl

A href problem under php
Hello...

I tried to explain the issue in an earlier post.. but was not clear enough....

Display certain image depending on time of year
Hi, I am new to these forums and would really appreciate some advice on a piece of coding I have don

Polymorphism
Was wondering if someone could explain this a little better to me. I had always assumed that it had

problem getting my contact form working
Yeah I know this is a pretty basic problem, but it's been a while since I've worked with PHP and I'm

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash