Reject per Recipient

The FEATURE(access_db) (The access Database on page 277) provides a way to selectively reject envelope-sender addresses. By declaring this FEATURE(blacklist_recipients), you enable the access database to also selectively reject envelope-recipient addresses:

FEATURE(`blacklist_recipients')

Consider the need to prevent outsiders from posting to strictly inside mailing lists. In this example, the mailing lists are handled on a machine different from that on which outside mail is received. On the receiving machine, you would put lines such as these in your access database:

board@our.domain               550 Outside access to private mailing list banned
accounting@our.domain          550 Outside access to private mailing list banned
401k-help@our.domain           550 Outside access to private mailing list banned

By declaring this FEATURE(blacklist_recipients), these addresses will be prevented from receiving outside mail.

All forms of addresses in the access database can be used for this recipient rejection. Consider:

To:badguy@           ERROR:550 Mailbox disabled for this user
To:host.our.domain   ERROR:550 This machine bans email
To:123.45.67.89      ERROR:550 Printers cannot receive email

Be careful when rejecting recipients based on the username alone, as in the first line in this example, because the username is rejected for both the envelope sender and the envelope recipient. Thus, this line will reject mail to both badguy locally, and from badguy at all other sites in the world.

Get sendmail, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.