Using the Access Database in sendmail

After building the database, you also need to let sendmail know that you have an access database, and you want to use it. Use the access_db feature to do that.

Assume that you're using the configuration that was created in Chapter 5.We created two customized files: a DOMAIN file specifically for the foobirds.org domain and a linux.mc file to include the custom DOMAIN file in the sendmail configuration. Because the access database is specific to our server, let's add the necessary feature to the foobirds.m4 DOMAIN file, as shown in Listing 11.6.

Listing 11.6: Adding the Access Database to the Configuration divert(0)

VERSIONID("foobirds.m4 03/16/2002')

define("confFORWARD_PATH', ~$z/.forward.$w+$h:$z/.forward+$h:$z/ A.forward.$w:$z/.forward')dnl define("confMAX_HEADERS_LENGTH', ~32768')dnl

FEATURE("access_db', "hash -o /etc/mail/access')

FEATURE("redirect')dnl

FEATURE("use_cw_file')dnl

EXPOSED_USER("root')

MASQUERADE_AS(foobirds.org)

FEATURE(masquerade_envelope)

FEATURE(genericstable)

This is the same foobirds.m4 file described in Chapter 5, with one addition. The first FEATURE listed in this file invokes the access database and describes where it is located. As described in Chapter 5, the foobirds.m4 macro file is referenced in the macro control file linux.mc. Process the control file with the m4 command to produce a sendmail.cf file that uses the new database:

After you create and install the new sendmail.cf file with m4, your new access database is in force and is blocking spammers. If you need even more control over the process, you can define your own anti-spam sendmail rewrite rules.

Was this article helpful?

0 0

Post a comment