Fixing OpenSMTPD Queue Entries

Michael-John Turner bio photo By Michael-John Turner Comment

I recently ran into a problem with OpenSMTPD on one of my OpenBSD systems. Due to a misconfiguration there were a number of entries in the mail queue with the wrong smarthost defined - unfortunately this information is stored in the queue itself and changing smtpd.conf doesn’t update the queue entries.

Fixing it is easy enough:

  1. Shut down OpenSMTPD.

     # /etc/rc.d/smtpd stop
  2. Edit the spool files - they’re in /var/spool/smtpd/queue/*, one per email. You need to replace the mta-relay entry with the correct value. If it’s not there, add it at the bottom of the file, along with the relevant mta-relay-flags:

    mta-relay: tls://
    mta-relay-flags: tls

  3. Start smtpd

     # /etc/rc.d/smtpd start
  4. Restart the queue

     # smtpctl schedule all


comments powered by Disqus