From: John Chajecki on
I'm trying to configure sendmail on Debian. The distribution has version
8.14.3 installed. I downloaded the source for this version and unpacked it
to /usr/src. I've then gone into the sendmail directory and within this to
cf/cf. I've create adapted the startup script and .mc file from a running
instance we have elsewhere.

The problem is that this sendmail does not seem to create a PID file so I
have a problem with stopping sendmail by running './S88sendmail stop'.

On further examination I find that this sendmail does not seem to create a
PIF file. I've tried specifying it in the .mc file like this:

define(`confPID_file', `/var/run/sendmail.pid')dnl

However when I build the sendmail.cf file this does not seem to get
applied:

# grep -i pid sendmail.cf
# default UID (can be username or userid:groupid)
# location of pid file
#O PidFile=/var/run/sendmail.pid
# define(`confPID_file', `/var/run/sendmail.pid')dnl
#

If I un-comment the line O PidFile=... then sendmail generates a PID file as
expected. I would however prefer to get this compiled in rather then having
to edit the CF file manually after it has been generated.

Here is the complete .mc file:

divert(-1)

# Sendmail configuration file for Millcorner


divert(0)dnl
VERSIONID(`@(#)millcorner 21/04/2010')
OSTYPE(`linux')dnl
DOMAIN(`generic')dnl
FEATURE(`nouucp', `reject')dnl
FEATURE(access_db)dnl
FEATURE(`mailertable')dnl
FEATURE(blacklist_recipients)dnl
FEATURE(`dnsbl', `sbl.spamhaus.org', `Spam blocked by Spamhaus')dnl
FEATURE(`accept_unresolvable_domains')dnl
FEATURE(local_lmtp)dnl
FEATURE(`no_default_msa')dnl
FEATURE(`authinfo')dnl
DAEMON_OPTIONS(`Name=MTA, Port=smtp')dnl
define(`confPID_file', `/var/run/sendmail.pid')dnl
define(`LOCAL_MAILER_FLAGS', LOCAL_MAILER_FLAGS`'P)dnl
define(`confCW_FILE', `-o /etc/mail/local-host-names')dnl
define(`confCACERT_PATH', `/etc/mail/certs/')dnl
define(`confCACERT', `/etc/mail/certs/cacert.pem')dnl
define(`confSERVER_CERT', `/etc/mail/certs/cert.pem')dnl
define(`confSERVER_KEY', `/etc/mail/certs/key.pem')dnl
define(`confCLIENT_CERT', `/etc/mail/certs/cert.pem')dnl
define(`confCLIENT_KEY', `/etc/mail/certs/key.pem')dnl
define(`confSMTP_LOGIN_MSG', `Millcorner')dnl
define(`confPRIVACY_FLAGS', `authwarnings,noexpn,novrfy,noverb')dnl
define(`confAUTH_OPTIONS', `A y')dnl
define(`confAUTH_MECHANISMS', `LOGIN PLAIN')dnl
TRUST_AUTH_MECH(`LOGIN PLAIN')dnl
MAILER(`local')dnl
MAILER(`smtp')dnl

Note, I intend to remove 'accept_unresolvable_domains and do some further
work on TRUST_AUTH_MECH but I would like to get this up and running properly
first.

From: John Chajecki on
Ok, just realised what the problem was.

The variable 'confPID_file' should have been 'confPID_FILE'. Once I had
amended 'file' to uppercase and compiled I got the desired result:

# default UID (can be username or userid:groupid)
# location of pid file
O PidFile=/var/run/sendmail.pid
# define(`confPID_FILE', `/var/run/sendmail.pid')dnl

Starting sendmail with the -bd option now does create a PID file as
expected.

From: John Chajecki on
It seems I'm talking to myself here!

Nevertheless, I will post the solution just in case someone else comes
across this problem on Debian Linux.

It seems that on Debian, sendmail is hacked to run something called
sensible-mda rather than mail.local. This executable determines which local
mailer to use depending on what MTA is installed. When building my own .mc
file I had to add the following to match the configuration of the originally
supplied sendmail.cf file.:

FEATURE(local_lmtp)dnl
define(`LOCAL_MAILER_PATH', `/usr/sbin/sensible-mda')dnl
define(`LOCAL_MAILER_FLAGS', `lsDFMAw5:/|@qPn9S')dnl
define(`LOCAL_MAILER_ARGS', `sensible-mda $g $u $h ${client_addr}')dnl

When complied and run, sendmail now delivers locally as expected without
permission errors.