From owner-freebsd-questions@FreeBSD.ORG Fri Feb 15 16:49:34 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C7D216A421 for ; Fri, 15 Feb 2008 16:49:34 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirg.bris.ac.uk (dirg.bris.ac.uk [137.222.10.102]) by mx1.freebsd.org (Postfix) with ESMTP id 3F3A213C4D1 for ; Fri, 15 Feb 2008 16:49:34 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from isis.bris.ac.uk ([137.222.10.63]) by dirg.bris.ac.uk with esmtp (Exim 4.67) (envelope-from ) id 1JQ3kh-0003RX-5X; Fri, 15 Feb 2008 16:49:33 +0000 Received: from mech-aslap33.men.bris.ac.uk ([137.222.184.33]) by isis.bris.ac.uk with esmtp (Exim 4.67) (envelope-from ) id 1JQ3kg-0004jM-CO; Fri, 15 Feb 2008 16:49:30 +0000 Received: from mech-aslap33.men.bris.ac.uk (localhost [127.0.0.1]) by mech-aslap33.men.bris.ac.uk (8.14.2/8.14.2) with ESMTP id m1FGnBJu045700; Fri, 15 Feb 2008 16:49:11 GMT (envelope-from mexas@bristol.ac.uk) Received: (from mexas@localhost) by mech-aslap33.men.bris.ac.uk (8.14.2/8.14.2/Submit) id m1FGnBhR045699; Fri, 15 Feb 2008 16:49:11 GMT (envelope-from mexas@bristol.ac.uk) X-Authentication-Warning: mech-aslap33.men.bris.ac.uk: mexas set sender to mexas@bristol.ac.uk using -f Date: Fri, 15 Feb 2008 16:49:11 +0000 From: Anton Shterenlikht To: Bill Moran Message-ID: <20080215164911.GA45654@mech-aslap33.men.bris.ac.uk> Mail-Followup-To: Bill Moran , freebsd-questions@freebsd.org References: <20080215162713.GA45570@mech-aslap33.men.bris.ac.uk> <20080215113334.71e3380e.wmoran@potentialtech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080215113334.71e3380e.wmoran@potentialtech.com> User-Agent: Mutt/1.4.2.3i X-Spam-Score: -1.4 X-Spam-Level: - Cc: freebsd-questions@freebsd.org Subject: SOLVED: Re: mailq takes 25 sec to respond X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Feb 2008 16:49:34 -0000 On Fri, Feb 15, 2008 at 11:33:34AM -0500, Bill Moran wrote: > In response to Anton Shterenlikht : > > > On my ds10l alpha sendmail seem to work fine with the exception > > of very long wait time for mailq (sendmail -bp) - about 25 sec. > > > > I'm not convinced it is an alpha problem, so I post to this list. > > > > On a much slower i386 running the same version of OS and of sendmail > > it takes less than a second. > > > > # uname -srm > > FreeBSD 6.3-STABLE alpha > > > > # sendmail -d0.1 > > Version 8.14.2 > > Compiled with: DNSMAP LOG MAP_REGEX MATCHGECOS MILTER MIME7TO8 MIME8TO7 > > NAMED_BIND NETINET NETINET6 NETUNIX NEWDB NIS PIPELINING SCANF > > TCPWRAPPERS USERDB XDEBUG > > > > The only software difference between my i386 and my alpha I can think of > > is that on alpha I run IPF: > > > > # grep "= 25" /etc/ipf.rules > > pass out on dc0 proto tcp from any to any port = 25 flags S/SA keep state > > Based on your description of the probem, you should ensure that all > block rules in ipf include logging, and see if running mailq is triggering > a timeout because it can't communicate over the network. 25 sec is > suspiciously close to 30 seconds, which is a common timeout value for > network operations. > > sendmail needs to communicate on more ports than just 25, so it's > likely that you've blocked something else that it needs ... DNS perhaps? I solved it first reading http://www.goldfisch.at/knowledge/70 : "If sendmail takes very long time for starting and output of mailq takes many seconds, than you might have a name-resolve-problem. Check logfiles for gethostbyaddr ... failed - entries and fix corresponding resolve-problem." which is what I did: % grep gethostbyaddr /var/log/maillog Feb 15 03:01:23 sendmail[71810]: gethostbyaddr(10.10.10.1) failed: 2 Feb 15 03:01:58 sendmail[71856]: gethostbyaddr(10.10.10.1) failed: 2 Feb 15 03:02:40 sendmail[72061]: gethostbyaddr(10.10.10.1) failed: 2 % I then found why I get this error, from http://www.sunhelp.org/faq/sendmail.html "QUESTION: Why does my Solaris machine generate the error "sendmail: gethostbyaddr failed" whenever I send mail? ANSWER: One of more of the IP addresses configured on your system does not have a matching entry in /etc/hosts. sendmail does a "reverse" lookup (input IP address, output hostname) when it starts up, generating the error. You can either fix /etc/host and your Nameservice, or ignore the message." Although I had an entry for the second ethernet port (10.10.10.1) in /etc/rc.conf, I didn't have it in /etc/hosts. I fixed /etc/hosts and all is fine now. many thanks anton -- Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 928 8233 Fax: +44 (0)117 929 4423