'SM_CONF_SHM'' ''''


Use shared memory (V8.12 and above) port with confENVDEF

Beginning with V8.12, sendmail includes limited support for the use of shared memory. Shared memory is a region of memory maintained by the operating system so that an arbitrary number of programs can have common access to that memory.

The sendmail program forks a copy of itself every time it processes a queue. Because V8.9 and above sendmail supports multiple queues, it is likely that a separate sendmail invocation will be processing each queue. Each queue processor knows the contents of each queuespecifically, the number of messages that are in its queue at any given time. A convenient place to store that information is in shared memory.

When you run V8.12 and above sendmail with the -bP command-line switch (Section 11.6.2), sendmail reads shared memory to gather a count of the number of messages in each queue.

Shared memory is turned on by default for some operating systems and off for others. If you run sendmail with the -bP command-line switch and get the following error, you might need to define this SM_CONF_SHM compile-time macro:

Data unavailable without shared memory support

If you need to enable shared memory, you can do so by placing a line such as the following in your Build m4 file:

APPENDDEF(`conf_sendmail_ENVDEF', `-DSM_CONF_SHM=1 ')
                       to turn on shared memory support

Note that just turning on SM_CONF_SHM is not enough. To actually use that shared memory you also need to set a value for the SharedMemoryKey option. To set this option in your configuration file, you could add a line such as the following to your mc configuration file:


Note that if you run multiple queue-processing daemons, each should be executed with a unique shared-memory key. One way to do that might look like the following two entries in an rc boot file:

/usr/bin/sendmail -q1h -OQueueDir=/var/spool/slowq -OSharedMemoryKey=11111
/usr/bin/sendmail -q5m -OQueueDir=/var/spool/fastq -OSharedMemoryKey=22222

To see if this compile-time macro is defined with your sendmail binary, use the -d0.12 debugging command-line switch.

    Part I: Build and Install
    Chapter 2. Build and Install sendmail
    Chapter 4. Configure sendmail.cf with m4
    Part II: Administration
    Part III: The Configuration File