From owner-freebsd-questions@FreeBSD.ORG Wed Apr 12 23:16:36 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9A4B616A400 for ; Wed, 12 Apr 2006 23:16:36 +0000 (UTC) (envelope-from chris@monochrome.org) Received: from mail.monochrome.org (b4.ebbed1.client.atlantech.net [209.190.235.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0791143D62 for ; Wed, 12 Apr 2006 23:16:35 +0000 (GMT) (envelope-from chris@monochrome.org) Received: from tripel (tripel [192.168.1.11]) by mail.monochrome.org (8.13.4/8.13.4) with ESMTP id k3CNGd2U099975; Wed, 12 Apr 2006 19:16:39 -0400 (EDT) (envelope-from chris@monochrome.org) Date: Wed, 12 Apr 2006 19:18:01 -0400 (EDT) From: Chris Hill To: Robin Becker In-Reply-To: <443D17EB.500@chamonix.reportlab.co.uk> Message-ID: <20060412185913.E39688@tripel.monochrome.org> References: <443D17EB.500@chamonix.reportlab.co.uk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-questions@freebsd.org Subject: Re: exclude root's mail 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: Wed, 12 Apr 2006 23:16:36 -0000 On Wed, 12 Apr 2006, Robin Becker wrote: > For some reason my FreeBSD 6.0 server's root account has started to receive > spam. Is there a simple way to restrict all mail for root to come from a > specified local domain eg 192.168.0.0/8? I'm a naive sendmail person so > please be gentle :) I ran into something similar recently. Since you son't say, I'll assume you're running sendmail (if not please disregard the following). What I had to do was create the file /etc/mail/virtusertable. The idea is to list users you _do_ want to accept mail for and exclude anything else, thus rejecting mail sent to randomstring@yourdomain.com. My virtusertable looks something like this (names changed): chris@mydomain.com chris abuse@mydomain.com chris @mydomain.com error:nouser No such user here With this setup, mail to users chris and abuse get sent to me. Mail to any other username gets rejected with "No such user here". [ I got the hint about that key last line from http://www.freebsddiary.org/virtualmail.php ] Once you have edited virtusertable, you must do a 'make' in the directory /etc/mail, then '/etc/rc.d/sendmail restart'. All as root, of course. Should be OK after that. HTH. -- Chris Hill chris@monochrome.org ** [ Busy Expunging <|> ]