From owner-freebsd-questions Sun May 31 10:56:00 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA21197 for freebsd-questions-outgoing; Sun, 31 May 1998 10:56:00 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from dt050n33.san.rr.com (@dt053nd2.san.rr.com [204.210.34.210]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA21071 for ; Sun, 31 May 1998 10:55:31 -0700 (PDT) (envelope-from Studded@san.rr.com) Received: from san.rr.com (Studded@localhost [127.0.0.1]) by dt050n33.san.rr.com (8.8.8/8.8.8) with ESMTP id KAA11945; Sun, 31 May 1998 10:55:21 -0700 (PDT) (envelope-from Studded@san.rr.com) Message-ID: <35719989.A1F48A75@san.rr.com> Date: Sun, 31 May 1998 10:55:21 -0700 From: Studded Organization: Triborough Bridge & Tunnel Authority X-Mailer: Mozilla 4.05 [en] (X11; I; FreeBSD 2.2.6-STABLE-0507 i386) MIME-Version: 1.0 To: leifn@internet.dk CC: questions@FreeBSD.ORG Subject: Re: perl, MX lookup References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Leif Neland wrote: > > In a perlscript, I can use gethostbyname to check if a given host exists. > > But how can I check if there exists a MX-record for a given host? > I probably could system("host -t MX $host"), but I'd rather have a > "native" perl solution. > > (I want to check in a script if an email-adress contains a valid hostpart) Keep in mind that the abscence of an MX record doesn't make a hostname an invalid delivery address. The default (which is quite servicable in most cases) is to attempt delivery to the A address. That said, I believe that one of the perl modules in the ports collection will help you with what you want, probably the DNS module. Good luck, Doug -- *** Chief Operations Officer, DALnet IRC network *** *** Proud designer and maintainer of one of the world's largest *** Internet Relay Chat servers with 5,328 simultaneous connections *** Try spider.dal.net on ports 6662-4 (Powered by FreeBSD) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message