First crack at incoming project parsing
This commit is contained in:
parent
9f511fecac
commit
5d31b1aa1b
@ -34,7 +34,7 @@ while (!feof($fd)) {
|
||||
//if this line is the "delivered-to", extract the subaddress, if there is one.
|
||||
if(preg_match("/^delivered-to: (.*)/i", $line, $matches)) {
|
||||
$deliveredTo = $matches[1];
|
||||
if(preg_match("/tickets\+(\S*)@/i", $deliveredTo, $matches)) {
|
||||
if(preg_match("/support\+(\S*)@/i", $deliveredTo, $matches)) {
|
||||
$project = $matches[1];
|
||||
}
|
||||
}
|
||||
@ -46,7 +46,7 @@ while (!feof($fd)) {
|
||||
|
||||
//Alter the Subject if this is a test.
|
||||
$subjectAlterTo = substr($deliveredTo, 1, 12);
|
||||
if(substr($deliveredTo, 1, 12) == 'tickets-test' &&
|
||||
if(substr($deliveredTo, 1, 12) == 'support-test' &&
|
||||
preg_match("/^Subject:(.*)/i", $line)) {
|
||||
$line = $subject = str_replace('Subject: ', 'Subject: [TEST] ', $line);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user