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!

access database

Status
Not open for further replies.

warrenliang

IS-IT--Management
May 3, 2004
117
US
Morning,

I have question about sendmail configuration and how it determines which /etc/mail/access.* database to use.

File sendmail.mc:
divert(-1)
#
divert(0)dnl
VERSIONID(`$Id: generic-solaris.mc,v 8.13 2001/06/27 21:46:30 gshapiro Exp $')
OSTYPE(solaris2)dnl
DOMAIN(mydomain)dnl
define('confHOST_STATUS_DIRECTORY', '/etc/mail/statistics')dnl
define(`DATABASE_MAP_TYPE', `dbm')dnl
define(`confTO_HELO', `5m')dnl
define(`confTO_IDENT', `0s')dnl
define(`confDONT_BLAME_SENDMAIL')dnl
define(`QUEUE_DIR', `/var/spool/mqueue')dnl
QUEUE_GROUP(`regular', `')dnl
QUEUE_GROUP(`slowq', `P=/var/spool/mqueue/slowq', I=30m)dnl
FEATURE(`nouucp', `reject')
FEATURE(`redirect')
FEATURE(`mailertable')
FEATURE(`access_db', `dbm -T<TMPF> /etc/mail/access')
FEATURE(`blacklist_recipients')
FEATURE(`queuegroup')dnl
MAILER(local)dnl
MAILER(smtp)dnl
INPUT_MAIL_FILTER(`mimedefang', `S=unix:/var/spool/MIMEDefang/mimedefang.sock, T=S:5m;R:5m;E:5m')

In /etc/mail/access file, I enter an entry to disable a recipiant:

To:Jsmith@mydomain.com REJECT

Then issue command $makemap hash /etc/mail/access < /etc/mail/access
#

Send an email from Internet to Jsmith@mydomain.com, the recipient still accepts email…

On the /etc/mail directory, there are several access.* files:
-rw-r--r-- 1 root other 4007 Jun 14 08:43 access
-rw-r--r-- 1 root other 40960 Jun 14 08:44 access.db
-rw-r----- 1 root other 4096 Apr 5 12:59 access.dir
-rw-r----- 1 root other 5120 Apr 5 12:59 access.pag

It looks like sendmail does not pick up access.db, and uses access.pag instead. Is it possible?

Thanks in advance,

Sendmail: V8.12.10
O/S: Solaris 8
Patch level: 117000-03

Warren L.
 
You don't need the "To:" drop that and you'll be OK.

Cogito Ergo Sum - Non Compos Mentis
 
Also your syntax to hash the access file should look like this
makemap hash /etc/mail/access.db < /etc/mail/access



Cogito Ergo Sum - Non Compos Mentis
 
This way sendmail is configured, it is looking for /etc/mail/access.dir and acces.pag files instead. I do not know why. By reviewing at sendmail.mc entry:

FEATURE(`access_db’, `dbm –T<TMPF> /etc/mail/access’)

and the way how access database is built:
# makemap dbm /etc/mail/access < /etc/mail/access

Also, in the /etc/mail/access file, regardless the leading “To:”, the restriction works.

Another finding: it seems like my sendmail is compiled without hash enabled. I got error message back during ./Build sendmail when using FEATURE(`access_db’, `hash –T<TMPF> /etc/meil/access’).

Any good documentation available for sendmail+access database? Thanks in advance,
Warren L.
 
You don't define the access file in the sendmail.mc you define the access database. Sendmail doesn't care about the flat file, it only queries the access.db .... querying a db is much more efficient and faster than querying a text/flat file. Check your mc and replace /etc/mail/access with /etc/mail/access.db ...... see below.
FEATURE(`access_db',`hash -T<TMPF> -o /etc/mail/access.db')dnl


Cogito Ergo Sum - Non Compos Mentis
 
The way email reads /etc/mail/access.dir and access.dig is because we have such entry "define('DATABASE_MAP_TYPE', `dbm')" defined. sendmail uses UNIX type databse.

Waren L.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top