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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stop delivery to individual hosts in domain

Status
Not open for further replies.

PilotMike

Programmer
Jul 14, 2003
31
US
Hello all.

I'd like to stop incomign email that contains a specific hostname, and I've not yet come across the way to do it in sendmail.

For example, if my domain is xyz.com, I want to reject any mail that has a hostname in it:

GOOD: postmaster@xyz.com

BAD: someone@ anybody@gw.xyz.com, fred@temper.xyz.com

In other words, just email to %@xyz.com would be accepted.

Which directives and/or settings in the /etc/mail files would I need to make?

Thanks!
 
How would you tell if it was a host name? There are legitimate email addresses with more than 2 sections ,
for instance "ci.us.gov
 
This is true, however there has to be a way to identify which hostnames are *valid* versus *invalid* as far as mail delivery goes.

Here's what I found..

I configured sendmail to relay mail for *individual hosts* only (thanks to Sendmail Cookbook, recipe 3.7).

I did this by configuring the relay_hosts_only feature, FEATURE(`relay_hosts_only'), then creating a relay_domains file with just the domain names I wished to accept mail for. They are in this instance interpreted as *hostnames*...

relay_domains file contents:
domain.org
domain.biz

Now, email sent to "user@ or "user@ftp.domain.biz", for example, are reject since relaying isn't specified for those "hostnames". Mail to just "user@domain.org" or "user@domain.biz" is accepted.

This solved the problem and it works great now.

Thanks for contributing the question, stfaprc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top