Qmail allow email from my own domain (particular domain) only

by nixcraft on July 14, 2006 · 2 comments

Q. How do I allow receiving email from my own domain only? I am using Qmail mail server software under Fedora Core Linux.

A. You can change the behavior of the qmail system by modifying qmail's control files. This is essential as you do not want to become a source of open mail relay. By default qmail will not relay. However every persons need is different. You can force qmail to accept domain listed rcphosts file only.

Open file /var/qmail/control/rcpthosts

# vi /var/qmail/control/rcpthosts

And append your domain name to accept email. Here is my sample file from my own box:

nixcraft.com
cyberciti.org
cyberciti.biz
theos.in
gite.in

Save the file. And restart qmail.

From the qmail man page, "Allowed RCPT domains. If rcpthosts is supplied, qmail-smtpd will reject any envelope recipient address with a domain not listed in rcpthosts. Exception: If the environment variable RELAYCLIENT is set, qmail-smtpd will ignore rcpthosts, and will append the value of RELAYCLIENT to each incoming recipient address. rcpthosts may include wildcards:
.nixcraft.com

Envelope recipient addresses without @ signs are always allowed through."

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 2 comments… read them below or add one }

1 Sunil March 16, 2007

How do I allow receiving email from my own domain to particular user only? I am using Qmail mail server software under Fedora Core Linux.

Reply

2 kuyaninja August 18, 2008

my domain is abc.com and now my domain is zxc.com how do i change qmail default domain..? [qmail in 1 server]

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 3 + 6 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.



Previous post:

Next post: