We require a Email Piping script to process emails. This should not be complicated for experienced coders as there is already a good base of sample code out there and this is not a new concept.
A hosted website with Cpanel allows the administrator to specify account level email filtering, and one option is to pipe all emails to a program.
Below is the pseudo code. Variables are to be used wherever indicated or [login to view URL] Piping Script Pseudo Code
// Pseudo Code Notation
//
// $NAME = a variable containing data
//
// Pseudo code starts here
READ email // usually email sent from stdin
// GLOBAL FIXED VALUES
$Email_eval = email address of evaluator
$Email_responder = email address of responder
$Email_manual = email address of manual
$Email_other_responder1 = email address of other responder1
$Email_other_responder2 = email address of other responder2
$Email_other_responder3 = email address of other responder3
$Email_main = email address of company main
$cc = cc email address
$bcc = bcc email address
$Employee_email1 = email address of employee 1
$Employee_code1 = user code of employee 1 , 6 alphanumeric values
$Employee_email2 = email address of employee 2
$Employee_code2 = user code of employee 2 , 6 alphanumeric values
$Employee_email3 = email address of employee 3
$Employee_code3 = user code of employee 3 , 6 alphanumeric values
// Parse all the header values
$from = sender of email;
$to = recipients of email
$cc = cc recipients of email
$no_rec = number of recipients
$to1 = recipient 1 // parsed from header
$to2 = recipient 2 // parsed
$to3 = recipient 3 // parsed etc …
$subject = email subject;
$headers =;
$message = body of message;
//===========================================================
// email from employees
If $from = $Employee_email1 // or case statement
Then {
append $Employee_code1 to end of $subject
IF $subject contains MANUAL
$to = $Email_manual
$cc = $Email_main
ELSE $to = $Email_eval
$from = $Email_main
$cc = $Email_main
Rewrite email with new values // a common function/subroutine using the variables
SEND email with attachments // all other original header, body
// and attachments are left intact.
End Then // $from = Employee_email1
ELSE If $from = $Employee_email2
Then {
append $Employee_code2 to end of $subject
IF $subject contains MANUAL
$to = $Email_eval
ELSE $to = $Email_manual
$from = $Email_main
$cc = $Email_main
Rewrite email with new values // a common function/subroutine using the variables
SEND email with attachments // all other original header, body
// and attachments are left intact.
End Then // $from = Employee_email2
ELSE If $from = $Employee_email3
Then {
append $Employee_code3 to end of $subject
IF $subject contains MANUAL
$to = $Email_eval
ELSE $to = $Email_manual
$from = $Email_main
$cc = $Email_main
Rewrite email with new values // a common function/subroutine using the variables
SEND email with attachments // all other original header, body
// and attachments are left intact.
End Then // $from = Employee_email3
END IF
//====================================================================
// email from email responder
If $from = $Email_responder or $Email_manual
IF $subject contains $Employee_code1
Then {
$to = $Employee_email1
$cc = $Email_main
$from = $Email_main
Rewrite email with new values // a common function/subroutine using the variables
SEND email with attachments // all other original header, body
// and attachments are left intact.
End Then // Employee_code1
IF $subject contains $Employee_code2
Then {
$to = $Employee_email2
$cc = $Email_main
$from = $Email_main
Rewrite email with new values // a common function/subroutine using the variables
SEND email with attachments // all other original header, body
// and attachements are left intact.
End Then // Employee_code2
IF $subject contains $Employee_code3
Then {
$to = $Employee_email3
$cc = $Email_main
$from = $Email_main
Rewrite email with new values // a common function/subroutine using the variables
SEND email with attachments // all other original header, body
// and attachements are left intact.
End Then // Employee_code3
END IF // $from = $Email_responder or $Email_manual