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

atypic mail filtering with access db

Status
Not open for further replies.

Gillus

Technical User
Apr 14, 2003
1
FR
Hi,

How can I setup a sendmail to only relay mails sent to some recipients, and block any other mail ? I have a
list of "trusted" recipients, allowed to received mail ;
all other recipients (inside and outside my intranet)
should not receive any mail at all.

I tried to use the access.db mecanism :

trusted1@domain.org RELAY
trusted2@domain.org RELAY

I also tried :

to:trusted1@domain.org RELAY
to:trusted2@domain.org RELAY

it doesn't work in both cases ; seems that the default
behaviour is to *not* block mail. if wildcards could be
used, I would do something like :

to:trusted1@domain.org RELAY
to:trusted2@domain.org RELAY
* REJECT (or "ALL REJECT")

I guess wildcards cannot be used in access file. Does anybody know how to do such filtering with access file
(or any other way) ?

Any help is welcome :)
 
Couple of things that could help you,
first if those emails are local users (I.E. if someone@domain.org is actually user someone on that box) then you will need to have blacklist_recipient enabled (FEATURE(`blacklist_recipients') in your .mc file).
the second is depending on the version you have sendmail has been denying relay by default for some time now and rejects relaying by default but doesn't not block incoming to valid domains(duh :))
the lines you show are correct the standard is as follows:

user@aol.com REJECT
spamer@somewhere.org 550 "GO away you spammer"
somedomain.com RELAY
user@ RELAY
mydomain.com RELAY

those are all valid.
One last thing you should look at is make sure that you makemap (or make all depending on what you have on your box) the access file like so:
makemap hash access < access (check your sendmail.cf to see if you are using hash or btree)

hopep that helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top