|
Posted by Craig Hurley on 10/14/07 20:54
Hello,
user@x.com receives an email from user@a.com. I want to forward that
email to user@y.com. I want the contents/header to remain intact, with
the exception of adding "X-Forwarded-For". In other words, when
user@y.com received the email, it will be from user@a.com, but will
contain a reference that it was forwarded by user@x.com.
I'm piping all email destined for user@x.com to a php script. I've seen
some very complicated examples of using the mail function and I'm unsure
how to use the mail function to do what I need. I'm relatively new to
php so any advice is appreciated.
Thank you,
Craig.
#!/usr/local/bin/php -q
<?php
// get email from stdin
$fd = fopen("php://stdin", "r");
$email = "";
while (!feof($fd)) {
$email .= fread($fd, 1024);
}
fclose($fd);
// forward it to user@y.com
// ???
?>
Navigation:
[Reply to this message]
|