Resolving “sensible-mda not found” Errors in Ubuntu Sendmail Configuration


1 views

When Sendmail starts complaining about missing sensible-mda in Ubuntu logs, it usually indicates one of two scenarios:

  • A recent package update changed Mail Delivery Agent (MDA) configuration defaults
  • The system is attempting to use a local delivery mechanism when none is properly configured
# Typical error pattern in mail.log
sm-mta[12345]: Warning: program /usr/sbin/sensible-mda unsafe: No such file or directory
sm-mta[12345]: SYSERR(root): Cannot exec /usr/sbin/sensible-mda

Ubuntu's sendmail-bin package expects certain helper scripts that aren't always installed:

# Check what sendmail-related packages are installed
dpkg -l | grep -E 'sendmail|sensible'

The sensible-mda script traditionally comes from the sensible-utils package, but Ubuntu's Sendmail integration may require additional components.

For systems only needing local delivery (no authentication), we have several options:

# Option 1: Install missing utilities
sudo apt-get install sensible-utils sendmail-bin

# Option 2: Configure alternative MDA in sendmail.mc
FEATURE(local_procmail',/usr/bin/procmail')dnl
# Then regenerate sendmail.cf
sudo make -C /etc/mail

The most common triggers include:

  • Package updates that modify default configurations
  • Changes to mail routing tables
  • New applications attempting local mail delivery
  • Security updates changing permissions
# Check recent package changes that might have affected mail
grep 'install\|remove' /var/log/dpkg.log | tail -20

For systems just handling web form submissions and system logs:

# Minimal /etc/mail/sendmail.mc
divert(-1)dnl
include(/usr/share/sendmail-cf/m4/cf.m4')dnl
define(confDOMAIN_NAME', yourdomain.com')dnl
FEATURE(nocanonify')dnl
FEATURE(no_default_msa')dnl
DAEMON_OPTIONS(Family=inet, Name=MTA-v4, Port=smtp')dnl
MAILER(local')dnl
MAILER(smtp')dnl

These log entries indicate your sendmail installation is trying to execute /usr/sbin/sensible-mda as a Mail Delivery Agent (MDA), but the file doesn't exist. This typically happens when:

  • Ubuntu's sendmail-bin package is installed without its companion packages
  • A recent system update changed mail delivery configurations
  • Your sendmail configuration references non-existent components

sensible-mda is part of Ubuntu's mail transport infrastructure designed to:

1. Provide a standardized MDA interface
2. Select appropriate delivery methods (procmail, maildrop, etc.)
3. Handle local mail delivery according to system policies

For your described use case (local SMTP for web forms and system logs), you don't strictly need sensible-mda. Here's why:

  • Basic local delivery can be handled by sendmail itself
  • System logs don't require complex MDA processing
  • Web form submissions typically bypass local delivery agents

Option 1: Install the Missing Package

sudo apt-get install sendmail-bin
sudo apt-get --reinstall install sendmail

Option 2: Configure Sendmail Directly

Edit your sendmail configuration to bypass MDA lookup:

# In /etc/mail/sendmail.mc
define(confLOCAL_MAILER', local')dnl
define(LOCAL_MAILER_PATH', /usr/lib/sendmail')dnl
define(LOCAL_MAILER_ARGS', sendmail -d -r $f')dnl

Then regenerate your sendmail.cf:

sudo sendmailconfig

Option 3: Disable MDA Checking

For minimal setups, you can modify the mailer table:

# In /etc/mail/mailertable
.local   local:your.host.name
.local.  local:your.host.name

The sudden appearance suggests:

  • An automatic update changed default configurations
  • Another mail-related package installation modified dependencies
  • System scripts may have modified your mail infrastructure

After applying any solution, verify with:

sudo sendmail -bv root
tail -f /var/log/mail.log

You should no longer see the sensible-mda errors in the logs.

If you're not deeply invested in sendmail, consider switching to Postfix for Ubuntu systems:

sudo apt-get install postfix
sudo apt-get remove sendmail

For basic local delivery, Postfix requires less configuration and handles Ubuntu's mail infrastructure more naturally.