mail-stack-delivery package install needs to restart dovecot

Bug #870244 reported by Imre Gergely
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Release Notes for Ubuntu
Invalid
Undecided
Unassigned
dovecot (Ubuntu)
Fix Released
Low
Unassigned
Natty
Won't Fix
Low
Unassigned
Oneiric
Won't Fix
Low
Unassigned
Precise
Fix Released
Low
James Page

Bug Description

When installing mail-stack-delivery, it generates some custom config files for postfix and dovecot (to integrate dovecot in postfix for delivery and auth). After the package is done installing, postfix is restarted to load the new configuration, but dovecot is NOT restarted.
Because of this, when trying to do STARTTLS, the connection is interrupted and a message appears in the logs:

Oct 7 22:30:11 nns32-postfix postfix/smtpd[9708]: warning: SASL: Connect to private/dovecot-auth failed: No such file or directory
Oct 7 22:30:11 nns32-postfix postfix/smtpd[9708]: fatal: no SASL authentication mechanisms
Oct 7 22:30:12 nns32-postfix postfix/master[9684]: warning: process /usr/lib/postfix/smtpd pid 9708 exit status 1
Oct 7 22:30:12 nns32-postfix postfix/master[9684]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling

This is because SASL authentication through dovecot is enabled but there is no socket (dovecot wasn't restarted).

root@nns32-postfix:/etc/dovecot/auth.d# cat /etc/postfix/main.cf | grep auth
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/dovecot-auth

root@nns32-postfix:~# ls -la /var/spool/postfix/private/dovecot-auth
ls: cannot access /var/spool/postfix/private/dovecot-auth: No such file or directory

After manually restarting dovecot, the socket gets created and everything is ok

root@nns32-postfix:~# restart dovecot
dovecot start/running, process 9756
root@nns32-postfix:~# ls -la /var/spool/postfix/private/dovecot-auth
srw-rw---- 1 postfix postfix 0 2011-10-07 22:32 /var/spool/postfix/private/dovecot-auth

I guess this will not happen if dovecot is already configured to open that socket BEFORE installing mail-stack-delivery, but new installations will have this bug. Found in natty.

Tags: server-o-rs

Related branches

Revision history for this message
James Page (james-page) wrote :

Reproduced on natty; oneiric also has the same issue.

Marking 'Confirmed' with importance of 'Low' - this only impacts on first install and just requires a restart to resolve.

Changed in dovecot (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Dave Walker (davewalker) wrote :

Raising three tasks, marked Natty task as Won't Fix - as it doesn't seem to have a high enough impact to warrant.

tags: added: server-o-rs
Changed in dovecot (Ubuntu Natty):
status: New → Confirmed
Changed in dovecot (Ubuntu Precise):
status: New → Confirmed
Changed in dovecot (Ubuntu Natty):
status: Confirmed → Won't Fix
importance: Undecided → Low
Changed in dovecot (Ubuntu Precise):
importance: Undecided → Low
Changed in dovecot (Ubuntu Oneiric):
milestone: none → oneiric-updates
Revision history for this message
James Page (james-page) wrote :

dovecot appears to be somewhat racey when restarting:

Oct 13 12:12:09 ubuntu dovecot: master: Error: service(anvil): Socket already exists: /var/run/dovecot/anvil
Oct 13 12:12:09 ubuntu dovecot: master: Error: service(anvil): Socket already exists: /var/run/dovecot/anvil-auth-penalty
Oct 13 12:12:09 ubuntu dovecot: master: Fatal: Failed to start listeners

I get occasional service dovecot restart failures - which makes this a little unreliable.

James Page (james-page)
Changed in dovecot (Ubuntu Precise):
assignee: nobody → James Page (james-page)
milestone: none → precise-alpha-1
Changed in dovecot (Ubuntu Oneiric):
status: Confirmed → Won't Fix
James Page (james-page)
Changed in dovecot (Ubuntu Precise):
status: Confirmed → In Progress
Dave Walker (davewalker)
Changed in dovecot (Ubuntu Oneiric):
milestone: oneiric-updates → none
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dovecot - 1:2.0.15-1ubuntu1

---------------
dovecot (1:2.0.15-1ubuntu1) precise; urgency=low

  * Merge from Debian Testing, remaining changes:
    + Add mail-stack-delivery package:
      - Update d/rules
      - d/control: convert existing dovecot-postfix package to a dummy
        package and add new mail-stack-delivery package.
      - Update maintainer scripts.
      - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
      - d/mail-stack-delivery.preinst: Move previously installed backups and
        config files to a new package namespace.
      - d/mail-stack-delivery.prerm: Added to handle downgrades.
    + Use Snakeoil SSL certificates by default:
      - d/control: Depend on ssl-cert.
      - d/dovecot-core.postinst: Relax grep for SSL_* a bit.
    + Add autopkgtest to debian/tests/*.
    + Add ufw integration:
      - d/dovecot-core.ufw.profile: new ufw profile.
      - d/rules: install profile in dovecot-core.
      - d/control: dovecot-core - suggest ufw.
    + d/{control,rules}: enable PIE hardening.
    + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
    + Add apport hook:
      - d/rules, d/source_dovecot.py
    + Add upstart job:
      - d/rules, d/dovecot-core.dovecot.upstart, d/control,
        d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
        d/dovecot-pop3d.{postinst, postrm, prerm}.
        d/mail-stack-deliver.postinst:
        Convert init script to upstart.
  * d/01-mail-stack-delivery.conf: Add postfix->dovecot auth listener
    to mail-stack-delivery configuration (LP: #874135).
  * d/mail-stack-delivery.{postinst,postrm}: Restart dovecot to pickup/drop
    mail-stack-delivery configuration (LP: #870244).
  * d/control: Added Pre-Depends: dpkg (>= 1.15.6) to dovecot-dbg to support
    xz compression in Ubuntu.
  * d/control: Demote dovecot-common Recommends: to Suggests: to prevent
    install of extra packages on upgrade.
 -- James Page <email address hidden> Wed, 19 Oct 2011 15:54:40 +0100

Changed in dovecot (Ubuntu Precise):
status: In Progress → Fix Released
Revision history for this message
zasran (erik-zasran) wrote :

I see the same symptoms but restarting dovecot and postfix does not help.

Errors:

Nov 7 00:56:40 jojda postfix/smtpd[16049]: connect from localhost[127.0.0.1]
Nov 7 00:56:40 jojda postfix/smtpd[16049]: warning: SASL: Connect to private/dovecot-auth failed: No such file or directory
Nov 7 00:56:40 jojda postfix/smtpd[16049]: fatal: no SASL authentication mechanisms
...
Nov 7 00:56:41 jojda postfix/master[12506]: warning: process /usr/lib/postfix/smtpd pid 16049 exit status 1
Nov 7 00:56:41 jojda postfix/master[12506]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling

Relevant packages:
postfix 2.8.5-2~build1
dovecot-common 1:2.0.13-1ubuntu3 secure mail server that supports mbox, maildir, dbox and mdbox mailboxes
dovecot-imapd 1:2.0.13-1ubuntu3 secure IMAP server that supports mbox, maildir, dbox and mdbox mailboxes
dovecot-managesieved 1:2.0.13-1ubuntu3 secure ManageSieve server for Dovecot
dovecot-pop3d 1:2.0.13-1ubuntu3 secure POP3 server that supports mbox, maildir, dbox and mdbox mailboxes
dovecot-postfix 1:2.0.13-1ubuntu3 mail server delivery agent stack provided by Ubuntu server team
dovecot-sieve 1:2.0.13-1ubuntu3 sieve filters support for Dovecot

Revision history for this message
Imre Gergely (cemc) wrote :

@zasran: Maybe you have some other configuration issues. I think you should open a separate bugreport.

Revision history for this message
Dave Walker (davewalker) wrote :

Marking Release Notes task Invalid, it now DTRT.

Changed in ubuntu-release-notes:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.