#! /usr/local/bin/php * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *** * * $Id: helodnscheck.php,v 1.1 2004/07/05 18:27:21 pavcio Exp $ * */ error_reporting(0); if ($_ENV['NOHELODNSCHECK'] !== NULL || /* plugin disabled */ !$_ENV['SMTPHELOHOST'] || /* no HELO host */ $_ENV['SMTPHELOHOST'] == 'unknown') exit(); /* HELO with no argument */ /* check DNS record */ $dnsrec = dns_get_record($_ENV['SMTPHELOHOST'], DNS_A); /* TODO: use PEAR */ if (!is_array($dnsrec) || count($dnsrec) ) exit(); /* query failed or domain exists */ fwrite(STDERR, "non existing HELO greeting domain: $_ENV[SMTPHELOHOST]\n"); exit("E559 sorry, your HELO/EHLO greeting must resolve (#5.7.1)\n"); ?>