I have a mail server who doesn't support ETRN command, I've made this script for anyone
I ran it every hout with CronJob.
Code: Select all
<?
$domain = "deathrocknet.org";
?>
<?php
$fp = fsockopen("mail.rollernet.us", 2525, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "ETRN $domain \n";
fwrite($fp, $out);
echo "<BR>";
echo fgets($fp, 1024);
$out = "QUIT \n";
fwrite($fp, $out);
echo "<BR>";
echo fgets($fp, 1024);
$out = "\n";
fwrite($fp, $out);
echo "<BR>";
echo fgets($fp, 1024);
fclose($fp);
}
?>
<BR>
<?php
$fp = fsockopen("mail2.rollernet.us", 2525, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "ETRN $domain \n";
fwrite($fp, $out);
echo "<BR>";
echo fgets($fp, 1024);
$out = "QUIT \n";
fwrite($fp, $out);
echo "<BR>";
echo fgets($fp, 1024);
$out = "\n";
fwrite($fp, $out);
echo "<BR>";
echo fgets($fp, 1024);
fclose($fp);
}
?>