exclude root's mail

Chris Hill chris at monochrome.org
Wed Apr 12 23:16:36 UTC 2006


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 at yourdomain.com. My 
virtusertable looks something like this (names changed):

chris at mydomain.com    chris
abuse at 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 at monochrome.org
**                     [ Busy Expunging <|> ]


More information about the freebsd-questions mailing list