1753796 Members
7054 Online
108799 Solutions
New Discussion

Re: Blocking mail

 
Geoff Wild
Honored Contributor

Re: Blocking mail

Ah yes - that is right - should be OK not allow...for:

you@yourdomain.com OK

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Christopher Caldwell
Honored Contributor

Re: Blocking mail

Hooks for the To address can be accessed via virtusertable
and
virtuser_entire_domain
rulesets.

On the relay host, define each user in virtusertable:

you@yourdomain.com !
me@yourdomain.com error:nouser No Such User
@yourdomain.com error:nouser No Such User

If the first entry appears as a To: address, the mail will be passed through the sendmail relay untouched (forwarded).

Mail to the second entry will be rejected outright before delivery (no cost of handling or queueing).

The third entry rejects all mail not explicitly referenced by an ealier entry (it's a terminating entry). Use that entry to keep spam "exploration" to a minimum on the relay server.

User the virtuser-domain database to tell sendmail to apply virtusertable on the relay server. The entry would read as follows:

yourdomain.com


To make this work, be familiar with generating new sendmail.cf files. Instructions can be found in /usr/contrib/sendmail/usr/newconfig/etc/mail/cf.

The technique assumes sendmail 8.10 or greater.