1. Introduction

When a Mail Transfer Agent (MTA) receives a message, it undertakes a sequence of steps to decide the fate of that particular message: whether to deliver it locally, to relay it to some other site, to reject or bounce it, or to take some other action. When taking its decision, MTA examines a set of data sources which hold such data as lists of local and relayed domains, tables of system accounts, etc. These data sources may be of various nature. For example, domain tables can be stored on disk as plaintext files or as DBM files; they can also be retrieved from LDAP or from some database management system. To provide a uniform access to such a variety of data sources, MTA usually implement some intermediate layer. Sendmail(1) and MeTA1(2) call this layer a map.

Among various types of maps implemented by these MTAs, there is one which merits special attention. It is socket map, also called sockmap, for short. This map is not associated with any particular data storage. When the MTA looks up for a key in a sockmap, the latter sends the request over TCP/IP to a preconfigured address, waits for a reply from there and hands it back to the MTA. It is supposed, of course, that some server is listening on this address.

Sockmaps provide an incredibly effective way of extending the functionality of MTAs. For example, one may use them to configure one's Sendmail to keep all data in an SQL database or in any other database, not directly supported by the MTA.

So far sockmaps have been given undeservedly little attention. Perhaps, this is due to lack of suitable free software servers that could be queried using them.

Smap aims to fill this gap. Its main component is smapd – a modular server which handles sockmap requests. Instead of handling each request itself, smapd relies on loadable modules to provide the requested functionality. In other words, smapd is responsible for handling socket map protocol, and for dispatching queries to appropriate modules. The module itself is responsible for looking up the requested key and returning the result.

Second important part of the package is a set of loadable modules for smapd. These modules cover several important database management systems and make it possible to easily configure servers for retrieving data from them.

Furthermore, the package provides a framework for writing new modules for smapd. New modules may be written either in C or in Guile.

And finally, Smap contains a client program, smapc, which may be used to query arbitrary socket servers from the command line. Among other possible uses, smapc is a valuable tool for testing your socket servers.

The main audience of Smap are administrators of Sendmail or MeTA1 mail transport agents, as well as those who use Mailfromd(3), a flexible general-purpose mail filter.

Footnotes

(1)

See http://www.sendmail.org.

(2)

See http://www.meta1.org.

(3)

See mailfromd.software.gnu.org.ua.