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:

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

System copy error in RUN ABAP REPORT PHASE
Hi,
I am performing system copy on my test server. I have previously taken export of JAVA + A

Sending UDP Raw socket
I truly need help on this. I am trying to write a test program that simulate a network environment

Attempt to assign property of non-object in...
I'm having issues with the following function in PHP 5...

function getTreeWithChildre

Need help adding a timestamp to my filename/variable
Hello,

I'm kind of stupid when it comes to php and I need a tiny bit of help. I've got a f

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

Renaming a file that a user uploads to site?
My site allows for registered users to upload images to the site under their own gallery. Currently

Multiple submit forms inside a mysql array page
Hi all,

Im having trouble to get the beneath script to work the thing i can't seem to get wor

TemplatePower & AJAX
Hi all,



I'm currently implementing some AJAX features in my PHP-framework (which is b

Blank record injected into database
I always found several blank records inside my database, although $SESSION is required to insert the

Help adding strtolower( to my in_array
strtolower i need to add it to this to work, iuno how.

Code: $moderators = array('Admin', 'ba

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