Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to accept only administrative mail to a domain? 1

Status
Not open for further replies.
Apr 27, 2006
9
CA
I'm wish to configure a sendmail server to be both mail relay for internal hosts, and a partially functional internet-facing MX. Internal users need to send mail to the external work, but I'd like to block any mail coming into the domain, except for adminstrative mail, such as bounces.

The relaying to the external world is the easy part, but I'm a little unsure of how I can refuse (explicitly) mail coming into the domain while still accepting bounce notifications, etc.

Can anyone assist?
 
All mail related messages will go to postmaster which is aliased to root. Use the virtusertable to create a virtual user for the domain such as admin@domain.com and the recipient would be the admin. For example, let's say joe is the admin. Add a line something like this to /etc/mail/virtusertable:

admin@domain.com joe

If joe wants his mail to go to an outside mailbox use that instead of his username.

admin@domain.com joe@otherdomain.com

Now to create the database, issue this command:

makemap hash /etc/mail/virtusertable.db < /etc/mail/virtusertable

If any mail comes in and it doesn't match any user in the table, it gets rejected.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top